FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour set font using TextOut or ExtTextOut
Posts: 204
Joined: Mon Oct 17, 2005 09:09 PM
set font using TextOut or ExtTextOut
Posted: Mon May 19, 2014 09:06 PM

I need to "paint" text "over" a bitmap.

Using the tsay() classes I get white background. If I use the TextOut functions I can successfully paint my text. My question is, I want to control the font before I TextOut.

How can I do this?

Don Lowenstein
www.laapc.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: set font using TextOut or ExtTextOut
Posted: Mon May 19, 2014 09:30 PM
Don,

have a look (as an example) at window.prg:

Code (fw): Select all Collapse
METHOD ShowToolTip() CLASS TWindow


EMG
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: set font using TextOut or ExtTextOut
Posted: Tue May 20, 2014 04:47 PM
Don,



External font- and text-define from multiline gets



The code-part, extracted from the tool :
( there is still more included in the function, it is just the basic to understand )

Code (fw): Select all Collapse
STATIC FUNCTION CL_TXT( hMemDC ) // image hDC
LOCAL hOldFnt := SelectObject( hMemDC, oFont:hFont ) // selected font
LOCAL cText[20], I, nCount // Line-counter

SetBkMode( hMemDC, 1 ) 
SetTextColor( hMemDC, nPenColor ) // selected fontcolor

// multiline get 
nCount := StrCharCount( cFreetext2, CRLF )
FOR I := 1 TO nCount
     cText[I] := STRTOKEN( cFreetext2, I, CRLF )
NEXT
FOR I := 1 TO nCount
     TextOut( hMemDC, nTop, nLeft, cText[I] ) 
     nTop := nTop - nFontheight // draw multilines using Font-height
NEXT

DeleteObject( hOldFnt )

RETURN( NIL )
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: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: set font using TextOut or ExtTextOut
Posted: Wed May 21, 2014 05:40 AM
don lowenstein wrote:I need to "paint" text "over" a bitmap.

Using the tsay() classes I get white background.


FWH 14.04 fixes the problem.
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion