valacar

valacar

  • NA
  • 3
  • 0

Missing DrawImage method overload

Feb 20 2005 5:44 AM
I've been using the DrawImage method with this specific signature: public void DrawImage(Image image, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit) but recently I wanted to add color key transparency, and I noticed there's no overloaded method that allows you to draw from a source RectangleF to a destination RectangleF with ImageAttributes support (which allows color key transparency). In other words, I want this: public void DrawImage(Image image, RectangleF destRect, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr) Was this overlooked somehow? According to GdipDrawImageRectRect(), which is the to the native GDI+ function they're wrapping, it supports ImageAttributes, so I don't understand why it would be ommited, unless by mistake. I'm not familiar with calling native functions, so perhaps someone could help me add this functionality, or maybe offer another way of doing it. I know there's a overloaded method which uses a PointF and a RectangleF, but I need support for scaling, so two RectangleF's are needed. Any help would be appreciated. Thanks.