What does StartVectorDrawing() return?

Just starting out? Need help? Post your questions and find answers here.
Justin
Addict
Addict
Posts: 956
Joined: Sat Apr 26, 2003 2:49 pm

What does StartVectorDrawing() return?

Post by Justin »

I think in MaxOS is a CGContext, in linux a cairo context maybe?
And in windows i thought it was a graphics object, but all gdiplus commands fail with that value, what is it?, it can be used?
breeze4me
Enthusiast
Enthusiast
Posts: 633
Joined: Thu Mar 09, 2006 9:24 am
Location: S. Kor

Re: What does StartVectorDrawing() return?

Post by breeze4me »

When I checked it before, it looked like an internal memory structure address.
It seems that the graphics object can be obtained as shown below.
However, it's an internal thing and could change at any time.

Code: Select all

Prototype.l ptGdipGraphicsClear(*graphics, color.l)

If OpenLibrary(0, "gdiplus.dll")
  GdipGraphicsClear.ptGdipGraphicsClear = GetFunction(0, "GdipGraphicsClear")
EndIf

If OpenWindow(0, 0, 0, 400, 200, "VectorDrawing", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  CanvasGadget(0, 0, 0, 400, 200)
  
  a =  StartVectorDrawing(CanvasVectorOutput(0))
  If a
    *graphics = PeekI(a)
    
    MovePathCursor(40, 20)
    For i = 1 To 4
      AddPathLine(80, 0, #PB_Path_Relative)
      AddPathLine(0, 40, #PB_Path_Relative)
    Next i
    
    VectorSourceColor(RGBA(255, 0, 0, 255))
    DashPath(5, 15)
    
    GdipGraphicsClear(*graphics, $FF0000FF)
    
    StopVectorDrawing()
  EndIf
  
  Repeat
    Event = WaitWindowEvent()
  Until Event = #PB_Event_CloseWindow
EndIf

CloseLibrary(#PB_All)
Justin
Addict
Addict
Posts: 956
Joined: Sat Apr 26, 2003 2:49 pm

Re: What does StartVectorDrawing() return?

Post by Justin »

Interesting, many thanks!
Post Reply