Jump to content
Fivewin Brasil

Pintar letra na janela(window)


kapiaba

Recommended Posts

Pintar letra na janela(window)

#Include "Fivewin.ch"
	STATIC oWnd
	FUNCTION Main()
	   DEFINE WINDOW oWnd
	   ACTIVATE WINDOW oWnd MAXIMIZED ;
      ON PAINT Pinta( hDC )
	RETURN NIL
	FUNCTION Pinta( hDC )
	   LOCAL nColor
   LOCAL nLeft := 290
   LOCAL cTexto := "I LOVE FIVEWIN BRASIL"
   LOCAL oFont
   LOCAL hFont
   LOCAL nLen := len( cTexto )
   LOCAL cLetra, n
	   DEFINE FONT oFont NAME "Segoe UI Symbol" SIZE 0, - 50
	   hFont := SelectObject( hDC, oFont:hFont )
	   FOR n := 1 TO nLen
	      cLetra := substr( cTexto, n, 1 )
	      nColor := SetTextColor( hDC, nRandom( CLR_WHITE ) )
	      TextOut( hDC, 325, nLeft, cLetra )
	      SetTextColor( hDC, nColor )
	      nLeft += GetTextWidth( hDC, cLetra, oFont )
	   NEXT
	   SelectObject( hDC, hFont )
	   oFont:End()
	RETURN NIL


 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...