Reputation: 1432
I have a WICBitmap
that contains an image in my MFC program. Is there any way to draw this bitmap onto a device context?
void DrawBitmap(IWICBitmapSource source, HDC targetDC, int X, int Y, int cx, int cy)
{
//source: The Bitmap to draw
//TargetDC: The HDC to draw onto (e.g. a printer or screen DC)
//X,Y: The location on the DC to draw the bitmap
}
Upvotes: 1
Views: 1394
Reputation: 26259
There are a number of samples on MSDN that show how to display a WIC bitmap using, for example, GDI, GDI+, Direct2D etc.
Microsoft provides a WIC Image Viewer Using GDI Sample (GitHub mirror)
The basic idea is:
CreateDibSectionFromBitmapSource
)Upvotes: 2
Reputation: 3147
The file can be edited separately as bmp file, and after you can load WIC object as you can see in How to Load a Bitmap from a File.
Upvotes: -1