Vector Drawing Printer as output HELP NEEDED!!!

Just starting out? Need help? Post your questions and find answers here.
jed7@cox.net
New User
New User
Posts: 2
Joined: Fri Aug 17, 2018 6:20 pm

Vector Drawing Printer as output HELP NEEDED!!!

Post by jed7@cox.net »

Windows 10 Purebasic 5.62 (Windows - x64)

I have spent considerable time trying to figure out VectorDrawing. I started with 2DDrawing, which worked OK. I noticed that vector drawing had several advantages like user units,dashline,layers,etc. I just can not get it to work and I don't understand why. No compile errors & program runs and outputs a blank page. There is an example program on this forum which prints text and uses the transformation utilities to print rotated text. It works OK. I am interested only in drawing geometric figures, lines, etc.
Can anyone point me in the right direction?
Thanks in advance,
jd

Code: Select all

;DRAW A SHORT LINE USING VECTOR PRINTING
If PrintRequester()
If StartPrinting("PureBasic Test")
   
    If StartVectorDrawing(PrinterVectorOutput())
     Debug("INSIDE VECTOR DRAW")
      cx.d = VectorOutputWidth() / 2      ; = 300
      cy.d = VectorOutputHeight() / 2     ; = 400
     Debug (cx.d):Debug(cy.d)
      VectorSourceColor(RGBA(128, 128, 128, 128))     
        MovePathCursor(cx ,cy)
        AddPathLine(40., 50.)  ;SHOULD DRAW A LINE TO 40,50 FROM CENTER OF PAGE
      StopVectorDrawing()
    EndIf
   
    StopPrinting()
  EndIf
EndIf
User avatar
Michael Vogel
Addict
Addict
Posts: 2666
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: Vector Drawing Printer as output HELP NEEDED!!!

Post by Michael Vogel »

You did a good job, but all vector drawing functions are not seen before you are finishing with something like...

Code: Select all

StrokePath(10, #PB_Path_RoundCorner)
...in your case, add this line before "StopVectorDrawing()" :wink:
jed7@cox.net
New User
New User
Posts: 2
Joined: Fri Aug 17, 2018 6:20 pm

Re: Vector Drawing Printer as output HELP NEEDED!!!

Post by jed7@cox.net »

Worked like a charm! Thanks for your help.

Regards,
jd
Post Reply