Page 1 of 1

FWH 16.11 Texured Fonts

Posted: Thu Nov 24, 2016 5:53 am
by nageswaragunupudi
Painting text with brushed fonts

Image

Re: FWH 16.11 Texured Fonts

Posted: Thu Nov 24, 2016 10:35 am
by Antonio Linares
very nice :-)

Re: FWH 16.11 Texured Fonts

Posted: Wed Nov 30, 2016 11:02 am
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
 

Re: FWH 16.11 Texured Fonts

Posted: Wed Nov 30, 2016 5:46 pm
by karinha
very nice :-)

Re: FWH 16.11 Texured Fonts

Posted: Thu Dec 01, 2016 11:38 am
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  )
.....


 

Re: FWH 16.11 Texured Fonts

Posted: Thu Dec 01, 2016 4:26 pm
by ukoenig
Gradient font on window :

Image

with defined adjustment, position and area :

Image

best regards
Uwe :D

Re: FWH 16.11 Texured Fonts

Posted: Thu Dec 01, 2016 5:06 pm
by mastintin
Ukoening Gooood ....

Gdiplus Sfere from code ... :-)

Image

Re: FWH 16.11 Texured Fonts

Posted: Thu Dec 01, 2016 8:33 pm
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

Re: FWH 16.11 Texured Fonts

Posted: Fri Dec 02, 2016 10:58 am
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