Click to See Complete Forum and Search --> : DrawImage help


Rad76
March 5th, 2009, 01:00 PM
Hi,

I'm trying to call a DrawImage function using two Rectangles and imageAttributes. I'm able to successfully draw my image using:

gxBuffer.DrawImage(Anim, destRect, sourceRect, GraphicsUnit.Pixel);

but when I try to add my image Attributes options it doesn't like the statement anymore, says invalid arguments:

gxBuffer.DrawImage(Anim, destRect, sourceRect, GraphicsUnit.Pixel, imgAttribs);

I looked on MSDN this function and it seems it needs specific parameters, I couldn't find one which allows two Rects and imgAttributes, this seems very limiting. Is there any way around this?

Thanks.

toraj58
March 6th, 2009, 11:39 AM
there is no such overload that you have used.

see here for list of overload

http://msdn.microsoft.com/en-us/library/system.drawing.graphics.drawimage(VS.71).aspx

notice that some overloads are for .Net Compact Framework.

i think the nearest thing to what you want is this method:

public void DrawImage(Image, Point[], Rectangle, GraphicsUnit, ImageAttributes);

you can simulate a rectangle with an array of four points.