本文整理汇总了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));
});