Hello Werner,

thanks for answer. I have found a solution by appending the printer
coordinates to a binary file during calculation of the drawing area plot
points. As I said, it is not clear when the plotting is finished,
because it can be interactive, so I have some problems to calculate the
complete plot before doing the print out. At some point the user may
have the possibility to plot everything which is on screen by pressing a
button. This is the reason for the need  to 'record' the plot in some
way.

binFile = OPEN User.Home & "/.hp9125A_image" FOR CREATE 
CLOSE #binFile
(..)
Loop...
IF bPenDown THEN
    (.. do some calculation & do draw into the drawing area 'DA')
    (.. calculate the higher res printer coordinates)
    binFile = OPEN User.Home & "/.hp9125A_image" FOR APPEND 
    WRITE #binFile, Xold
    WRITE #binFile, Yold
    WRITE #binFile, X
    WRITE #binFile, Y
    CLOSE #binFile
ENDIF
...End loop
    
After the drawing area is finished and some "print" button is pressed,
the printer values a read back from the file and the whole plotting
sequence is repeated to the printer device. That works very well.

PUBLIC SUB PrintPlot_Click()
  
  Draw.End ' this finishes the drawing area draw method
  IF Printer.Setup() THEN RETURN
  Printer.Orientation = Printer.Landscape
  Draw.Begin(Printer)
  Draw.ForeColor = Color.Black
  Draw.LineStyle = Line.Solid
  binFile = OPEN User.Home & "/.hp9125A_image" FOR INPUT
  WHILE NOT Eof(binFile)
    READ #binFile, Xold
    READ #binFile, Yold
    READ #binFile, X
    READ #binFile, Y
    Draw.Line(Xold, Yold, X, Y)
  WEND 
  Draw.End ' this actually prints the plot
  
END

-andreas

Am Sonntag, den 24.05.2009, 20:42 +0000 schrieb
gambas-user-requ...@lists.sourceforge.net:
> AFAIK you can only have one Draw device open at a time. Also,
> Draw.Refresh doesn't do anything while the drawing port is open, in
> fact
> the refresh only happens in the event loop so once at the end of your
> routine is enough.
> How about doing the calculation before the drawing?




------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to