How to retrieve a graphics object from an image object????
-
I'am trying to retrieve a graphics object from an image object using the piece of code given below Graphics GDC = Graphics.Getimage(objImage) But it is throwing the exception...graphics cannot b retrieved from an image having INDEXED PIXEL FORMAT.Cud u tell me the reason y??? Nature of my work: I'am trying 2 draw some shapes on 2 an image in a picturebox control.After drawing the image i need 2 rotate the image.While rotating i need my drawings also 2 b rotated. I have tried it with all sort of transformations and then also itz not working.So i thought of retrieving the graphics object from the image and draw the shape(rectangle) using that so that while i'am rotating the image the drawing is also rotated. Pleez help me as i'm less xperienced in C# Regards, MMX
-
I'am trying to retrieve a graphics object from an image object using the piece of code given below Graphics GDC = Graphics.Getimage(objImage) But it is throwing the exception...graphics cannot b retrieved from an image having INDEXED PIXEL FORMAT.Cud u tell me the reason y??? Nature of my work: I'am trying 2 draw some shapes on 2 an image in a picturebox control.After drawing the image i need 2 rotate the image.While rotating i need my drawings also 2 b rotated. I have tried it with all sort of transformations and then also itz not working.So i thought of retrieving the graphics object from the image and draw the shape(rectangle) using that so that while i'am rotating the image the drawing is also rotated. Pleez help me as i'm less xperienced in C# Regards, MMX
I think you mean the Graphics.FromImage() method. The exception is thrown because your image contains an indexed pixel format, which is unsupported.
-
I think you mean the Graphics.FromImage() method. The exception is thrown because your image contains an indexed pixel format, which is unsupported.