move a image on a image control
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Wed Jun 17, 2015 7:39 pm
by Silvio.Falconi
When I load an image into a image control it put the image at the left angle as you can see on this picture
![Image](http://www.eoeo.it/wp-content/uploads/2015/06/err.jpg)
how I can make to move the image at center of image control ?
Re: move a image on a image control
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Thu Jun 18, 2015 7:15 am
by Antonio Linares
Please provide a small and self contained example to see how you are doing it, thanks
Re: move a image on a image control
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Thu Jun 18, 2015 4:00 pm
by Silvio.Falconi
@ 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
Re: move a image on a image control
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Thu Jun 18, 2015 4:06 pm
by ukoenig
Silvio,
my testtool :
Image centered on defined image.
Alpha on JPG and jpg on jpg ( or other formats )
select any combination of image 1 and image 2
Download ( complete with exe, prg and images ) :
http:((
http://www.pflegeplus.com/DOWNLOADS/Center2.zipImages to be loaded from the subdirectory
/IMAGES![Image](http://www.pflegeplus.com/IMAGES/Center3a.jpg)
![Image](http://www.pflegeplus.com/IMAGES/Center1.jpg)
![Image](http://www.pflegeplus.com/IMAGES/Center2.jpg)
best regards
Uwe
![Smile :)](./images/smilies/icon_smile.gif)
Re: move a image on a image control
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Thu Jun 18, 2015 5:20 pm
by Silvio.Falconi
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
Re: move a image on a image control
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Thu Jun 18, 2015 5:39 pm
by ukoenig
Silvio,
what image do You want to zoom ?
the main-image-area or the centered image ?
best regards
Uwe
![Question :?:](./images/smilies/icon_question.gif)
Re: move a image on a image control
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Thu Jun 18, 2015 6:05 pm
by Silvio.Falconi
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
Re: move a image on a image control
![Post Post](./styles/prosilver/imageset/icon_post_target.gif)
Posted:
Fri Jun 19, 2015 11:30 am
by ukoenig
Added ZOOM on buttonaction.
is it the solution, You are looking for`?
![Image](http://www.pflegeplus.com/IMAGES/Zoom1.jpg)
![Image](http://www.pflegeplus.com/IMAGES/Zoom2.jpg)
best regards
Uwe
![Question :?:](./images/smilies/icon_question.gif)