From: Daan L. <da...@cs...> - 2004-11-20 07:27:17
|
Lennart Kolmodin wrote: > Hi all! > I'm doing an animation with lines, it's part of my lab: > http://www.cs.chalmers.se/Cs/Grundutb/Kurser/afp/lab1.html > > I have set a "on paint" property on a panel to draw all lines on every > repaint. This solution is not good since I update the lines every 50ms, it > gets terrible slow. > Somehow I would like to save the animation frame I have got so far and > just add some lines on every tick. Hi Lennart, I think you can just use "on paintRaw". This event also gets a list of "dirty" rectangles as its argument so you are able to redraw parts that were clobbered by other windows. Do not use both "paint" and "paintRaw" btw. The other solution you are talking about -- drawing into a bitmap is also possible but rather involved as you need to use low-level wxWidgets calls. However, I am doing these things myself to provide double-buffering by default and you can see the code in the "WXCore.Draw" module in the "dcBuffer" family of calls. I think that I should probably provide a nice abstraction to draw into bitmaps -- I plan to do release 0.9 fairly soon now (beginning of december) and I'll see if I can add a wrapper like that (or include your version ;-) I hope this helps, -- Daan. > I noticed there is a drawBitmap function but I have not found a way to > draw lines on a Bitmap. I have also found the Image type but it's the same > problem there. > > Any ideas? > > Thank you for yor help, > Lennart Kolmodin > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: InterSystems CACHE > FREE OODBMS DOWNLOAD - A multidimensional database that combines > robust object and relational technologies, making it a perfect match > for Java, C++,COM, XML, ODBC and JDBC. www.intersystems.com/match8 > _______________________________________________ > wxhaskell-users mailing list > wxh...@li... > https://lists.sourceforge.net/lists/listinfo/wxhaskell-users > > > > |