Code : Tout sélectionner
Global dc.l,texte$
Procedure DrawRText(dc.l,x,y,Text.s,fFont.s,fangle.l,fHeight)
;#####################################################################
; Procedure DrawRText Author: Andreas
; Date: 14. June 2003
;#####################################################################
Font = CreateFont_(fHeight,0,fangle*10,0,0,0,0,0,0,0,0,0,0,fFont)
GetWindowRect_(WindowID(0),r.RECT)
OldFont = SelectObject_(dc,Font)
SetTextAlign_(dc,#TA_BASELINE)
SetBkMode_(dc,#TRANSPARENT)
SetTextColor_(dc,RGB(0,200,0))
ExtTextOut_(dc, x,y,0 ,r,Text,Len(Text),0 )
SelectObject_(dc,OldFont)
DeleteObject_(Font)
EndProcedure
OpenWindow(0,0,0,500,400,"test",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
dc=StartDrawing(WindowOutput(0))
texte$ = "GILDEV" ; le texte à afficher
LoadFont(0, "Arial", 20,#PB_Font_Bold)
If CreateGadgetList(WindowID(0))
SetGadgetFont(#PB_Default, FontID(0))
ButtonGadget(0, 10, 10, 200, 30, "Bouton")
EndIf
LoadFont(1, "Arial", 20)
DrawRText(dc,120,100,texte$,"Arial",0,20)
LoadFont(1, "Arial", 40,#PB_Font_Bold)
DrawRText(dc,120,140,texte$,"Arial",0,40)
Repeat:Until WaitWindowEvent()=#PB_Event_CloseWindow
StopDrawing()