New topic: flattening a canvas and it's items to a single jpeg
<http://forums.realsoftware.com/viewtopic.php?t=47059> Page 1 of 1 [ 3 posts ] Previous topic | Next topic Author Message seanclancy Post subject: flattening a canvas and it's items to a single jpegPosted: Sun Feb 24, 2013 6:26 pm Joined: Fri Jan 08, 2010 9:59 am Posts: 268 Hi there - I'm making a drawing app where I can drag pictures onto a canvas. Obviously, some of these will be overlapping at times. My question is this - once I have positioned the picture Items and test areas (I can drag them around the page, scale the, crop them and what not... What would I do to convert this canvas into a jpeg? The canvas is scrolling as It's a A4 kind of size and it doesn't all fit on the desktop. If I import a picture of say of a jazz standard and then drap guitar chord diagrams onto it so that they are on top of the sheetmusic, can I convert this to gif in some way without the sheetmusic be written over top of the chordshapes? Top DaveS Post subject: Re: flattening a canvas and it's items to a single jpegPosted: Sun Feb 24, 2013 8:09 pm Joined: Sun Aug 05, 2007 10:46 am Posts: 4594 Location: San Diego, CA you have to draw things into a PICTURE object, and save that... depending on what you are trying to do... it might be best to do everything in a PICTURE and in the CANVAS PAINT event, just use g.DRAWPICTURE Depending on your platform you may or may not be able to save as GIF. Under OSX, you need to save as PNG, and use the SIPS utility to convert it to GIF or TIFF it can save PNG, JPG, BMP without problems. _________________ Dave Sisemore MacPro, OSX Lion 10.7.4 RB2012r1 Note : I am not interested in any solutions that involve custom Plug-ins of any kind Top Thom McGrath Post subject: Re: flattening a canvas and it's items to a single jpegPosted: Mon Feb 25, 2013 1:55 am Site Admin Joined: Tue May 06, 2008 1:07 pm Posts: 1382 Location: Greater Hartford Area, CT Slightly revised version of Dave's suggestion. Since you should always draw directly to the graphics object provided by the Paint event (when possible) you should use a method. Something like PaintCanvas(G As Graphics). Then your paint event just calls that method. When it is time to export, create a picture object, and call the same method passing in your picture's graphics object. This technique works equally well with printing. _________________ Thom McGrath - @tekcor Web Framework Architect, Real Software, Inc. Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 3 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]
