Hi,
If you make a 7016x4961 (A2) image and save it to a png file, then everything is fine.
FW_SaveImage(hBmp, "myfile.png")->.T.
However, if you make an image 9933x4961 (A1), the file is not saved
FW_SaveImage(hBmp, "myfile.png")->.F.
That is, if the picture is too big, then it does not have enough memory to save to a file. How can I get around this obstacle ?
FW 24.02
The picture is too big
Re: The picture is too big
I'll probably make some small .png files and glue them (from below) using the imagemagick utility into a single .png file. Can anyone tell me how to write a command for imagemagick ?
- Antonio Linares
- Site Admin
- Posts: 42268
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: The picture is too big
To combine multiple PNG files into a single image using ImageMagick, you have a couple of options:
Using montage:
If you want to create a grid-like arrangement of images, you can use the montage function. For example:
cd /path/to/your/images
montage *.png -tile 2x -geometry +1+1 output.png
This command will create a 2x2 grid of images (you can adjust the -tile and -geometry options as needed).
Using -composite:
If you want to overlay one image on top of another (e.g., watermarking), you can use the -composite option. For example:
convert "bottom00.png" "top00.png" -composite "output00.png"
This command will overlay "top00.png" on top of "bottom00.png" and save the result as "output00.png"
- nageswaragunupudi
- Posts: 10691
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: The picture is too big
No please.However, if you make an image 9933x4961 (A1), the file is not saved
FW_SaveImage(hBmp, "myfile.png")->.F.
That is, if the picture is too big, then it does not have enough memory to save to a file. How can I get around this obstacle ?
I just checked and FWH can create PNG file with size 9933x4961.
This is my test program
Code: Select all | Expand
#include "fivewin.ch"
function Main()
local hBmp, aBmp, oBrush
DEFINE BRUSH oBrush FILE "..\bitmaps\backgrnd\wood.bmp"
hBmp := FW_MakeYourBitmap( 9933, 4961, <|hDC,w,h|
local aBmp := FW_ReadImage( nil, "..\bitmaps\sea.bmp" )
local i, j, r, c
r := 200
for i := 1 to 6
c := 300
for j := 1 to 9
FW_DrawImage( hDC, aBmp, { r,c,r+768,c+1024 } )
c += 1024
next
r += 768
next
PalBmpFree( aBmp )
return nil
>, oBrush:hBrush ) //CLR_WHITE )
RELEASE BRUSH oBrush
FErase( "x.png" )
? FW_SaveImage( hBmp, "x.png" ) // -> .t.
DeleteObject( hBmp )
? File( "x.png" ) // -> .t. .. proof of creation
aBmp := FW_ReadImage( nil, "X.PNG" )
xImage( aBmp[ 1 ], "x.img : " + cValToChar( aBmp[ 3 ] ) + "x" + cValToChar( aBmp[ 4 ] ) )
PalBmpFree( aBmp )
return nil
https://we.tl/t-nNdLwKbrR1
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- nageswaragunupudi
- Posts: 10691
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: The picture is too big
montage with FWH
Code: Select all | Expand
function Montage()
local cImage1 := "..\bitmaps\sea.bmp"
local cImage2 := "..\bitmaps\hires\earth.bmp(1000x720)"
local hNew
hNew := FW_StitchImages( cImage1, cImage2, "B" )
XImage( hNew )
return nil
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: The picture is too big
Rao, in this case, your method is not suitable, because I am dealing with a map. Before creating a bitmap file from it, I must increase its format according to the requested format (A0,A1,A2) and accordingly expand the size of the window per screen. If this is not done, the image blurs when zoomed in.
I made the A2 bitmap file in your way https://cloud.mail.ru/public/ymXZ/kBcZu7dFK
and mine https://cloud.mail.ru/public/7fz2/NbJR33uzd.
where to read about the FW_Switchimages function and its parameters ?
I made the A2 bitmap file in your way https://cloud.mail.ru/public/ymXZ/kBcZu7dFK
and mine https://cloud.mail.ru/public/7fz2/NbJR33uzd.
where to read about the FW_Switchimages function and its parameters ?