newImage

Typemessage
DictionaryLCS
LibraryLiveCode Script
Syntax
newImage
Associationsimage
Summary

Sent to a new image right after it's created.

Introduced1.0
OSmac, windows, linux, ios, android
Platformsdesktop, server, mobile
Example
on newImage -- assign a file to a referenced image
  if the text of the target is empty then -- no painted pixels
    answer file "Please choose an image to display:"
    set the filename of the target to it
  end if
end newImage
RelatedKeyword: templateImage, image
Property: script
Command: copy, clone, paste
Glossary: object, trap, image, message, tool, message path
Control Structure: pass
Description

Handle the newImage message if you want to create additional objects, switch tools, or do other tasks when a new image is created.

Normally, the newImage message is handled at a higher level of the message path, since the newly-created image does not yet have a script unless the templateImage contains one.

The actual creation is not triggered by the newImage message, so trapping the message and not allowing it to pass does not prevent the image from being created.

Tagsobjects