<doc>
	<legacy_id>2081</legacy_id>
	<name>import snapshot</name>
	<type>command</type>

	<syntax>
		<example>import snapshot [from rect[angle] <i>rectangle</i>] [of <i>object</i>] [(with | without) effects] [at size <i>width</i>, <i>height</i>]</example>
	</syntax>

	<synonyms>
	</synonyms>

	<summary>Creates an <keyword tag="image">image</keyword> of a portion of the screen, portion of a stack or a specific object.</summary>

	<examples>
<example>import snapshot from image "image 1" with effects </example>
<example>import snapshot from rectangle 100,100,500,400</example>
<example><p>import snapshot from rectangle (the rect of group "Picture")</p></example>
<example>import snapshot from rect myRect of window 91373124</example>
<example>import snapshot from the selectedObject at size 100,100</example>
	</examples>

	<history>
		<introduced version="1.0">Added.</introduced>
		<deprecated version=""></deprecated>
		<removed version=""></removed>
		<changed version="6.0">6.0</changed>
<changed version="4.6">4.6</changed>
<changed version="2.7">2.7</changed>
		<experimental version=""></experimental>
		<nonexperimental version=""></nonexperimental>
	</history>

	<objects>
	</objects>

	<platforms>
		<mac/>
		<windows/>
		<linux/>
		<ios/>
		<android/>
	</platforms>

	<classes>
		<desktop/>
		<web/>
		<mobile/>
	</classes>

	<security>
		<privacy/>
	</security>


	<classification>
		<category>Images  Multimedia</category>
	</classification>

	<references>
		<command tag="export snapshot">export snapshot Command</command>
		<command tag="import">import Command</command>
	</references>

	<description>
	<overview>Use the <b>import snapshot</b> <glossary tag="command">command</glossary> to place a screenshot in the <glossary tag="current stack">current stack</glossary>.</overview>

		<parameters>
  <parameter>
    <name>rectangle</name>
    <description>Specifies the edges of the rectangle to be imported, separated by commas, in the same order as the rectangle property (left, top, right, bottom). If a window, stack or object is specified, the rectangle is given in relative (window) coordinates; otherwise, it is given in absolute coordinates.</description>
  </parameter>		</parameters>

	<value></value>
	<comments>The <b>import snapshot</b> <glossary tag="command">command</glossary> creates a new <keyword tag="image">image</keyword> in the center of the <glossary tag="current card">current card</glossary> and places the snapshot in the <keyword tag="image">image</keyword>.<p></p><p>iOS supports both the object and screen snapshot variants of the <b>import snapshot</b> command. In the screen snapshot case, coordinates are given relative to the top-left of the screen and include the status bar.</p><p></p><p>If you do not specify a <i>rectangle</i> or an object, LiveCode displays a crosshairs <property tag="cursor">cursor</property>. Click at one corner of the rectangle to be imported and drag to the opposite corner to <command tag="select">select</command> the area.</p><p></p><p>If taking a snapshot of an object, the rectangle's coordinates are relative to the top left corner of the card containing the object. The object is rendered into an image as if no other objects existed around it, the snapshot is taken without applying the object's blendlevel or ink. You can take a snapshot of an object regardless of its visibility or open status - in particular, snapshots can be taken of objects that are not on the current card or in stacks that are not open.</p><p></p><p>If taking a snapshot of a stack the rectangle's coordinates are relative to the top left corner of the window you specify. However, if the window is partly overlapped by another window, whatever is visible on the screen within that rectangle is placed in the snapshot. In other words, you cannot take a snapshot of a part of a window that is hidden by another overlapping window.</p><p></p><p>Use the <b>at size</b> extensions if you wish the engine to resize the snapshot taken to the dimensions specified.</p><p></p><p>While you take the snapshot, LiveCode hides its own windows (such as the Tools palette).</p><p></p><p>The format of the resulting image depends on the current setting of the <property tag="paintCompression">paintCompression</property> <glossary tag="property">property</glossary>.</p><p></p><p>To import a snapshot for a portion of a stack you use the form:</p><p><b>import snapshot</b> from rect[angle] of window <property tag="windowID">windowID</property></p><p>Where <property tag="windowID">windowID</property> is the <property tag="windowID">windowID</property> property of the required stack.</p><p></p><p>To import a snapshot of a specific (non-stack) object, use the form:</p><p><b>import snapshot</b> from rect[angle] of <i>chunk</i></p><p>Where <i>chunk</i> is any chunk expression resolving to a control, or any expression evaluating to a control reference.</p><p></p><p>To import a snapshot of an object that has graphic effects applied to it, use the <i>with effects</i> form:</p><p><b>import snapshot</b> from rect[angle] of <i>chunk </i>with<i> </i>effects</p><p>Where <i>chunk</i> is any chunk expression resolving to a control, or any expression evaluating to a control reference.</p><p></p><p>To import a snapshot of an object in iOS use the form:</p><p><b>import snapshot</b> from [ rectangle <i>rect</i> of ] <i>object</i></p><p></p><p>To import a snapshot of the screen in iOS use the form:</p><p><b>import snapshot</b> from rectangle <i>rect</i></p><p></p><p></p><p></p><p></p><note> There is no way to render the status bar without using private features of the iOS API. Therefore, if your snapshot rectangle includes part of the screen where the status bar is, it will be clipped out.</note></comments>
	</description>
</doc>