简体   繁体   中英

Send HBITMAP over socket

I need code in C++ that gets HBITMAP from one side and sends it through the socket and on the other side receive and make it HBITMAP again.

It has to be fast and effective

If it is more comfortable, use the GDI+ bitmap

That's so not going to work!

What you need to go is convert the HBITMAP to a BITMAP using the GetObject function. Then serialize this object over the network. NOTE: You'll need to make sure you serialize the bmBits member correctly.

On the other side, once you've deserialized the BITMAP you can use CreateBitmapIndirect to get a HBITMAP .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM