Is there a way to add a diagonal line pattern through an image of bitmap data?

I'm trying to put diagonal lines through an image I have. It's a BitmapData object if that matters.

I'd like the diagonal lines to be white or transparent pixels.

I'm going to tag as watermark because it may be the same principle.


Yes, there is a suite of methods BitmapData offers for coloring pixels, rectangles and even other objects inheriting IBitmapDrawable (most inbuilt display objects).

The easiest way would probably be for you to draw the shape you want and then use draw() to place that shape over the existing data.

Thanks for everyone giving me direction. So far I've been able to create a diagonal line and repeat it to a variable width and height.

I still need to join the image and lines but I'm calling it a night.

var lineBitmapData:BitmapData;
var targetSprite:SpriteVisualElement;
var spriteVE:SpriteVisualElement = new SpriteVisualElement();
var fillSprite:Sprite = new Sprite();

// draw our diagonal line on a sprite, 0xFF0000);, 10);, 0);

// draw all the pixels into a bitmap data object 
lineBitmapData = new BitmapData(10, 10, true, 0x000000000000000000);

// create a new sprite and with the graphics object 
// draw a rectangle and fill it with a repeating bitmap data
targetSprite = new SpriteVisualElement();, null, true);, 0, width, height);;

// add 
//targetSprite.blendMode = BlendMode.ERASE;


Need Your Help

Eloquent hasManyThroughOne

laravel eloquent

Laravel 4.1 introduced the hasManyThrough relationship. This assumes 2 relating hasMany relationships. I however would like to retrieve the hasMany relationships of a belongsTo relationship instead.

Linux - created processes

linux shell process ssh ps

I'm new to Linux Shell and kind of stuck at an assignment: