move a image on a image control

move a image on a image control

Postby Silvio.Falconi » Wed Jun 17, 2015 7: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

Image

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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6834
Joined: Thu Oct 18, 2012 7:17 pm

Re: move a image on a image control

Postby Antonio Linares » Thu Jun 18, 2015 7: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
User avatar
Antonio Linares
Site Admin
 
Posts: 41366
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: move a image on a image control

Postby nageswaragunupudi » Thu Jun 18, 2015 8:04 am

Use TXImage
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10295
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: move a image on a image control

Postby Silvio.Falconi » Thu Jun 18, 2015 4: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6834
Joined: Thu Oct 18, 2012 7:17 pm

Re: move a image on a image control

Postby ukoenig » Thu Jun 18, 2015 4: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

Image

Image

Image

best regards
Uwe :)
Last edited by ukoenig on Mon Sep 28, 2015 1:40 pm, edited 6 times in total.
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: move a image on a image control

Postby Silvio.Falconi » Thu Jun 18, 2015 5: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6834
Joined: Thu Oct 18, 2012 7:17 pm

Re: move a image on a image control

Postby ukoenig » Thu Jun 18, 2015 5: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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: move a image on a image control

Postby Silvio.Falconi » Thu Jun 18, 2015 6: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 November 2023 - January 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
User avatar
Silvio.Falconi
 
Posts: 6834
Joined: Thu Oct 18, 2012 7:17 pm

Re: move a image on a image control

Postby ukoenig » Fri Jun 19, 2015 11:30 am

Added ZOOM on buttonaction.
is it the solution, You are looking for`?

Image

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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 46 guests