New topic: 

retaining image in picture object

<http://forums.realsoftware.com/viewtopic.php?t=30548>

       Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic         Author  
Message       pbart           Post subject: retaining image in picture 
objectPosted: Mon Oct 19, 2009 4:56 am                        
Joined: Sat Oct 10, 2009 6:40 am
Posts: 8              I am playing with drag and drop for learning purposes. I 
have discovered ( through the forums ) that dragging onto a canvas is best done 
by saving the object in memory as a picture, then repainting the canvas. I have 
this working with the following code.
Code:Dim ofcanX, ofcanY as integer

if obj.textavailable then canvas1.graphics.drawstring(obj.text, obj.dropleft, 
obj.droptop)
ofcanX = obj.dropleft
ofcanY = obj.droptop

P = new Picture(canvas1.width, canvas1.height, 32)

P.Graphics.DrawString(obj.text,ofcanX, ofcanY)

Refresh


P is a global property.

in the canvas paint event I have
Code:g.DrawPicture(P,0,0)

This is fine but each time I drop the object, P is created from scratch, and 
only the last drop is repainted. Is there a way to make P retain the previous 
data. 
I have also tried using an off screen canvas, but don't know how to paint this 
canvas to the on screen one.

any help on either will be greatly appreciated

regards
Paul   
                            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]

Reply via email to