This is a function i just threw together to draw a scan line effect onto a image:
Code: Select allfunction scanlines() {
// reference the current document
var docRef = app.activeDocument;
var w = docRef.width;
var h = docRef.height;
// set the color to fill the lines
var solidColorRef = new SolidColor();
solidColorRef.rgb.red = 0;
solidColorRef.rgb.green = 0;
solidColorRef.rgb.blue = 0;
// make new layer for thet scanlines
docRef.artLayers.add();
docRef.activeLayer.name = "scanlines";
docRef.activeLayer.opacity = 55;
// select every other line
var x = 2;
while (x <= h) {
// Select the region
docRef.selection.select(
new Array(
new Array(0, x-1),
new Array(w, x-1),
new Array(w, x),
new Array(0, x)
), SelectionType.EXTEND
);
var x = x+2;
};
// fill the selection
docRef.selection.fill(solidColorRef);
docRef.selection.deselect();
};
scanlines();
regards,
Patrick