
how I can make to move the image at center of image control ?
I use : FiveWin for Harbour March-April 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com

Please provide a small and self contained example to see how you are doing it, thanks
Use TXImage
@ 1, 0 IMAGE oImage SIZE 250, 250 OF oAllegati SCROLL
Local cPdfImage :=".\bitmaps\files\1.bmp"
oImage:LoadBmp( cPdfImage )
Mr Rao I not Have tximage I have jannuary 20115 version of fwh



thanks uwe
the image is on the center now
but I have a problem
I have 3 button s when I can change the zoom of image
if I use your function I cannot change the zoom of oImage because your function recreate another object
Silvio,
what image do You want to zoom ?
the main-image-area or the centered image ?
best regards
Uwe ![]()
Uwe,
I use this function
@ 0, 0 IMAGE oImage SIZE 250, 250 OF oDlg SCROLL
@ 230,275 BTNBMP obtn[1] PROMPT "A" of oDlg SIZE 15,10 NOBORDER PIXEL ACTION AjustaZoom(oImage,"S",oSay[7])
@ 230,295 BTNBMP obtn[2] PROMPT "Z-" of oDlg SIZE 15,10 NOBORDER PIXEL ACTION AjustaZoom(oImage,"R",oSay[7])
@ 230,315 BTNBMP obtn[3] PROMPT "Z+" of oDlg SIZE 15,10 NOBORDER PIXEL ACTION AjustaZoom(oImage,"A",oSay[7])
Function AjustaZoom(oBmp,cAccion,oSay)
local nZoom:=oBmp:Zoom()
do case
case cAccion == "S"
oBmp:lStretch := !oBmp:lStretch
oBmp:ScrollAdjust()
oBmp:Refresh( .t. )
oChk[2]:refresh()
case cAccion == "R"
if nZoom*10>1
oBmp:lStretch := .f.
nZoom:=nZoom-(0.10)
oBmp:Zoom(nZoom)
oBmp:Refresh()
oBmp:ScrollAdjust()
oChk[2]:refresh()
endif
case cAccion == "A"
oBmp:lStretch := .f.
nZoom:=nZoom+0.10
oBmp:Zoom(nZoom)
oBmp:Refresh()
oBmp:ScrollAdjust()
oChk[2]:refresh()
endcase
if oBmp:lStretch
oSay:SetText(Oemtoansi("Immagine allargata"))
else
oSay:SetText(Oemtoansi( "Zoom immagine...: "+alltrim(str(nZoom*100,10,0))+"%"))
endif
return NIL

