New topic: 

DrawPicture parameter question

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

         Page 1 of 1
   [ 3 posts ]                 Previous topic | Next topic          Author  
Message        mikecotrone          Post subject: DrawPicture parameter 
questionPosted: Tue Apr 09, 2013 12:57 pm                         
Joined: Tue Mar 05, 2013 2:33 pm
Posts: 35
Location: North Carolina                Hi everyone,
Sorry for the influx of posts on this topic, but I have this "mostly" working 
and wanted to see if you see something that I am missing.

My Picture redraw method is working, but it seems like the mouse is ahead of 
the resizing by alot. What I expect is for the mouse to basically pull the 
image (mousedrag is where I am calling this method) and have the image resize 
dynamically while I am pulling the image to it's final X/Y resting place on my 
canvas. I am thinking my parms for Drawpicture may be slightly off via my 
calculations for X/Y fun.  Any help would be appreciated 

Thanks



Sub ReDraw (g as Graphics, po as PictureClass)
  
  // Draw Resized Picture
  
  // po.left = Current X Position of the picture
  // po.top = Current Y Position of the picture
  
  // qLastX = Any X Coordinate meant to be the Destination X for your resize
  // qLastY = Any Y Coordinate meant to be the Destination X for your resize
  
  po.ResizedX = po.left + qLastX
  po.ResizedY = po.top + qLastY
  
  Window1.IconClickTextArea.Text  ="Click X: " + str(ResizeMouseDownX) + " " + 
"Click Y: " + str(ResizeMouseDownY) + EndOfLine
  Window1.IconClickTextArea.AppendText "New X: " + str(qLastX)  + " " + "New Y: 
" + str(qLastY)+ EndOfLine
  Window1.IconClickTextArea.AppendText "FInalX: " + Str(po.ResizedX) + " " + 
"FinalY: " + Str(po.ResizedY) + EndOfLine
  g.DrawPicture(po.image, po.left,  po.top, po.ResizedX, po.ResizedY, 0, 0, 
po.left, po.top)
End Sub
      
_________________
Mike Cotrone - CCIE #8411 R&S, CCIE #8411 Voice
Chief Technology Officer 
Onepath Systems, LLC

Real Studio 2012 R2.1 Enterprise, Mac OS, Windows, Ubuntu Linux  
                             Top                timhare          Post subject: 
Re: DrawPicture parameter questionPosted: Tue Apr 09, 2013 6:24 pm              
           
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 12224
Location: Portland, OR  USA                Make sure you're only resizing the 
image when the mouse has actually moved.  You may get multiple MouseDrag with 
the same X/Y.  That would slow you down.

Quote:g.DrawPicture(po.image, po.left,  po.top, po.ResizedX, po.ResizedY, 0, 0, 
po.left, po.top)
This does look wrong.  Should be more like

g.DrawPicture(po.image, po.left,  po.top, po.ResizedX, po.ResizedY, 0, 0, 
po.image.width, po.image.height)   
                             Top                mikecotrone          Post 
subject: Re: DrawPicture parameter questionPosted: Tue Apr 09, 2013 8:33 pm     
                    
Joined: Tue Mar 05, 2013 2:33 pm
Posts: 35
Location: North Carolina                timhare wrote:Make sure you're only 
resizing the image when the mouse has actually moved.  You may get multiple 
MouseDrag with the same X/Y.  That would slow you down.

Quote:g.DrawPicture(po.image, po.left,  po.top, po.ResizedX, po.ResizedY, 0, 0, 
po.left, po.top)
This does look wrong.  Should be more like

g.DrawPicture(po.image, po.left,  po.top, po.ResizedX, po.ResizedY, 0, 0, 
po.image.width, po.image.height)

Thanks Tim!!! Between you and Dave you guys have been helping me alot on this 
app.

If you ever need Cisco Networking help please don't hesitate to ask     
_________________
Mike Cotrone - CCIE #8411 R&S, CCIE #8411 Voice
Chief Technology Officer 
Onepath Systems, LLC

Real Studio 2012 R2.1 Enterprise, Mac OS, Windows, Ubuntu Linux  
                             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]

Reply via email to