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

Back to ImageAdv Class Summary

Windows, Mac OSX, Linux

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

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))

Boolean indicating if operation succeeded

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)

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
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