Ok, this is going to sound like a really, really stupid question...
But how do I display an image? I have the image info (height, width etc.) in a BITMAP structure, and the image itself is currently in one big (~2.5Mb) dynamic string.
The .bmBits member of the BITMAP structure is set as STRPTR(bits$), and then I use the CreateBitmapIndirect function, from the win32 API.
Not feeling brave enough to tackle device contexts and all that nonsense, I copied the code from Petzold to put a bitmap in the clipboard.
This gave me a nice black rectangle. Which is not what my original image looks like. I know that the image data is being generated correctly because I did manage to output if to a windows bitmap file, which is then correctly understood by graphics software, and can be set to the desktop wallpaper etc.
However, now I need to use (i.e. display) the image within my programme, which means persuading Windows that it is indeed an image, for which it can give me a handle. The API call I've been using should do the job, but all I get is a blank box, and having tried all the variations I can think of, and searched POFFS, I am now at a loss.
I wondered if its because I'm using a dynamic string, and tried to overlay an array using DIM... AT, but I have no idea if I was doing that properly, and it didn't work anyway.
Suggestions would be greatly appreciated.
------------------
--Dan
But how do I display an image? I have the image info (height, width etc.) in a BITMAP structure, and the image itself is currently in one big (~2.5Mb) dynamic string.
The .bmBits member of the BITMAP structure is set as STRPTR(bits$), and then I use the CreateBitmapIndirect function, from the win32 API.
Not feeling brave enough to tackle device contexts and all that nonsense, I copied the code from Petzold to put a bitmap in the clipboard.
This gave me a nice black rectangle. Which is not what my original image looks like. I know that the image data is being generated correctly because I did manage to output if to a windows bitmap file, which is then correctly understood by graphics software, and can be set to the desktop wallpaper etc.
However, now I need to use (i.e. display) the image within my programme, which means persuading Windows that it is indeed an image, for which it can give me a handle. The API call I've been using should do the job, but all I get is a blank box, and having tried all the variations I can think of, and searched POFFS, I am now at a loss.
I wondered if its because I'm using a dynamic string, and tried to overlay an array using DIM... AT, but I have no idea if I was doing that properly, and it didn't work anyway.
Suggestions would be greatly appreciated.
------------------
--Dan
Comment