In my program, I show a list of .bmp files in a folder - the user can click on the name of a file, and see it displayed in a child window - this works fine, all the bmp's are properly displayed.
Now, I have a toolbar button which can be clicked to send the displayed image to the clipboard, to paste into another program. But, sometimes it works, sometimes not.....
Here is my code:
Code: Select all
CopyImage(2,1)
UseImage(1)
SetClipboardData(#PB_ClipboardImage,ImageID())
Now, I paste it into PSP - sometimes it works, sometimes I get an error "can't read clipboard data", and sometimes nothing happens at all....
And sometimes when it doesn't work, I get a message from Windows that my program has caused an invalid page fault......
Oh, and the reason for copying the original image (image #2) into a new image (image #1) first, is because when I just copy the original image to the clipboard, when I try to paste the non-working ones into PSP, not only do they not paste, but also the image displayed in my program's window (in an image gadget) would disappear....
So, I next tried Irfanview - here, all the images will "paste" in, but the ones that don't paste into PSP come into Irfanview as just tall, thin, all black 2 colour images (my desktop is 32bit)
Any ideas?
This isn't random, either - it seems to be always the same images that work, and the same ones that don't work. Is there such a thing as a "bad" bmp, that will display ok in an image gadget, but won't copy to the clipboard?