FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour write a test on Image control
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
write a test on Image control
Posted: Mon Feb 13, 2023 05:21 PM
I have an image control with ximage ( no bitmap no btnbmp)
Code (fw): Select all Collapse
 @  240,  90 XIMAGE oImage ;
             FILENAME ".\bitmaps\verde.jpg"  NOBORDER ;
             SIZE 250,200 ;
             OF oFrmFiscale ;
             UPDATE
            oImage:bRClicked  := { || NIL  }
            oImage:ltransparent:=.t.
            oImage:nUserControl :=0
and I try to write a text into
Code (fw): Select all Collapse
Static Function Calcola()
 local oBold
          DEFINE FONT oBold NAME 'Tahoma' SIZE 0, -16  BOLD
////my calculation
cCod :="wwwwwwwwwwwww"

 oImage:bPainted:= { |hDC|myfunc(hdc,oBold,cCod)}


return  nil

 Function  myfunc(hdc,oBold,cCod)
           FW_SayText( hDC, ;
           cCod, ;
          { 150, 32, 108, 25 },,oBold, CLR_GREEN,  , .f. )

       return nil

why not run ?
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: 1344
Joined: Wed Nov 16, 2005 09:14 PM
Re: write a test on Image control
Posted: Mon Feb 13, 2023 09:59 PM
Silvio, creo que el rectangulo de coordenadas donde muestras el texto tendría que ser mas grande
Code (fw): Select all Collapse
Function  myfunc(hdc,oBold,cCod)
           FW_SayText( hDC, ;
           cCod, ;
          {150,32,170, 250 },,oBold, CLR_GREEN,  , .f. )  // x1,y1 hasta x2,y2
return nil
Posts: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: write a test on Image control
Posted: Mon Feb 13, 2023 10:19 PM
cmsoft wrote:Silvio, creo que el rectangulo de coordenadas donde muestras el texto tendría que ser mas grande
Code (fw): Select all Collapse
Function  myfunc(hdc,oBold,cCod)
           FW_SayText( hDC, ;
           cCod, ;
          {150,32,170, 250 },,oBold, CLR_GREEN,  , .f. )  // x1,y1 hasta x2,y2
return nil
only if i hover over it then i see something, the procedure has some gets that the user has to fill in, every time i fill a get i refresh ccod . back in the day i used a say control on the dialog and did oSay:setext(ccod ) now I wanted to insert the string above an image

if I use btnbmp I have no problems and the function correctly writes cCod but if I use ximage I don't see the writing printed on the image
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: 7317
Joined: Thu Oct 18, 2012 07:17 PM
Re: write a test on Image control
Posted: Mon Feb 13, 2023 10:28 PM

resolved

need oImage:refresh()

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: 1344
Joined: Wed Nov 16, 2005 09:14 PM
Re: write a test on Image control
Posted: Mon Feb 13, 2023 11:46 PM

Me alegro Silvio!

Continue the discussion