位图问题:HBITMAP [英] Bitmap question: HBITMAP

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

问题描述

使用SetBitmapBits使我感到困惑.将我的像素信息数组转移到句柄"HBITMAP"所拥有的缓冲区中是其唯一目的吗?

有没有办法知道此缓冲区的位置并直接写入该缓冲区?

似乎浪费时间在自己的数组上,然后通过调用SetBitmapBits(HBITMAP,size,source [])执行巨大的数组复制

还是我忘了,这一切我缺少什么? (之前发生过...)

我到处都在寻找SetBitmapBits/GetBitmapBits的实际功能,除了必须调用它们之外,没有发现其他任何东西. (或者他们的较新版本SetDIBits/GetDIBits:但是这些似乎它们应该更慢.)

Using SetBitmapBits is confusing me. Is its sole purpose to transfer my array of pixel info to a buffer owned by the handle "HBITMAP" ?

Is there a way to know where this buffer is located and write to it directly?

Seems like a waste of time to draw on your own array and then perform a huge array copy by calling SetBitmapBits(HBITMAP, size, source[])

Or am I out of my mind and there''s something I''m missing about all this? (It''s happened before...)

I have looked everywhere for what SetBitmapBits/GetBitmapBits actually do and have found nothing other than the fact you must call them. (Or their newer counterparts SetDIBits/GetDIBits: but these seem they should be even slower.)

Thanks in advance!

推荐答案

GDI对象的内部数据不属于您的进程,而是属于GDI子系统.您不能直接对其进行读/写操作,因为它们之间有一个过程边界"(它们甚至可以在另一台机器上!).

内存本身可以通过GDI功能移动,而无需通知程序.很难给你一个内存地址.
GDI object''s internal data don''t belong to your process but to the GDI subsystem. You cannot read/write to them directly because there is a "process boundary" in between (they can even be on another machine!).

The memory itself can be moved around by the GDI functions, without your program even notice. It would be quite hard to give you a memory address to that.


这篇关于位图问题:HBITMAP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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