The Bitmap::GetHBITMAP method creates a GDI bitmap from this Bitmap object.
GpStatus WINGDIPAPI GdipCreateHBITMAPFromBitmap(GpBitmap* bitmap, HBITMAP* hbmReturn, ARGB background)
DIRECTDRAW WRAPPER WINDOWS
GpStatus WINGDIPAPI GdipCreateBitmapFromHBITMAP(HBITMAP hbm, HPALETTE hpal, GpBitmap** bitmap)Ĭreates a Bitmap::Bitmap object based on a handle to a Windows Windows Graphics Device Interface (GDI) bitmap and a handle to a GDI palette. GpStatus WINGDIPAPI GdipCreateBitmapFromGdiDib(GDIPCONST BITMAPINFO* gdiBitmapInfo, VOID* gdiBitmapData, GpBitmap** bitmap)Ĭreates a Bitmap::Bitmap object based on a BITMAPINFO structure and an array of pixel data. The Bitmap::Bitmap object maintains a reference to the DirectDraw surface until the Bitmap::Bitmap object is deleted or goes out of scope. GpStatus WINGDIPAPI GdipCreateBitmapFromDirectDrawSurface(IDirectDrawSurface7* surface, GpBitmap** bitmap)Ĭreates a Bitmap::Bitmap object based on a DirectDraw surface. GpStatus WINGDIPAPI GdipCreateBitmapFromGraphics(INT width, INT height, GpGraphics* target, GpBitmap** bitmap)Ĭreates a Bitmap::Bitmap object based on a Graphics object, a width, and a height. GpStatus WINGDIPAPI GdipCreateBitmapFromScan0(INT width, INT height, INT stride, PixelFormat format, BYTE* scan0, GpBitmap** bitmap)Ĭreates a Bitmap::Bitmap object based on an array of bytes along with size and format information. It is called when the useEmbeddedColorManagement parameter of the Bitmap::Bitmap constructor is set to TRUE. GpStatus WINGDIPAPI GdipCreateBitmapFromFileICM(GDIPCONST WCHAR* filename, GpBitmap **bitmap)Ĭreates a Bitmap::Bitmap object based on an image file. GpStatus WINGDIPAPI GdipCreateBitmapFromStreamICM(IStream* stream, GpBitmap **bitmap)Ĭreates a Bitmap::Bitmap object based on a stream. It is called when the useEmbeddedColorManagement parameter of the Bitmap::Bitmap constructor is set to FALSE.
GpStatus WINGDIPAPI GdipCreateBitmapFromFile(GDIPCONST WCHAR* filename, GpBitmap **bitmap)Ĭreates a Bitmap::Bitmap object based on an image file.
This function does not use Image Color Management (ICM). GpStatus WINGDIPAPI GdipCreateBitmapFromStream(IStream* stream, GpBitmap **bitmap)Ĭreates a Bitmap::Bitmap object based on a stream. Bitmap Functions and Corresponding Wrapper Methods Flat function The following flat API functions are wrapped by the Bitmap C++ class. For more information on using these wrapper methods, see GDI+ Flat API.
DIRECTDRAW WRAPPER CODE
Microsoft Product Support Services will not provide support for code that calls the flat API directly. Whenever you make calls to GDI+, you should do so by calling the methods and functions provided by the C++ wrappers. It is recommended that you do not directly call the functions in the flat API. The functions in the GDI+ flat API are wrapped by a collection of about 40 C++ classes. Windows GDI+ exposes a flat API that consists of about 600 functions, which are implemented in Gdiplus.dll and declared in Gdiplusflat.h.