<doc>
  <legacy_id>2044</legacy_id>
  <name>imageData</name>
  <type>property</type>
  <syntax>
    <example>set the imageData of <i>image</i> to <i>binaryData</i></example>
  </syntax>
  <library></library>
  <objects>
    <image/>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Images &amp; Multimedia</category>
  </classification>
  <references>
    <command tag="crop">crop Command</command>
    <command tag="revVideoFrameImage">revVideoFrameImage Command</command>
    <object tag="image">image Object</object>
    <property tag="alphaData">alphaData Property</property>
  </references>
  <history>
    <introduced version="1.1">Added.</introduced>
  </history>
  <platforms>
    <mac/>
    <windows/>
    <linux/>
    <ios/>
    <android/>
  </platforms>
  <classes>
    <desktop/>
    <server/>
    <web/>
    <mobile/>
  </classes>
  <security>
  </security>
  <summary>Specifies the <glossary tag="binary data">binary data</glossary> that makes up the picture in an <keyword tag="image">image</keyword> object.</summary>
  <examples>
    <example>put the imageData of image ID 3577 into dateToAnalyze</example>
    <example>set the imageData of the mouseControl to the personalImage of this card</example>
  </examples>
  <description>
    <p>Use the <b>imageData</b> <glossary tag="property">property</glossary> to process an <keyword tag="image">image</keyword> and display the processed version.</p><p/><p><b>Value:</b></p><p>The <b>imageData</b> of an <keyword tag="image">image</keyword> consists of a sequence of <glossary tag="binary">binary</glossary> values.</p><p/><p><b>Comments:</b></p><p>The <b>imageData</b> consists of the picture data presented in a standard form. The form of the <property tag="imageData">imageData</property> <glossary tag="property">property</glossary>, unlike the content, does not depend on what <function tag="format">format</function> the <keyword tag="image">image</keyword> is recorded in; it's always in the same form, which specifies the color of each <glossary tag="pixel">pixel</glossary> in the <keyword tag="image">image</keyword>, four <glossary tag="byte">bytes</glossary> per <glossary tag="pixel">pixel</glossary>.</p><p/><p>Each pixel is represented by 32 bits (4 bytes) of image data, with pixels numbered from the top left corner of the image, left to right, then top to bottom. The first byte consists of zeroes, and the last three bytes encode the amount of red, green, and blue respectively.</p><p/><p>Since each pixel is represented by 4 bytes (4 characters), you can obtain the numeric value of any of the color channels for a given pixel using the <b>charToNum</b> <control_st tag="function">function</control_st>. For example, the numeric value of the red <glossary tag="channel">channel</glossary> for the tenth <glossary tag="pixel">pixel</glossary> is given by the expression charToNum(char ((4 * 9) + 2) of the imageData of <i>image</i>). The numeric value of the green channel is charToNum(char (4 * 9) + 3 of the imageData of <i>image</i>); and the numeric value of the blue channel is charToNum(char (4 * 9) + 4 of the imageData of <i>image</i>).</p><p/><p><img src="202653"/> <b>Important!</b> When changing the <b>imageData</b> property, make sure the new data is the correct size: 4 bytes per pixel in the image. If you set an image's <b>imageData</b> property to data whose total length is incorrect, the image appearance will be distorted.</p><p/><p>The <b>imageData</b> <glossary tag="property">property</glossary> is related to the content of the <keyword tag="image">image</keyword>--changing either one changes what's displayed in the <keyword tag="image">image</keyword>--but they're not identical: the <property tag="imageData">imageData</property> <glossary tag="property">property</glossary> and the <keyword tag="image">image</keyword> content are in different forms, have different sizes, and include overlapping but not identical information about the picture.</p><p/><p>The <b>imageData</b>, unlike the contents of the <keyword tag="image">image</keyword> <glossary tag="container">container</glossary>, is based on the picture as it's presented on the screen, not stored in the <keyword tag="image">image</keyword> <glossary tag="object">object</glossary>. This means that if you resize an <keyword tag="image">image</keyword>, the content of the <keyword tag="image">image</keyword> does not change, but its <property tag="imageData">imageData</property> does. If you create an <keyword tag="image">image</keyword> and then reduce its size, its <b>imageData</b> reflects the scaled-down, displayed <keyword tag="image">image</keyword>, not the original full-scale <keyword tag="image">image</keyword>. If you create a second <keyword tag="image">image</keyword> and set its <b>imageData</b> <glossary tag="property">property</glossary> to the <b>imageData</b> of the original <keyword tag="image">image</keyword>, resizing the first <keyword tag="image">image</keyword> back to the original dimensions displays the original <keyword tag="image">image</keyword> at full resolution, but resizing the second <keyword tag="image">image</keyword> does not, because setting its <b>imageData</b> transferred only the scaled-down version of the original.</p><p/><p><img src="202651"/> <b>Tip:</b> To copy the information in an <keyword tag="image">image</keyword> at full resolution, regardless of whether its <property tag="height">height</property> and <property tag="width">width</property> have been changed, use a <glossary tag="statement">statement</glossary> like the following:</p><p/><p>  put image "Full Resolution" into image "Copied Image"</p><p/><p><img src="202653"/> <b>Important!</b> Since the <b>imageData</b> of an <keyword tag="image">image</keyword> is <glossary tag="binary data">binary data</glossary> rather than text, trying to display the data in a <keyword tag="field">field</keyword> may cause unexpected behavior.</p>
  </description>
</doc>