How do you: get the hDC of a blitx gfx buffer?

Blitz3D Forums/Blitz3D Userlibs/How do you: get the hDC of a blitx gfx buffer?

Snarkbait(Posted 2005) [#1]
I did a search for this, and found some discussion but no definitive answer:

How do I get the Device Context of, say, the BackBuffer() with an api call?


sswift(Posted 2005) [#2]
As far as I know you can't. Especially with Blitz3D.

You can't even get the HDc of a canvas in Blitzplus. Well not the real one anyway. If you get the HDc of a canvas in Blitzplus, which onvolves using a Blitzplus-only command to get the windows handle of the canvas gadget and then getting the HDC of that, the HDc you get will be the image on the screen, and if you draw to it, then it will be erased every time the windows is moved or something is changed it in it and it gets redrawn automatically, which makes it realtively useless.

I did lots of research while making Seamless Texture Generator on what exactly I could access of the graphics in Blitz because I needed a fast way to scale images. I asked lots of people and searched MDSN a lot, and all I ever managed to do was plot some pixels on the screen which promptly got overwritten, and 1% of the time failed to draw completely. I also ended up getting crashes because it seems like graphics drawing operations are buffered in some way and I think I was filling up that buffer trying to draw everything with plot commands.

If there is a way to accomplish what you want, I'm fairly certain you would have to use C to do it. You may also have to access directly some of the internal structures in Blitz. I think the pointer to an image actually points to an internal structure with some data that could be useful to you. Actually, if there is an HDC in there or a pointer to some memory buffer, maybe you could make use of that. I don't know where the info on the structure of that data went off to though, someone figured a lot of the internal stuff out once. I don't even know if the images were one of them. Even ifyou succeed though, the data could change locations in a future version so you'd have that to worry about.


John Blackledge(Posted 2005) [#3]
I used HDCs all the time when I was (professionally) programming in C for Windows, so I know where you're comming from.

I'm afraid it has to be said that if sswift can't do it, then it probably can't be done.