[Gambas-user] painting graph to image continuously
wally
wally at ...2037...
Thu Dec 16 13:15:35 CET 2010
On Thursday 16 December 2010 10:21:16 wally wrote:
> On Wednesday 15 December 2010 18:57:16 Fabien Bodard wrote:
> > Le 15 décembre 2010 16:56, Benoît Minisini
> > <gambas at ...1...> a écrit :
> > >>
> > >> thanks :) but ... Image , "Not a drawable Object"
> > >>
> > >> If t > myImage1.W Then
> > >> myImage1.Resize(myImage1.w + 1, myImage1.H)
> > >>
> > >> Draw.Begin(myImage1) <--- Image , "Not a drawable Object"
> > >> Draw.FillRect(myImage1.W - 1, 0, 1, myImage1.H, Color.RGB(255, 255,
> > >> 223)) Draw.End
> > >>
> > >
> > > Yes, I forgot that only Paint can be used on images... So you have to
use
> > > Paint!
> > >
> > > --
> > > Benoît Minisini
> > >
> > >
>
------------------------------------------------------------------------------
> > > Lotusphere 2011
> > > Register now for Lotusphere 2011 and learn how
> > > to connect the dots, take your collaborative environment
> > > to the next level, and enter the era of Social Business.
> > > http://p.sf.net/sfu/lotusphere-d2d
> > > _______________________________________________
> > > Gambas-user mailing list
> > > Gambas-user at lists.sourceforge.net
> > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> > >
> >
> > or a drawing area ...
> >
> > --
> > Fabien Bodard
> >
> >
>
------------------------------------------------------------------------------
> > Lotusphere 2011
> > Register now for Lotusphere 2011 and learn how
> > to connect the dots, take your collaborative environment
> > to the next level, and enter the era of Social Business.
> > http://p.sf.net/sfu/lotusphere-d2d
> > _______________________________________________
> > Gambas-user mailing list
> > Gambas-user at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/gambas-user
> >
>
> Fabian, Benoit,
>
> i tied your suggestion too and it's true i can apply "Draw" and "Paint"
> to DrawingArea, but doing so, i get more problems.
> I attached code and screenshot for better reading
>
> DraawingArea.Cache = TRUE
>
> 1st Problem is that after the first resize operation the former Drawing is
> repeated. So i get several identical graphs in sequence.
>
> 2nd Problem is that
> Draw.FillRect(DrawingArea1.W - 1, 0, 1, DrawingArea1.H, Color.Cyan)
> is ignored , same as the paint instructions after 1st resize.
>
> 3rd Problem is the screenshot, you can see this in attachment.
>
> How to do this all as needed and how to save a copy of the entire graph ?
>
> thanks wally
>
Hello,
i did some tests for better understanding what's going on when resizing
DrawingArea.
Running attached code (circle.txt) creates the file "circles.png" .
On screen, i got a different drawing, shown in "extern_screenshot.png" taken
with KSnapShot directly from the screen.
May anybody be so kind to explain this and/or give me a hint what to read
first to get the code work as needed.
thanks wally
code:
Public Sub btn_test_Click()
'100, 80 - - > 200, 160 resizing from to
Draw.Begin(DrawingArea2)
Draw.Circle(50, 40, 30)
Draw.End
DrawingArea2.Resize(200, 160)
myPicture = DrawingArea2.Screenshot()
myPicture.Save(ProjPath &/ "circles.png")
End
-------------- next part --------------
A non-text attachment was scrubbed...
Name: circles.png
Type: image/png
Size: 560 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20101216/0cd138b0/attachment.png>
-------------- next part --------------
Public Sub btn_test_Click()
'100, 80 - - > 200, 160
Draw.Begin(DrawingArea2)
Draw.Circle(50, 40, 30)
Draw.End
DrawingArea2.Resize(200, 160)
myPicture = DrawingArea2.Screenshot()
myPicture.Save(ProjPath &/ "circles.png")
End
-------------- next part --------------
A non-text attachment was scrubbed...
Name: extern_screenshot.png
Type: image/png
Size: 1228 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20101216/0cd138b0/attachment-0001.png>
More information about the User
mailing list