bmptxt
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: bmptxt
I can't find that sample in latest FWH.
EMG
EMG
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: bmptxt
Just define your own font and pass it as fifth parameter to the function TextOut().Silvio wrote:I saw bmptxt.prg sample
Howe I can modify the font to insert a big text ?
EMG
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Enrico,
I tried your suggestion but this does not work.
Regards,
Otto
// Placing text on top of a bitmap
#include "FiveWin.ch"
#define TRANSPARENT 1
static oWnd
//----------------------------------------------------------------//
function Main()
local oBmp, oFntGross
//oFntGross:= ChooseFont()
DEFINE FONT oFntGross NAME "MS Sans Serif" SIZE 10,15 BOLD
DEFINE WINDOW oWnd TITLE "Text on a bitmap"
@ 1, 1 BITMAP oBmp FILENAME "..\bitmaps\fw.bmp" OF oWnd
oBmp:bPainted = { || SetBkMode( oBmp:hDC, TRANSPARENT ),;
TextOut( oBmp:hDC, 15, 15, "Hello",oFntGross ) }
ACTIVATE WINDOW oWnd
return nil
//----------------------------------------------------------------//
I tried your suggestion but this does not work.
Regards,
Otto
// Placing text on top of a bitmap
#include "FiveWin.ch"
#define TRANSPARENT 1
static oWnd
//----------------------------------------------------------------//
function Main()
local oBmp, oFntGross
//oFntGross:= ChooseFont()
DEFINE FONT oFntGross NAME "MS Sans Serif" SIZE 10,15 BOLD
DEFINE WINDOW oWnd TITLE "Text on a bitmap"
@ 1, 1 BITMAP oBmp FILENAME "..\bitmaps\fw.bmp" OF oWnd
oBmp:bPainted = { || SetBkMode( oBmp:hDC, TRANSPARENT ),;
TextOut( oBmp:hDC, 15, 15, "Hello",oFntGross ) }
ACTIVATE WINDOW oWnd
return nil
//----------------------------------------------------------------//
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Please try this
Code: Select all
oBmp:bPainted := { |hDC| OnPaint( hDC, "BOLD TEXT", oFntGross ) }
.......
.......
static function OnPaint( hDC, cMsg, oFont )
local hOldFont
hOldFont := SelectObject( hDC, oFont:hFont )
SetBkMode( hDC, TRANSPARENT )
TextOut( hDC, 5, 5, cMsg )
SelectObject( hDC, hOldFont )
return nil
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Thank you NageswaraRao,
I miss something:
Error description: Error BASE/1004 No exported method: HFONT
Regards,
Otto
// Placing text on top of a bitmap
#include "FiveWin.ch"
#define TRANSPARENT 1
static oWnd
//----------------------------------------------------------------//
function Main()
Local oBmp, oFont
DEFINE FONT oFont
oFont := ChooseFont()
DEFINE WINDOW oWnd TITLE "Text on a bitmap"
@ 1, 1 BITMAP oBmp FILENAME "..\bitmaps\fw.bmp" OF oWnd
oBmp:bPainted := { |hDC| OnPaint( hDC, "BOLD TEXT", oFont ) }
ACTIVATE WINDOW oWnd
return nil
//----------------------------------------------------------------//
static function OnPaint( hDC, cMsg, oFont )
local hOldFont
hOldFont := SelectObject( hDC, oFont:hFont )
SetBkMode( hDC, TRANSPARENT )
TextOut( hDC, 5, 5, cMsg )
SelectObject( hDC, hOldFont )
return nil
I miss something:
Error description: Error BASE/1004 No exported method: HFONT
Regards,
Otto
// Placing text on top of a bitmap
#include "FiveWin.ch"
#define TRANSPARENT 1
static oWnd
//----------------------------------------------------------------//
function Main()
Local oBmp, oFont
DEFINE FONT oFont
oFont := ChooseFont()
DEFINE WINDOW oWnd TITLE "Text on a bitmap"
@ 1, 1 BITMAP oBmp FILENAME "..\bitmaps\fw.bmp" OF oWnd
oBmp:bPainted := { |hDC| OnPaint( hDC, "BOLD TEXT", oFont ) }
ACTIVATE WINDOW oWnd
return nil
//----------------------------------------------------------------//
static function OnPaint( hDC, cMsg, oFont )
local hOldFont
hOldFont := SelectObject( hDC, oFont:hFont )
SetBkMode( hDC, TRANSPARENT )
TextOut( hDC, 5, 5, cMsg )
SelectObject( hDC, hOldFont )
return nil
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact: