FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour "REDEFINE SAY ... TRANSPARENT" not work! SOLVED!
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
"REDEFINE SAY ... TRANSPARENT" not work! SOLVED!
Posted: Wed Aug 27, 2008 05:48 PM
Dear Antonio and friends!

* New: REDEFINE SAY ... TRANSPARENT already available. No need to declare a variable to hold the SAY object to set its transparency.

My syntax is here:
REDEFINE SAY PROMPT "Test oSay Transparent" ID 4001 OF oDlg FONT ( TFont():new( "Tahoma", 0, 25,, .T. ) ) TRANSPARENT

But, still not work!
Peace and lighting!

JĂșlio CĂ©sar M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Redefine SAY transparent
Posted: Wed Aug 27, 2008 06:10 PM
Hello JC,

i couldn't detect any problem.

As you can see : a transparent SAY on Gradient-background.
Value 0.50 is a GET

The say-text is directly written inside the resource. !!!!

I didn't use REDEFINE SAY



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: 445
Joined: Thu Feb 21, 2008 11:58 AM
"REDEFINE SAY ... TRANSPARENT" not work! SOLVED!
Posted: Wed Aug 27, 2008 06:24 PM
Uwe, this is my REDEFINE SAY into our application:



It's on top of a bitmap image from resource!
Not works!
Peace and lighting!

JĂșlio CĂ©sar M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Transparent SAY
Posted: Wed Aug 27, 2008 06:29 PM

Hello JC,

I understand.
This is complete different ( Text on BMP ).
I will give you a source-sample for this in this topic.

Regards
Uwe :lol:

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: 445
Joined: Thu Feb 21, 2008 11:58 AM
Re: Transparent SAY
Posted: Wed Aug 27, 2008 06:31 PM
ukoenig wrote:Hello JC,

I understand.
This is complete different ( Text on BMP ).
I will give you a source-sample for this in this topic.

Regards
Uwe :-)


Uew, please send me on julio.mferreira@gmail.com! And thanks!
Peace and lighting!

JĂșlio CĂ©sar M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
"REDEFINE SAY ... TRANSPARENT" not work! SOLVED!
Posted: Wed Aug 27, 2008 06:32 PM

JĂșlio,

Are you using a BRUSH from a bitmap for the Dialog ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
"REDEFINE SAY ... TRANSPARENT" not work! SOLVED!
Posted: Wed Aug 27, 2008 06:37 PM
Antonio Linares wrote:JĂșlio,

Are you using a BRUSH from a bitmap for the Dialog ?


Antonio, not! I'm using this way:
TBitmap():redefine( nId, cResName,, oDlg,,,, lStretch,,,,,, lTransparent )
Peace and lighting!

JĂșlio CĂ©sar M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
"REDEFINE SAY ... TRANSPARENT" not work! SOLVED!
Posted: Wed Aug 27, 2008 06:39 PM

JĂșlio,

Then try to use:

oBitmap:Say( nRow, nCol, cText, ... )

METHOD Say( nRow, nCol, cText, nClrFore, nClrBack, oFont, lPixel,;
lTransparent, nAlign )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
"REDEFINE SAY ... TRANSPARENT" not work! SOLVED!
Posted: Wed Aug 27, 2008 06:47 PM
Antonio Linares wrote:JĂșlio,

Then try to use:

oBitmap:Say( nRow, nCol, cText, ... )

METHOD Say( nRow, nCol, cText, nClrFore, nClrBack, oFont, lPixel,;
lTransparent, nAlign )


Antonio,

I tried with this implementation, but not works!
       oBitmap := TBitmap():redefine( 100, "IMG_BARRA_TOP",, oDlg )
       oBitmap:say( 2, 2, "Cadastro Plano de Contas",,,,, .T. )


This the result image:
Peace and lighting!

JĂșlio CĂ©sar M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
"REDEFINE SAY ... TRANSPARENT" not work! SOLVED!
Posted: Wed Aug 27, 2008 06:50 PM

Julio,

You have to do that call from the ON INIT of the dialog:

ACTIVATE DIALOG oDlg ;
ON INIT oBitmap:Say( 2, 2, "Cadastro Plano de Contas",,,,, .T. )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
"REDEFINE SAY ... TRANSPARENT" not work! SOLVED!
Posted: Wed Aug 27, 2008 06:51 PM

And remove the SAY control ! ("text") :-)

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
"REDEFINE SAY ... TRANSPARENT" not work! SOLVED!
Posted: Wed Aug 27, 2008 06:52 PM

In fact, it should be used from the ON PAINT, to properly refresh:

ACTIVATE DIALOG oDlg ;
ON PAINT oBitmap:Say( 2, 2, "Cadastro Plano de Contas",,,,, .T. )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 445
Joined: Thu Feb 21, 2008 11:58 AM
"REDEFINE SAY ... TRANSPARENT" not work! SOLVED!
Posted: Wed Aug 27, 2008 06:59 PM
Antonio,

My code:

DEFINE DIALOG oDlg RESOURCE "DEFAULT_FORM" OF oWnd ICON oIcon

       oBitmap := TBitmap():redefine( 100, "IMG_BARRA_TOP",, oDlg )
        
       ...

ACTIVATE DIALOG oDlg CENTER ON PAINT ( oBitmap:say( 2, 2, "Cadastro Plano de Contas",,,,, .T. ) )

Sorry, but still not work!

We using the class TSSay with syntax REDEFINE SENSITIVE SAY ... TRANSPARENT and this works fine!
I really want to use the native class of FWH with transparency! It's very better than!
Peace and lighting!

JĂșlio CĂ©sar M. Ferreira

FWH 8.10 / xHB 1.1.0 / xDevStudio 0.72 / Pelles C 5.0.1 / SQLLIB 1.9
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Text-Writing on BMP
Posted: Wed Aug 27, 2008 07:03 PM
Hello JC,

Like Antonio told you : You have to use ONPAINT, to solve your problem.

Here is just a quick sample, how i use text-writing on BMP's from Resource on any places.
The BMP-resource is filled with a brush or color, then a text is painted.
I use it for my Title-paintings.
Maybe you can find some informations on it.

The resource < Blanc > is a small BMP inside the resource, used as container. ID 100 is your BMP with the original size.
POSLEFT defines the needed left-position of the text.
The top-position of the text is calculated from the font- and BMP-height,
to center the text vertical.

REDEFINE BITMAP oBmp1  ID 100 ADJUST RESOURCE "Blanc"  OF oDlg1
oBmp1:bPainted := { |hDC|OnPaint( oDlg1,hDC,oBMP1, "Your Text", oFont, POSLEFT ) } 

//----------------------------------------------------------------// 

FUNCTION ONPAINT(oDlg1,hDC,oBmp,cText, oBFont,nPOSLEFT ) 
LOCAL hOldFont, oNewbrush, hBitmap, aRect, nTOP, nLEFT

hOldFont := SelectObject( hDC, oBFont:hFont )

// find the text-length

nTXTLG :=  GettextWidth( hDC, cText ) 

nBMPLONG  := oBmp:Super:nWidth() 
nBMPHIGHT := oBmp:Super:nHeight() 
nFONTHIGHT := oBfont:nInpHeight * -1 

// The text-pos is calculated

nLEFT := 5

IF nPOSLEFT = 0
   // Center-position in BMP if POSLEFT = 0
   nLEFT := (nBMPLONG - nTXTLG) / 2  
ELSE
   // defined left-position
   nLEFT := nPOSLEFT  
ENDIF

nNEWHIGHT := nFONTHIGHT

// Text-top-position is calculated.

nTOP := (nBMPHIGHT - nNEWHIGHT) / 2

aRect := GETCLIENTRECT( oBmp:hWnd )

oBmp:oBrush := oNewbrush 

SetTextColor( hDC,nColor)
SetBkMode( oBmp:hDC, 0 )

// Fills your BMP with a brush

FillRect( hDC, aRect, oBmp:oBrush:hBrush )

IF nPOSLEFT > 0
     TextOut( hDC, nTOP, nLEFT, cText )
ELSE
     TextOut( hDC, nTOP, nLEFT, cText ) 
ENDIF
SelectObject( hDC, hOldFont ) 

RETURN NIL


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: 4840
Joined: Fri Nov 18, 2005 04:52 PM
&quot;REDEFINE SAY ... TRANSPARENT&quot; not work! SOLVED!
Posted: Wed Aug 27, 2008 11:10 PM

Uwe,

>Like Antonio told you : You have to use ONPAINT, to solve your problem.

I think what JC is saying is that the 3rd-party product, sensitive SAY, does work without being called from ON PAINT, so it is techinically possible. He hopes that Antonio can achive the same with the native FW SAY. I hope so too.

James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10