FWH 16.11 Texured Fonts

FWH 16.11 Texured Fonts

Postby nageswaragunupudi » Thu Nov 24, 2016 5:53 am

Painting text with brushed fonts

Image
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10283
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: FWH 16.11 Texured Fonts

Postby Antonio Linares » Thu Nov 24, 2016 10:35 am

very nice :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41351
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FWH 16.11 Texured Fonts

Postby nageswaragunupudi » Wed Nov 30, 2016 11:02 am

Source Code
Code: Select all  Expand view
#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
nageswaragunupudi
 
Posts: 10283
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: FWH 16.11 Texured Fonts

Postby karinha » Wed Nov 30, 2016 5:46 pm

very nice :-)
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7303
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: FWH 16.11 Texured Fonts

Postby mastintin » Thu Dec 01, 2016 11:38 am

Se podria añadir esta funcion tambien ? ...
Code: Select all  Expand view


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  Expand view

 
....
aPalBmp  := oWnd:ReadPalBmpEx( "c:\fwh\bitmaps\olga1.jpg", nil, .t. )
   pBrush   := GDIP_IMAGEBRUSH( aPalBmp[ 1 ] )
   GDIP_SETWRAPTEXTUREBRUSH(   pBrush  , 1  )
.....


 
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: FWH 16.11 Texured Fonts

Postby ukoenig » Thu Dec 01, 2016 4:26 pm

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
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: FWH 16.11 Texured Fonts

Postby mastintin » Thu Dec 01, 2016 5:06 pm

Ukoening Gooood ....

Gdiplus Sfere from code ... :-)

Image
User avatar
mastintin
 
Posts: 1516
Joined: Thu May 27, 2010 2:06 pm

Re: FWH 16.11 Texured Fonts

Postby ukoenig » Thu Dec 01, 2016 8:33 pm

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: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: FWH 16.11 Texured Fonts

Postby ukoenig » Fri Dec 02, 2016 10:58 am

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 27 guests