开发者

Converting a BufferedImage to HBITMAP

开发者 https://www.devze.com 2023-04-11 10:43 出处:网络
I need to convert a Java BufferedImage into an HBITMAP. So far I have allocated the memory needed for this operation, but I do not know what API functions I have to use to convert my BufferedImage in

I need to convert a Java BufferedImage into an HBITMAP.

So far I have allocated the memory needed for this operation, but I do not know what API functions I have to use to convert my BufferedImage into an hBitmap.

int width  = myImage.getWidth();
int height 开发者_运维百科= myImage.getHeight();


Pointer myImageHdc = gdi32.CreateCompatibleDC(Pointer.NULL);
Pointer myImageBitmap = gdi32.CreateCompatibleBitmap(myImageHdc, width, height);

gdi32.SelectObject(myImageHdc, myImageBitmap);

Any ideas? Thanks.

0

精彩评论

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

关注公众号