I want to load an image from a bmp file, without having to specify the final image dimensions, into a graphic control. The result would fill the graphic control, or not, according to the size of the image.
I can do that with an image control, but I want to use a graphic control.
The four basic commands for loading an image into a graphic control are:
I'd want to use RENDER, which reads from a file, but it requires that I specify the final image size.
The other 3 methods don't read from files.
Help provides code that lets me get the image size from a BMP:
But since I don't want to resize, then the steps aren't useful - except that RENDER requires them. I know it's only a few lines of code, but you'd think there'd be a way around them.
So, is there an straight-foward way to load an image from a file into a graphic control without knowing the final dimensions? I'll be loading multiple files and will have a control that's big enough to handle the largest image.
I can do that with an image control, but I want to use a graphic control.
The four basic commands for loading an image into a graphic control are:
Code:
- render: load from bmp/pbr entire picture resizable - copy: load from existing target all/part of picture cannot resize - imagelist: load from imagelist entire picture cannot resize - stretch: load from target all/part of picture resizable
The other 3 methods don't read from files.
Help provides code that lets me get the image size from a BMP:
Code:
nFile& = FREEFILE OPEN "myimage.bmp" FOR BINARY AS nFile& GET #nFile&, 19, nWidth& GET #nFile&, 23, nHeight& CLOSE nFile&
So, is there an straight-foward way to load an image from a file into a graphic control without knowing the final dimensions? I'll be loading multiple files and will have a control that's big enough to handle the largest image.
Comment