开发者

C# - Draw one or more HBitmaps on a Bitmap without using Image.FromHBitmap

开发者 https://www.devze.com 2023-01-30 17:27 出处:网络
I receive multiple (small) images stored in HBitmaps (handles to GDI bitmaps) and I want to draw them together in a large C# System.Drawing.Bitmap object. For performance reasons, I don\'t want to use

I receive multiple (small) images stored in HBitmaps (handles to GDI bitmaps) and I want to draw them together in a large C# System.Drawing.Bitmap object. For performance reasons, I don't want to use Image.FromHBitmap to first convert 开发者_开发问答the HBitmaps, as the method makes a copy of the GDI bitmap.

Is there a way to do this? Graphics.DrawImage seems to require System.Drawing Image/Bitmap objects.

I'm using C#/Windows Forms/System.Drawing.


The only other way I can think of is to use the old GDI APIs. In other words, create two device contexts, SelectObject the bitmaps into them and BitBlt on to the other.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号