[Gambas-user] Two extended paint devices at the same time ?

Andreas Müller andreas at ...2139...
Sun May 24 16:07:57 CEST 2009


Hello,

I have an application wich generates plotting points (x,y) which are
drawn by a draw.line(x1,y,1,x2,y2) command into some drawing area 'DA'.

        Draw.Begin(DA)
        Draw.ForeColor = Color.Black
        Draw.LineStyle = Line.Solid
        Draw.LineWidth = 1
        
        (.. calculate x1,y1,x2,y2 )
        
        Draw.Line(x1,y1,x2,y2)

The resolution of the drawing area 'DA' is 500 x 750 points. 

Now I want to "plot" the same points to a printer which has a higher
resolution of 5000 x 7500 points.

        IF Printer.Setup() THEN RETURN
        Printer.Orientation = Printer.Landscape
        Draw.Begin(Printer)
        
        ..
        
        Draw.End
        
The points are calculated with the higher resolution of the printer and
scaled down for the drawing area output by a factor 10.

Now my question:

The calculation of the plotting points is complex and there are many of
them (I don't know how many, when the calculation starts). How can I
draw the points to the drawing area and to the printer without
calculating them twice and without storing them into some open ended
list?

It would be nice to have someting like this

Draw.Begin(DA)
Draw.Begin(printer)
Begin Loop
        .. calculation
        Draw.Line(to DA)
        Draw.Refresh(to DA)
        Draw.Line(to printer)
End Loop
Draw.End(DA)
Draw.End(printer)

The second Draw.Begin(printer) generates this error: "An extended paint
device can only be painted by one QPainter at a time."

best regards
-andreas

        






More information about the User mailing list