本文整理匯總了TypeScript中openfl/display/BitmapData.getPixel32函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript getPixel32函數的具體用法?TypeScript getPixel32怎麽用?TypeScript getPixel32使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了getPixel32函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it ("transparent", function () {
var bitmapData = new BitmapData (100, 100);
assert (bitmapData.transparent);
assert.equal (hex (bitmapData.getPixel (0, 0)), hex (0xFFFFFF));
assert.equal (bitmapData.getPixel32 (0, 0) >> 24 & 0xFF, 0xFF);
bitmapData.setPixel32 (0, 0, 0x00FFFFFF);
assert.equal (bitmapData.getPixel32 (0, 0) >> 24 & 0xFF, 0);
bitmapData = new BitmapData (100, 100, false);
assert.equal (bitmapData.transparent, false);
assert.equal (hex (bitmapData.getPixel (0, 0)), hex (0xFFFFFF));
assert.equal (bitmapData.getPixel32 (0, 0) >> 24 & 0xFF, 0xFF);
bitmapData.setPixel32 (0, 0, 0x00FFFFFF);
assert.equal (bitmapData.getPixel32 (0, 0) >> 24 & 0xFF, 0xFF);
bitmapData = new BitmapData (100, 100, true);
bitmapData.setPixel32 (0, 0, 0x00FFFFFF);
var pixels = bitmapData.getPixels (bitmapData.rect);
pixels.position = 0;
bitmapData = new BitmapData (100, 100, false);
bitmapData.setPixels (bitmapData.rect, pixels);
assert.equal (bitmapData.getPixel32 (0, 0) >> 24 & 0xFF, 0xFF);
});
示例2: it
it ("backgroundColor", function () {
var textField = new TextField ();
assert.equal (hex (textField.backgroundColor), hex (0xFFFFFF));
textField.backgroundColor = 0x00FF00;
assert.equal (hex (textField.backgroundColor), hex (0x00FF00));
var bitmapData = new BitmapData (textField.width, textField.height);
bitmapData.draw (textField);
assert.equal (hex (bitmapData.getPixel32 (0, 0)), hex (0xFFFFFFFF));
textField.background = true;
var bitmapData = new BitmapData (textField.width, textField.height);
bitmapData.draw (textField);
assert.equal (hex (bitmapData.getPixel32 (0, 0)), hex (0xFF00FF00));
});