FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour move a image on a image control
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
move a image on a image control
Posted: Wed Jun 17, 2015 07:39 PM
When I load an image into a image control it put the image at the left angle as you can see on this picture



how I can make to move the image at center of image control ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: move a image on a image control
Posted: Thu Jun 18, 2015 07:15 AM

Please provide a small and self contained example to see how you are doing it, thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: move a image on a image control
Posted: Thu Jun 18, 2015 08:04 AM

Use TXImage

Regards



G. N. Rao.

Hyderabad, India
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: move a image on a image control
Posted: Thu Jun 18, 2015 04:00 PM

@ 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

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

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
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: move a image on a image control
Posted: Thu Jun 18, 2015 04:06 PM
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.zip

Images to be loaded from the subdirectory /IMAGES







best regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: move a image on a image control
Posted: Thu Jun 18, 2015 05:20 PM

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

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

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
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: move a image on a image control
Posted: Thu Jun 18, 2015 05:39 PM

Silvio,

what image do You want to zoom ?
the main-image-area or the centered image ?

best regards
Uwe :?:

Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: move a image on a image control
Posted: Thu Jun 18, 2015 06:05 PM

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

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

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
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: move a image on a image control
Posted: Fri Jun 19, 2015 11:30 AM
Added ZOOM on buttonaction.
is it the solution, You are looking for`?





best regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.

Continue the discussion