Page 1 of 1

Save dialog to Jpg RESOLVED

Posted: Thu Nov 14, 2024 10:13 am
by Silvio.Falconi
is it possible to save part of a dialog in a jpg file?

Re: Save dialog to Jpg

Posted: Fri Nov 15, 2024 2:49 am
by nageswaragunupudi

Code: Select all | Expand

oDlg:SaveAsImage( cFileJpg, { top, left, bottom, right } )

Re: Save dialog to Jpg

Posted: Fri Nov 15, 2024 9:21 am
by Silvio.Falconi
nageswaragunupudi wrote:

Code: Select all | Expand

oDlg:SaveAsImage( cFileJpg, { top, left, bottom, right } )

I made
oBar:AddItem( "Salva", "save_48.bmp", {|| SalvaDialog(nType,oDlg) }, {||.t.}, .f., "" )

Function SalvaDialog(nType,oDlg)
local cFileJpg1:= "TopTen_Lotto_Ritardatari.jpg"
local cFileJpg2:= "TopTen_Lotto_Frequenti.jpg"
If nType=1
oDlg:SaveAsImage( cFileJpg1, { 0, 0, oDlg:nbottom, oDlg:nright-100 } )
else
oDlg:SaveAsImage( cFileJpg2, { 0, 0, oDlg:nbottom, oDlg:nright-100 } )
endif
return nil


Problems

when the nType=1 save good

Image



when the ntye =2 save bad

Image

if the coordinates are the same how is it possible that in the second type it also prints the menu to the side and starts a black area to the right and below?

Re: Save dialog to Jpg

Posted: Fri Nov 15, 2024 9:27 am
by Silvio.Falconi
Now I correct with this

[img] Function SalvaDialog(nType,oDlg)
local cFileJpg1:= "TopTen_Lotto_Ritardatari.jpg"
local cFileJpg2:= "TopTen_Lotto_Frequenti.jpg"
local oRect:= oDlg:GetCliRect()
If nType=1
oDlg:SaveAsImage( cFileJpg1, { oRect:nTop, oRect:nLeft, oRect:nbottom, oRect:nright-100 } )
else
oDlg:SaveAsImage( cFileJpg2, { oRect:nTop, oRect:nLeft, oRect:nbottom, oRect:nright-100 } )
endif
return nil[/img]