DragImage question

zryip theSlug zryip.theslug at gmail.com
Wed Sep 1 19:43:24 EDT 2010


On Thu, Sep 2, 2010 at 1:06 AM, J. Landman Gay <jacque at hyperactivesw.com> wrote:
> On 9/1/10 6:02 PM, Peter Haworth wrote:
>>
>> Thanks, I can't quite get this to work.  If  I use your code, I get an
>> error on the export command "Chunk: No such object" and the file is not
>> created.
>>
>> I changed the export command to ....."file "DragImageField" instead
>> (file instead of image), then the file was created but my Mac says it's
>> a simple text file. Then the set command fails with the same error.
>
> I think our slug meant to say "import snapshot". The image has to be in the
> stack before you can use it as a dragimage or a cursor. See "dragimage" in
> the dictionary for an explanation of the technique.

No no, ;)

I forgot to precise that you have to create the image first

A script like this should works to drag a field:

on dragStart
   if (there is not a image "DragField" of this cd) then
      lock screen
      create image "DragField"
      set the visible of it to false
      unlock screen
   end if

   export snapshot from field 1 to image "DragField" as PNG

   set the dragImage to the ID of image "DragField"
   put (the clickH - the left of me) & comma & (the clickV - the top
of me) into tImageOffset
   set the dragImageOffset to tImageOffset

   set the dragData["private"] to text of field 1
end dragStart


Regards,
-- 
-Zryip TheSlug- wish you the best! 8)
http://www.aslugontheroad.co.cc



More information about the use-livecode mailing list