http://wiki.spheredev.org/index.php?title=Legacy:Functions/Images&feed=atom&action=historyLegacy:Functions/Images - Revision history2024-03-29T01:50:33ZRevision history for this page on the wikiMediaWiki 1.29.0http://wiki.spheredev.org/index.php?title=Legacy:Functions/Images&diff=482&oldid=prevApollolux: created2013-05-22T17:34:23Z<p>created</p>
<p><b>New page</b></p><div>== Images ==<br />
<br />
* Sphere [[API:Image|Image]] object: Holds a 2D bitmap for displaying.<br />
* [[API:LoadImage|LoadImage]](''filename''): Load an image from ''filename''.<br />
* [[API:GrabImage|GrabImage]](''x'', ''y'', ''width'', ''height''): Grab the screen contents at (''x'', ''y'', ''width'', ''height'') and store it in a new Image object.<br />
<br />
=== System images ===<br />
<br />
* [[API:GetSystemArrow|GetSystemArrow]](): Get the right-pointing arrow image that comes with the Sphere engine.<br />
* [[API:GetSystemUpArrow|GetSystemUpArrow]](): Get the up-pointing arrow image that comes with the Sphere engine.<br />
* [[API:GetSystemDownArrow|GetSystemDownArrow]](): Get the down-pointing arrow image that comes with the Sphere engine.<br />
<br />
=== Image object ===<br />
<br />
* [[API:Image/clone|Image.clone]](): returns a copy of 'image_object'<br />
<br />
==== Blitting (drawing) images ====<br />
<br />
* [[API:Image/blit|Image.blit]](''x'', ''y''): Draw the image with the top-left corner at (''x'', ''y'').<br />
* [[API:Image/blitMask|Image.blitMask]](''x'', ''y'', ''mask''): Draw the image at (''x'', ''y'') with ''mask'' as the tinting color.<br />
* [[API:Image/rotateBlit|Image.rotateBlit]](''center_x'', ''center_y'', ''angle''): Draw the image centered at (''center_x'', ''center_y''), rotated by ''angle'' radians.<br />
* [[API:Image/rotateBlitMask|Image.rotateBlitMask]](''center_x'', ''center_y'', ''angle'', ''mask''): [[API:Image/rotateBlit|rotateBlit]] + mask.<br />
* [[API:Image/zoomBlit|Image.zoomBlit]](''x'', ''y'', ''factor''): Draw the image zoomed by ''factor'' with the top-left corner at (''x'', ''y'').<br />
* [[API:Image/zoomBlitMask|Image.zoomBlitMask]](''x'', ''y'', ''factor'', ''mask''): [[API:Image/zoomBlit|zoomBlit]] + mask.<br />
* [[API:Image/transformBlit|Image.transformBlit]](''x1'', ''y1'', ''x2'', ''y2'', ''x3'', ''y3'', ''x4'', ''y4''): Draw the image with top-left (''x1'', ''y1''), top-right (''x2'', ''y2''), bottom-right (''x3'', ''y3'') and bottom-left (''x4'', ''y4'').<br />
* [[API:Image/transformBlitMask|Image.transformBlitMask]](''x1'', ''y1'', ''x2'', ''y2'', ''x3'', ''y3'', ''x4'', ''y4'', ''mask''): Draw the image stretched to fit 4 coordinates clockwise from the top-left, with a masking color.<br />
<br />
==== Surface conversion ====<br />
<br />
* [[API:Image/createSurface|Image.createSurface]](): Create a new [[API:Surface|Surface]] using the picture data in the image.</div>Apollolux