write a test on Image control

write a test on Image control

Postby Silvio.Falconi » Mon Feb 13, 2023 5:21 pm

I have an image control with ximage ( no bitmap no btnbmp)

Code: Select all  Expand view

 @  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: Select all  Expand view
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 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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: write a test on Image control

Postby cmsoft » Mon Feb 13, 2023 9:59 pm

Silvio, creo que el rectangulo de coordenadas donde muestras el texto tendría que ser mas grande
Code: Select all  Expand view

Function  myfunc(hdc,oBold,cCod)
           FW_SayText( hDC, ;
           cCod, ;
          {150,32,170, 250 },,oBold, CLR_GREEN,  , .f. )  // x1,y1 hasta x2,y2
return nil
 
User avatar
cmsoft
 
Posts: 1290
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina

Re: write a test on Image control

Postby Silvio.Falconi » 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: Select all  Expand view

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 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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: write a test on Image control

Postby Silvio.Falconi » 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 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: 7061
Joined: Thu Oct 18, 2012 7:17 pm

Re: write a test on Image control

Postby cmsoft » Mon Feb 13, 2023 11:46 pm

Me alegro Silvio!
User avatar
cmsoft
 
Posts: 1290
Joined: Wed Nov 16, 2005 9:14 pm
Location: Mercedes - Bs As. Argentina


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 98 guests