| Visual Basic (Declaration) | |
|---|---|
Public Function ChangeToGdiPlusImage( _ ByVal flags As ChangeToGdiPlusImageFlags _ ) As Image  | |
| Visual Basic (Usage) |  Copy Code | 
|---|---|
 | |
| C# | |
|---|---|
public Image ChangeToGdiPlusImage( ChangeToGdiPlusImageFlags flags )  | |
| C++/CLI | |
|---|---|
public: Image ChangeToGdiPlusImage( ChangeToGdiPlusImageFlags flags )  | |
Parameters
- flags
 - Options for the conversion.
 
Return Value
The GDI+ image that this method creates.This example changes between a RasterImage and a GDI+ image
| Visual Basic |  Copy Code | 
|---|---|
Public Sub ChangeToGdiPlusImageExample() | |
| C# |  Copy Code | 
|---|---|
public void ChangeToGdiPlusImageExample()  | |
This result GDI+ image and this RasterImage object will share the same image data. You can use this method to pass a LEAD RasterImage object to other class library methods that expect a GDI+ Image object. Use the ConvertToGdiPlusImage method to obtain a GDI+ Image object that is a copy of this RasterImage object.
Calling this method may change the internal format of this RasterImage object.
Use TestGdiPlusCompatible to determine if the image is compatible for conversion to a GDI+ image.
For a RasterImage to be compatible with a GDI+ image it needs the following:
IsConventionalMemory to be true (Tiled, compressed and disk-based images are not supported) BitsPerPixel value of 1, 4, 8, 16, 24 or 32 Order value of RasterByteOrder.Rgb or RasterByteOrder.Bgr Not a gray scale image. ViewPerspective value of RasterViewPerspective.TopLeft 
For more information, refer to The RasterPaintEngine Property and 16bpp Grayscale Images and Using The PaintEngine Property.
Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family