New topic: Canvas control array
<http://forums.realsoftware.com/viewtopic.php?t=47943> Page 1 of 1 [ 5 posts ] Previous topic | Next topic Author Message Bodevinaat Post subject: Canvas control arrayPosted: Wed May 22, 2013 2:59 am Joined: Tue Aug 28, 2012 3:52 am Posts: 24 I'm struggling with the following: on a Window I place a Containercontrol. In that control I place a Canvas (myCanvas renamed to thumbCanvas). The canvas displays a JPEG as thumbnail. With a method I want to clone that canvas and put it under the first canvas, fill it with a new JPEG The first canvas is given an index '0'. In the action event of the button I try to clone the first canvas: dim aCanvas as myCanvas aCanvas = new thumbCanvas But it doesn't work. Anybody who can point me in the right direction? Eventually I want to fill the Containercontrol with all the JPEGs in a given folder. Help is highly appreciated.... Top charonn0 Post subject: Re: Canvas control arrayPosted: Wed May 22, 2013 3:41 am Joined: Mon Apr 02, 2007 2:08 am Posts: 1213 Location: San Francisco, CA, USA If I understand what you're trying to do, then I think you might want to reconsider the design. Controls aren't intended to be used as moveable, overlapping objects. If you're trying to create a "draggable pictures" control (like the one seen here) then you should consider using a single canvas to draw the thumbnails on. For example, you could have an array of items that specify a picture and a pair of coordinates. Then, in the Paint event of the canvas, draw the pictures in a loop. There have been a few discussions and examples of this technique on this forum and elsewhere. _________________ Boredom Software Top pixe656 Post subject: Re: Canvas control arrayPosted: Wed May 22, 2013 3:45 am Joined: Wed May 20, 2009 11:02 am Posts: 423 Hi, Is myCanvas the name of the class (canvas subclass, I guess) and thumbCanvas the name of the instance/object on the window? And, what do you mean with "it doesn't work"? Pixe _________________ Using RS2011r4.3 on Windows7. Top Bodevinaat Post subject: Re: Canvas control arrayPosted: Wed May 22, 2013 7:20 am Joined: Tue Aug 28, 2012 3:52 am Posts: 24 pixe656 wrote:Hi, Is myCanvas the name of the class (canvas subclass, I guess) and thumbCanvas the name of the instance/object on the window? And, what do you mean with "it doesn't work"? Pixe Ah, forgive me. English is not my mother tongue. Nothing is happening... Top Bodevinaat Post subject: Re: Canvas control arrayPosted: Wed May 22, 2013 7:23 am Joined: Tue Aug 28, 2012 3:52 am Posts: 24 charonn0 wrote:If I understand what you're trying to do, then I think you might want to reconsider the design. Controls aren't intended to be used as moveable, overlapping objects. If you're trying to create a "draggable pictures" control (like the one seen here) then you should consider using a single canvas to draw the thumbnails on. For example, you could have an array of items that specify a picture and a pair of coordinates. Then, in the Paint event of the canvas, draw the pictures in a loop. There have been a few discussions and examples of this technique on this forum and elsewhere. OK. Thanks... I find the Graphics/Picture object difficult to comprehend. I will look into your examples. Thanks again. Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 5 posts ] -- 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]
