本文介绍了使位图成为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#
推荐答案
这篇关于使位图成为hDC的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!