xcdemon05
xcdemon05

Reputation: 1432

Draw WICBitmap to window?

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

Answers (2)

Roger Rowland
Roger Rowland

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:

Upvotes: 2

Mihai8
Mihai8

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

Related Questions