New topic: need deprecated canvas.grahics workaround for user drawing
<http://forums.realsoftware.com/viewtopic.php?t=46769> Page 1 of 1 [ 1 post ] Previous topic | Next topic Author Message beagley Post subject: need deprecated canvas.grahics workaround for user drawingPosted: Thu Jan 31, 2013 3:30 pm Joined: Tue Mar 14, 2006 1:09 pm Posts: 57 While most uses of the the deprecated canvas.graphics function can be replaced by routing calls through the canvas.paint event or by drawing to a picture object that is then used as the canvas backdrop, neither of these is fast enough for real-time on-screen drawing by the user. The problem is that they both require redrawing the entire drawing or repainting the entire screen every time the user moves the mouse. No computer could keep up with doing this many times per second. I have been experimenting for some time, looking for a workaround. (I would be happy to supply details of my failures so far. All of them look very blinky, or lag the user, or lose incoming mouse data during the refresh, or all three.) Even with canvas.graphics, fast user drawing is not easy. I was able to make it work by converting the incoming mouse data to a series of line coordinates that are simultaneously written to an array and used to draw directly to the screen with canvas.graphics. Of course the screen images would disappear as soon as canvas.paint is activated, but while the user has the mouse button depressed and is drawing, he or she can't do anything that would activate it. Releasing the mouse button triggers a refresh in which the paint event calls a routine that uses the coordinate array to redraw the entire drawing. When the user starts drawing again, the already-drawn lines stay visible because paint is not firing. The new lines being drawn over them stay visible for the same reason. Is there any chance we can lobby our Real colleagues to leave canvas.graphics in the deprecated but still working state until an alternative is developed? What is needed at minimum is a method for drawing directly to the screen without erasing what is already there. What if there were a way to temporarily disable the erasure that occurs when the paint event fires? any thoughts appreciated, Wally Beagley Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 1 post ] -- Over 1500 classes with 29000 functions in one REALbasic plug-in collection. The Monkeybread Software Realbasic Plugin v9.3. http://www.monkeybreadsoftware.de/realbasic/plugins.shtml [email protected]
