   c# image manipulation question
  Anyone know how to blit 2 4bpp indexed images together in c#?you cannot create a Graphics object from an indexed image..so thats out..and i would rather not import the win32 blit code...so...do i have any other options?Thanks!   
  plink   ;Quote:Original post by nex7Anyone know how to blit 2 4bpp indexed images together in c#?When you say blit them together, do you mean put them together to make an 8bpp image or blend them together but keep the 4bpp format?  I've got an idea for both, but I don't want to waste space, so if you could answer that, I'd be happy to give you my idea. [smile]-AJ   ;  I want to keep the same format...I have a large image and a smaller image....i want to draw the smaller image somewhere in the large image...normally you can get a graphics object and just do a graphics.drawimage(rect, img) but you cant do graphics objs with indexed images.   ;  ok, so basically you're going want to loop through on the larger image and replace the pixel values with the ones in the smaller image.  So in pseudocode it might look like this:store coords in larger image where you want to start drawing smaller imagefor (int i = coords.y; i < coords.y + smallImg.Height; i++)    for (int x = coords.x; x < coords.x + smallImg.Width; x++)   replace pixel value in larger image with value from smaller imageI don't know if your file is in binary or text format, but it shouldn't matter as long as you know how the file format works.Hope this helps and please post back if you need additional explanation or if this was totally off the mark.-AJ   