将WICBitmap绘制到窗口?
问题描述:
我有一个WICBitmap
,其中包含我的MFC程序中的图像。有什么办法将这个位图绘制到设备上下文中吗?将WICBitmap绘制到窗口?
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
}
您可以链接到任何样品MSDN上这个节目使用GDI或GDI +显示WIC位图?或者,更好的是,发布代码? (你给的链接似乎陈旧 - 没有代码) – 2017-04-05 03:31:18
@IanBoyd是的,抱歉,虽然该链接工作正常,但MSDN已经删除了这些示例!还有其他可用的 - 快速谷歌[找到这个博客](http://www.nuonsoft.com/blog/2011/10/17/introduction-to-wic-how-to-use-wic-to-load -an-image-and-draw-it-with-gdi/comment-page-1 /),其中展示了如何使用GDI呈现WIC位图。虽然我*可以*复制/粘贴作者的代码,但我不确定这是否完全符合道德标准,即使有合适的归属。也许这个链接有帮助? – 2017-04-05 05:32:05