Find the color of a pixel at a point within a VGroup
I'm having trouble with this code ca开发者_Go百科n anybody help...
var imageMap:ImageSnapshot= ImageSnapshot.captureImage(object);
var pixelValue:uint = imageMap.bitmapData.getPixel(x, y);
According to the documentation, there is no bitmapData
property of the ImageSnap class. Instead you can use the static ImageSnapshot.captureBitmapData
function to get a BitmapData snapshot of your object.
var imageMap:BitmapData = ImageSnapshot.captureBitmapData(object);
var pixelValue:uint = imageMap.getPixel(x,y);
精彩评论