<doc>
  <legacy_id>1239</legacy_id>
  <name>paintCompression</name>
  <type>property</type>
  <syntax>
    <example>get the paintCompression of <i>image</i></example>
    <example>set the paintCompression to {png | jpeg | gif | rle}</example>
  </syntax>
  <library></library>
  <objects>
    <global/>
  </objects>
  <synonyms>
  </synonyms>
  <classification>
    <category>Images &amp; Multimedia</category>
  </classification>
  <references>
    <command tag="import">import Command</command>
    <command tag="choose">choose Command</command>
    <property tag="JPEGQuality">JPEGQuality 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="compress">compression</glossary> <function tag="format">format</function> used for storing an <keyword tag="image">image</keyword>.</summary>
  <examples>
    <example>set the paintCompression to "PNG"</example>
    <example>if the paintCompression of image "Photo" is "pict" then warnUser</example>
  </examples>
  <description>
    <p>Use the <b>paintCompression</b> <glossary tag="property">property</glossary> to obtain the <function tag="format">format</function> of <glossary tag="image">images</glossary>, or to change the <function tag="format">format</function> used for new <glossary tag="image">images</glossary>.</p><p/><p><b>Value:</b></p><p>The <b>paintCompression</b> is one of the following: "png", "jpeg", "gif", or "rle". By <keyword tag="default">default</keyword>, the <command tag="global">global</command> <b>paintCompression</b> <glossary tag="property">property</glossary> is set to "rle" in standalones and "png" in the development environment.</p><p/><p>The <b>paintCompression</b> of an <keyword tag="image">image</keyword> is one of the following: "png", "jpeg", "gif", "rle", or "pict". By <keyword tag="default">default</keyword>, the <b>paintCompression</b> <glossary tag="property">property</glossary> of a newly created <keyword tag="image">image</keyword> is set to "rle" if it was created with the <command tag="create">create</command> <glossary tag="command">command</glossary> or by using a <glossary tag="paint tool">paint tool</glossary>. If the <keyword tag="image">image</keyword> was created with the <command tag="import">import</command> <glossary tag="command">command</glossary>, its <b>paintCompression</b> is set to the <function tag="format">format</function> of the <glossary tag="import">imported</glossary> picture <keyword tag="file">file</keyword>.</p><p/><p>For images, this property is read-only and cannot be set; you can set only the global <b>paintCompression</b>.</p><p/><p><b>Comments:</b></p><p>When an image is changed with a paint tool, it is recompressed the next time you leave the card it's on. The format in which it is compressed is set by the global <b>paintCompression</b> <glossary tag="property">property</glossary>.</p><p/><p>To change an image's compression format, first set the <b>paintCompression</b> to the desired value, then paint in the <keyword tag="image">image</keyword>. Then either go to another <keyword tag="card">card</keyword> and return, or close and re-open the <object tag="stack">stack</object>.</p><p/><p><img src="202652"/> <b>Cross-platform note:</b> On <glossary tag="Mac OS">Mac OS</glossary> and <glossary tag="OS X">OS X systems</glossary>, <glossary tag="PICT">PICT</glossary> <function tag="files">files</function> can be <glossary tag="import">imported</glossary>, and the <b>paintCompression</b> of the resulting <keyword tag="image">image</keyword> is set to pict. However, PICT <glossary tag="image">images</glossary> cannot be displayed on <glossary tag="Unix">Unix</glossary> or <glossary tag="Windows">Windows systems</glossary> unless they are converted to another <function tag="format">format</function>.</p><p/><p>If an image's <b>alphaData</b> <glossary tag="property">property</glossary> contains any value other than 255 (opaque), it is automatically recompressed in PNG format to preserve the <glossary tag="alpha channel">alpha channel</glossary> data.</p>
  </description>
</doc>