使位图成为hDC的内容 [英] make a bitmap the content of a hDC

查看:122
本文介绍了使位图成为hDC的内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Image imgx = Bitmap.FromFile("test.bmp");
Bitmap bmpx = new Bitmap(imgx);

IntPtr hDC = PlatformInvokeUSER32.GetDC(/* GET DC FROM THE bmpx bitmap */);
PlatformInvokeGDI32.SelectObject(hDC, new IntPtr x(bmpx));



谢谢.如上所述,我希望将文件中的bmp(bmpx)转换为dc(hDC),以便可以将其与bitblt()配合使用来进行裁剪.

关于如何去做的任何想法?谷歌在剪贴板上泄漏了vc ++解决方案,但没有为C#



Thanks. As said above I wish to get a bmp (bmpx) from a file into a dc (hDC) so that I can use it with bitblt() to crop it.

any ideas of how to go about it? google spills vc++ solutions over Clipboard but none for C#

推荐答案

This[^] article seems to have what you want.


这篇关于使位图成为hDC的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆