Clipboard Image

BlitzMax Forums/BlitzMax Programming/Clipboard Image

AntonyWells(Posted 2006) [#1]
Does anyone know how to set and access the clipboard image buffer on the windows version of max?

I recall reading windows api uses the same bgra format gl uses so it shouldn't be too hard.


taxlerendiosk(Posted 2006) [#2]
I looked into Windows clipboard manipulation but couldn't get around the Memory Exception Errors that seemed to crop up when I tried to do anything more complicated than text. I'm beginning to wonder if there might actually be some fundamental problem with how BlitzMax handles memory in Windows, because you seem to get these exceptions for all kinds of things that other languages have no problem with.


AntonyWells(Posted 2006) [#3]
Do you happen to have any of the code you messed about with laying about?

I've found some code here that handles the text aspects of the clipboard just fine(Apprently, havn't tried it myself)
but not images.

I'm guessing the reason you're getting memory exceptions is because the clipboard api is returning a bitmap structure to you which it's self contains another pointer to the actual image data.
If so it would be a simple case of wrting a c wrapper to take the returned handled and acquire the pointer from that.

I just don't have mingw installed atm so can't be arsed to check, but I will do tomorrow.


Suco-X(Posted 2006) [#4]
Use this
Click
and load the Pixmap with LoadImage(Pixmap)
Mfg Suco


AntonyWells(Posted 2006) [#5]
Thanks. Couple of questions though. Why would I need to load pixmap when you provided a function that returns the clipboard image as a pixmap already? Is there a problem with it?
Finally did you ever get around to writing a pixmap to clipboard function? would it be hard?