ImageAdv.setPixelColor() This page was last modified over 30 day(s) ago and has 0 comment(s)


Back to ImageAdv Class Summary

Availability
Windows, Mac OSX, Linux

Usage
mdm.ImageAdv.setPixelColor(x:Number, y:Number, rgbValues:Array):Boolean

Parameters
x - x coordination of bitmap pixel
y - y coordination of bitmap pixel
rgbValues - array containing RGB color channel values as integers (e.g. [0, 0, 0] for 0x000000))

Returns
Boolean indicating if operation succeeded

Description
This method sets color values for pixel and x/y coordination. If x/y coordination are outside of current bitmap dimensions operation would fail. The same is if there are more then three RGB values in array or when RGB value for given channel is outside of its range: 0-255)

Notes
This operation does not change your original file. It operates on bitmap hosted in memory - so you have to flush changes to local file to persist them by saving JPEG/PNG files locally.

Example Code
if(image.isValid)
{
var rgbValues:Array = [0, 0, 0];
image.setPixelColor(x, y, rgbValues);
};

mdm.ImageAdv Class Example Downloads
No Example Downloads Available


Registered Users must be logged in to 'MyAccount' to add a Comment - Log In Here
  After Logging In, Click Here to Refresh This Page