Converting a BufferedImage to HBITMAP
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.
精彩评论