Painting text with brushed fonts
FWH 16.11 Texured Fonts
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
FWH 16.11 Texured Fonts
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
- nageswaragunupudi
- Posts: 8017
- Joined: Sun Nov 19, 2006 5:22 am
- Location: India
- Contact:
Re: FWH 16.11 Texured Fonts
Source Code
Code: Select all
#include "fivewin.ch"
function main()
local oWnd, oFont, aPalBmp, pBrush
local cText := "FWH1611" + CRLF + "VERSION" + CRLF + "BRUSHED" + CRLF + "TEXT FONTS"
DEFINE FONT oFont NAME "IMPACT" SIZE 0,-100 bold UNDERLINE
DEFINE WINDOW oWnd TITLE "FWH 16.11 BRUSHED FONTS"
aPalBmp := oWnd:ReadPalBmpEx( "c:\fwh\bitmaps\olga1.jpg", nil, .t. )
pBrush := GDIP_IMAGEBRUSH( aPalBmp[ 1 ] )
oWnd:nHeight := 600
oWnd:nWidth := 760
ACTIVATE WINDOW oWnd CENTERED ;
ON PAINT oWnd:SayText( cText, nil, "R", oFont, pBrush )
GDIPLUSDELETEBRUSH( pBrush )
PalBmpFree( aPalBmp )
RELEASE FONT oFont
return nil
Regards
G. N. Rao.
Hyderabad, India
G. N. Rao.
Hyderabad, India
Re: FWH 16.11 Texured Fonts
Se podria añadir esta funcion tambien ? ...
Code: Select all
HB_FUNC( GDIP_SETWRAPTEXTUREBRUSH )
{
TextureBrush * Brush = ( TextureBrush * ) hb_parptr( 1 );
int ntype = hb_parni( 2 ) ;
if ( ntype == 0 )
Brush->SetWrapMode( WrapModeTile ) ;
if ( ntype == 1 )
Brush->SetWrapMode( WrapModeTileFlipX ) ;
if ( ntype == 2 )
Brush->SetWrapMode( WrapModeTileFlipY ) ;
if ( ntype == 3 )
Brush->SetWrapMode( WrapModeTileFlipXY ) ;
if ( ntype == 4 )
Brush->SetWrapMode( WrapModeClamp ) ;
}
Code: Select all
....
aPalBmp := oWnd:ReadPalBmpEx( "c:\fwh\bitmaps\olga1.jpg", nil, .t. )
pBrush := GDIP_IMAGEBRUSH( aPalBmp[ 1 ] )
GDIP_SETWRAPTEXTUREBRUSH( pBrush , 1 )
.....
Re: FWH 16.11 Texured Fonts
Gradient font on window :
with defined adjustment, position and area :
best regards
Uwe
with defined adjustment, position and area :
best regards
Uwe
Last edited by ukoenig on Fri Dec 02, 2016 2:05 pm, edited 2 times in total.
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.
i work with FW.
If you have any questions about special functions, maybe i can help.
Re: FWH 16.11 Texured Fonts
Ukoening Gooood ....
Gdiplus Sfere from code ...
Gdiplus Sfere from code ...
Re: FWH 16.11 Texured Fonts
Usage inside METROPANEL ( works as well ) :
//-----------------------------------
FUNCTION BUILDMETRO(oWnd, nDStyle)
LOCAL oMetro, oHScroll, oBtn[30], oBrush, oVSlider
LOCAL oSelf, nOld := 0, oLizenz, cText, pBrush, aPalBmp
DEFINE METROPANEL oMetro OF oWnd TITLE "" ; // must be a EMPTY string otherwise START is displayed
COLOR aVal[8], CLR_BLUE
oMetro:lDesignMode := .F.
oMetro:nMetroTop = 160
oMetro:nMetroRows := 8
oMetro:SetFont( oFontLarge ) // Title
IF nScreenW < 1600
oMetro:nMetroMargin := 200
oMetro:nBtnSize = 140
ELSE
oMetro:nMetroMargin := 220
oMetro:nBtnSize = 160
ENDIF
oWnd:bMouseWheel = { | nKey, nDelta, nXPos, nYPos | oMetro:MouseWheel( nKey, nDelta, nXPos, nYPos ) }
oMetro:bRClicked := { |Row,Col| oWnd:End() }
// Background-function
// -----------------------
oBrush := WD_BACKGRD( oMetro, aVal[1], aVal[2], aVal[3], aVal[5], aVal[4], aVal[6], aVal[7] )
oMetro:SetBrush( oBrush )
oBrush:End()
cText := "Stammdaten"
aPalBmp := oWnd:ReadPalBmpEx( c_Pfad1 + "Blustone.bmp", nil, .t. )
pBrush := GDIP_IMAGEBRUSH( aPalBmp[ 1 ] )
DEFINE METROBUTTON oSBtn[1] OF oMetro ;
COLOR aVal[61], aVal[60] ;
FONT oTileFont ;
CAPTION "&Patienten" ;
ALIGN "TOPCENTER" ;
GROUP 1 ;
BITMAP c_Pfad1 + "Patient.bmp" ;
BMPALIGN "MIDDLECENTER" ;
SIZE 50, 50 ;
ACTION PATIENT() ;
BODYTEXT "Daten" ;
TEXTALIGN "BOTTOMLEFT" ;
TEXTFONT oTileFont
oSBtn[1]:nClrCaption := aVal[62]
oSBtn[1]:bMMoved = { | nRow, nCol, nFlags | SHOW_FRAME( oSBtn, 1, nOld ), nOld := 1 }
oSBtn[1]:bClrGrad := { |lInvert| If( lInvert, 0x80FFA54A, nARGB( 54, 0, 192, 0 ) ) }
........
........
oMetro:Show()
oMetro:bPainted := {|| oMetro:SayText( cText, { 50, 180, 120, 650 }, "L", oFontLarge, pBrush ) }
RETURN NIl
best regards
Uwe
//-----------------------------------
FUNCTION BUILDMETRO(oWnd, nDStyle)
LOCAL oMetro, oHScroll, oBtn[30], oBrush, oVSlider
LOCAL oSelf, nOld := 0, oLizenz, cText, pBrush, aPalBmp
DEFINE METROPANEL oMetro OF oWnd TITLE "" ; // must be a EMPTY string otherwise START is displayed
COLOR aVal[8], CLR_BLUE
oMetro:lDesignMode := .F.
oMetro:nMetroTop = 160
oMetro:nMetroRows := 8
oMetro:SetFont( oFontLarge ) // Title
IF nScreenW < 1600
oMetro:nMetroMargin := 200
oMetro:nBtnSize = 140
ELSE
oMetro:nMetroMargin := 220
oMetro:nBtnSize = 160
ENDIF
oWnd:bMouseWheel = { | nKey, nDelta, nXPos, nYPos | oMetro:MouseWheel( nKey, nDelta, nXPos, nYPos ) }
oMetro:bRClicked := { |Row,Col| oWnd:End() }
// Background-function
// -----------------------
oBrush := WD_BACKGRD( oMetro, aVal[1], aVal[2], aVal[3], aVal[5], aVal[4], aVal[6], aVal[7] )
oMetro:SetBrush( oBrush )
oBrush:End()
cText := "Stammdaten"
aPalBmp := oWnd:ReadPalBmpEx( c_Pfad1 + "Blustone.bmp", nil, .t. )
pBrush := GDIP_IMAGEBRUSH( aPalBmp[ 1 ] )
DEFINE METROBUTTON oSBtn[1] OF oMetro ;
COLOR aVal[61], aVal[60] ;
FONT oTileFont ;
CAPTION "&Patienten" ;
ALIGN "TOPCENTER" ;
GROUP 1 ;
BITMAP c_Pfad1 + "Patient.bmp" ;
BMPALIGN "MIDDLECENTER" ;
SIZE 50, 50 ;
ACTION PATIENT() ;
BODYTEXT "Daten" ;
TEXTALIGN "BOTTOMLEFT" ;
TEXTFONT oTileFont
oSBtn[1]:nClrCaption := aVal[62]
oSBtn[1]:bMMoved = { | nRow, nCol, nFlags | SHOW_FRAME( oSBtn, 1, nOld ), nOld := 1 }
oSBtn[1]:bClrGrad := { |lInvert| If( lInvert, 0x80FFA54A, nARGB( 54, 0, 192, 0 ) ) }
........
........
oMetro:Show()
oMetro:bPainted := {|| oMetro:SayText( cText, { 50, 180, 120, 650 }, "L", oFontLarge, pBrush ) }
RETURN NIl
best 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.
i work with FW.
If you have any questions about special functions, maybe i can help.
Re: FWH 16.11 Texured Fonts
I added the needed changes to the original sample < metrptst.prg > from FWH-sample-folder
All titles are shown with brushed fonts
DOWNLOAD ( please copy files to FWH-samples - directory for testing )
contents :
------------
metrptst1.prg
metrptst1.exe
http://www.pflegeplus.com/DOWNLOADS/MetroFont1.zip
Main-window
Start-screen
Listing image-files
Listing prg-files
Inside my config-section I added a option
the user can select a solid color or brush for the titles
best regards
Uwe
All titles are shown with brushed fonts
DOWNLOAD ( please copy files to FWH-samples - directory for testing )
contents :
------------
metrptst1.prg
metrptst1.exe
http://www.pflegeplus.com/DOWNLOADS/MetroFont1.zip
Main-window
Start-screen
Listing image-files
Listing prg-files
Inside my config-section I added a option
the user can select a solid color or brush for the titles
best 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.
i work with FW.
If you have any questions about special functions, maybe i can help.