GdiP Library beta
Posted: Sun Sep 12, 2004 7:18 am
Here's the beta version of the GdiP library I've been working on. It offers a subset of the features of GDI+ wrapped in a PB library.
You should have GDI+ installed on your computer if you want to use it.
Here's you can download the lib
http://www.geboortegrond.nl/pb/GdiP.zip
and here's a code example.
You should have GDI+ installed on your computer if you want to use it.
Here's you can download the lib
http://www.geboortegrond.nl/pb/GdiP.zip
and here's a code example.
Code: Select all
OpenWindow(0, 0, 0, 300, 200, #PB_Window_SystemMenu | #PB_Window_ScreenCentered, "GdiPlus demo")
CreateImage(0, 300, 200)
If StartDrawing(ImageOutput())
graphics = Gdip_StartGraphics()
If graphics
Gdip_ClearGraphics(#Gdip_Maroon)
Gdip_SetSmoothingMode(#Gdip_SmoothingModeAntiAlias)
brush1 = Gdip_HatchBrush(#Gdip_HatchStyleDottedDiamond,Gdip_ARGB(255,255,255,255),Gdip_ARGB(255,255,0,0))
brush2 = Gdip_SolidBrush(Gdip_ARGB(255,50,50,255))
pen1 = Gdip_SolidPen(#Gdip_Salmon,4,#Gdip_UnitPixel)
pen2 = Gdip_BrushPen(brush1,4,#Gdip_UnitPixel)
bitmap = Gdip_BitmapFromFile("s40.jpg")
Gdip_SetPenEndCap(pen1, 2)
Gdip_ImageRotateFlip(bitmap,#Gdip_Rotate90FlipNone)
brush3 = Gdip_TextureBrush(bitmap,#Gdip_WrapModeTile)
Gdip_FillEllipse(brush3, 50,70,80,80)
Gdip_DrawRectangle(pen1, 70,100,80,50)
Gdip_DrawArc(pen1,40,40,100,50,250,90)
Dim Points.Gdip_PointL(5)
Points(0)\x = 10
Points(0)\y = 20
Points(1)\x = 30
Points(1)\y = 40
Points(2)\x = 50
Points(2)\y = 120
Points(3)\x = 10
Points(3)\y = 40
Points(4)\x = 60
Points(4)\y = 30
Points(5)\x = 50
Points(5)\y = 50
Gdip_FillClosedCurve(brush1,Points(), 6, 1, #Gdip_FillModeWinding)
Gdip_DeletePen(pen1)
Gdip_DeleteBrush(brush1)
Gdip_DisposeImage(image)
Gdip_StopGraphics()
EndIf
StopDrawing()
EndIf
CreateGadgetList(WindowID())
ImageGadget(0, 0, 0, 300, 300, UseImage(0))
Repeat
EventID = WaitWindowEvent()
Until EventID = #PB_EventCloseWindow