FWH 16.11 Texured Fonts

Post Reply
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

FWH 16.11 Texured Fonts

Post by nageswaragunupudi »

Painting text with brushed fonts

Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

Re: FWH 16.11 Texured Fonts

Post by Antonio Linares »

very nice :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
nageswaragunupudi
Posts: 8017
Joined: Sun Nov 19, 2006 5:22 am
Location: India
Contact:

Re: FWH 16.11 Texured Fonts

Post by nageswaragunupudi »

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
User avatar
karinha
Posts: 4882
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: FWH 16.11 Texured Fonts

Post by karinha »

very nice :-)
João Santos - São Paulo - Brasil
User avatar
mastintin
Posts: 1502
Joined: Thu May 27, 2010 2:06 pm

Re: FWH 16.11 Texured Fonts

Post by mastintin »

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  )
.....


 
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: FWH 16.11 Texured Fonts

Post by ukoenig »

Gradient font on window :

Image

with defined adjustment, position and area :

Image

best regards
Uwe :D
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.
User avatar
mastintin
Posts: 1502
Joined: Thu May 27, 2010 2:06 pm

Re: FWH 16.11 Texured Fonts

Post by mastintin »

Ukoening Gooood ....

Gdiplus Sfere from code ... :-)

Image
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: FWH 16.11 Texured Fonts

Post by ukoenig »

Usage inside METROPANEL ( works as well ) :

Image

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

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 :D
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.
User avatar
ukoenig
Posts: 3981
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany
Contact:

Re: FWH 16.11 Texured Fonts

Post by ukoenig »

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

Image

Start-screen

Image

Listing image-files

Image

Listing prg-files

Image

Inside my config-section I added a option
the user can select a solid color or brush for the titles

Image

best regards
Uwe :D
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.
Post Reply