Pour fonctionner tu as besoin d'avoir dans le dossier de ton application les fichiers suivants:
- L'include
gDrawing.pbi
- les libs
gdiplus_x64.lib et
gdiplus_x86.lib
le code précédant devient:
Code : Tout sélectionner
XIncludeFile "gDrawing.pbi"
Procedure DrawLine(x, y, angle, Lenght, Color)
gLineXY(x, y, x+Cos(Radian(Angle))*Lenght, y+Sin(Radian(Angle))*Lenght, Color)
EndProcedure
gInit()
OpenWindow(0, 0, 0, 800, 600, "DrawLine", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
CreateImage(0, 800, 600)
gStartDrawing(ImageOutput(0))
gDrawingMode(#PB_2DDrawing_Outlined)
Box(0, 0, 800, 600, RGB(255, 255, 255))
DrawLine(10, 300, -45, 200, RGBA(255, 0, 0, 255))
DrawLine(10, 300, 45, 200, RGBA(255, 0, 0, 255))
gStopDrawing()
ImageGadget(0, 0, 0, 200, 200, ImageID(0))
gEnd()
Repeat : Until WaitWindowEvent(100) = #PB_Event_CloseWindow
Tes lignes seront parfaites
