trying to get image functionality as in RB

Ken Ray kray at sonsothunder.com
Fri Apr 6 18:27:19 EDT 2007


On Fri, 6 Apr 2007 16:58:50 -0400, wayne durden wrote:

> Hi all!  I am trying to rebuild an app I have in RB which takes an image
> dropped on it and resizes it.  I am able to duplicate the app for images on
> the local computer file system, but with my RB app I can drag an image from
> a browser which is actually the primary use of it.. (i.e., take an image
> from a web page, drop it on the app and get a smaller version which is also
> copied to the clipboard for pasting elsewhere).
> 
> Is there a way to get an image from a browser into an image on a card by
> drag an drop?  I can and have handled all the other aspects, resizing,
> copying to clipboard, I just can't figure out the drag and drop from the
> browser part...

Sure... here's a way, assuming you already have an image object on the 
card and you're dropping onto it (this is the script of the image 
object):

on dragEnter
  set the acceptDrop to true
  pass dragEnter
end dragEnter

on dragDrop
  if the dragData["image"] is not empty then
    put the dragData["image"] into me
  else
    beep
  end if
end dragDrop

For more info on D-n-D, see this tip:

    http://www.sonsothunder.com/devres/revolution/tips/mous002.htm

Hope this helps,



Ken Ray
Sons of Thunder Software, Inc.
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/



More information about the use-livecode mailing list