SRL Archive - Research & Development Lounge

OOOOOH A Pointless Painter!!!


Metagen

2008-08-29 13:37:40

Ever wanted to impress ur msn buddies with ur leet drawing skills???
NOW YOU CAN!!! either set it to outline or to shade!!!! YOUR OPTIONS ARE
LIMITLES!!!!!!! yay (btw its slow so yea… try not to make any pics bigger then someones avatar lol)

OK U NUBS… cant figure out how to use a function…

http://uppit.com/3JHU05
watch that



program New;
var TPA, TPA2 : Array of TPoint;
x, y : Integer;
function CopyPicture(x, y, x2, y2 : Integer) : Array of tPoint;
var
i, j : Integer;
H, S, L : Extended;
begin
for i := x to x2 do
begin
for j := y to y2 do
begin
ColorToHSL(GetColor(i, j), H, S, L);
if random(100) > Round(L) then
begin
SetLength(result, Length(result) + 1);
result[high(result)] := inttopoint(i-x, j-y)
end;
end;
end;
end;

function CopyOutlines(x, y, x2, y2 : Integer) : Array of tPoint;
var
i, j : Integer;
H, S, L : Extended;
H1, S1, L1 : Extended;
H2, S2, L2 : Extended;
H3, S3, L3 : Extended;
H4, S4, L4 : Extended;
begin
for i := x to x2 do
begin
for j := y to y2 do
begin

if (j > y) and (i > x) and (j < y2) and (i < x2) then
begin
ColorToHSL(GetColor(i, j), H, S, L);
ColorToHSL(GetColor(i-1, j), H1, S1, L1);
ColorToHSL(GetColor(i+1, j), H2, S2, L2);
ColorToHSL(GetColor(i, j-1), H3, S3, L3);
ColorToHSL(GetColor(i, j+1), H4, S4, L4);
if {(not (abs(H1- H) < 30)) or}
(not (abs(H2- H) < 20)) or
{ (not (abs(H3- H) < 30)) or }
(not (abs(H4- H) < 20)) or
{ (not (abs(L1- L) < 5)) or }
(not (abs(L2- L) < 20)) or
{ (not (abs(L3- L) < 5)) or }
(not (abs(L4- L) < 20)) or
{ (not (abs(S1- S) < 5)) or }
(not (abs(S2- S) < 20)) or
{ (not (abs(S3- S) < 5)) or }
(not (abs(S4- S) < 20)) then
begin
SetLength(result, Length(result) + 1);
result[high(result)] := inttopoint(i-x, j-y)
end;
end;
end;
end;
end;

procedure DrawPicture(TPA : Array of TPoint; x, y : Integer);
var
i : Integer;
begin
for i := 0 to High(TPA) do
begin
ClickMouse(TPA[i].x+x, TPA[i].y+y, True);
end;
end;


begin
SetLength(TPA2, 3);
wait(2000);
GetMousePos(x, y);
TPA2[0] := inttopoint(x, y);
writeln(inttostr(x));
wait(2000);
GetMousePos(x, y);
TPA2[1] := inttopoint(x, y);
writeln(inttostr(x));
wait(2000);
GetMousePos(x, y);
TPA2[2] := inttopoint(x, y);
writeln(inttostr(x));
TPA := CopyOutlines(TPA2[0].x, TPA2[0].y, TPA2[1].x, TPA2[1].y);
DrawPicture(TPA, TPA2[2].x, TPA2[2].y);
end.

Gu3st...

2008-08-29 15:38:09

I don't get it… what does it do???

P1nky

2008-08-29 18:21:41

yeah i ran it , it gave me numbers on the bottom hm?

Shuttleu

2008-08-29 18:38:51

lol

Successfully compiled (41 ms)
-1
-1
-1
Successfully executed

great script

it spits out -1 :D just what i have always wanted :D your my hero

btw i dont think it works :p

~shut

Daniel

2008-08-29 23:49:14

Err. Noice standards?
program New;

var
TPA, TPA2: array of TPoint;
x, y: Integer;

function CopyPicture(x, y, x2, y2: Integer): array of tPoint;
var
i, j: Integer;
H, S, L: Extended;
begin
for i := x to x2 do
begin
for j := y to y2 do
begin
ColorToHSL(GetColor(i, j), H, S, L);
if random(100) > Round(L) then
begin
SetLength(result, Length(result) + 1);
result[high(result)] := inttopoint(i - x, j - y)
end;
end;
end;
end;

function CopyOutlines(x, y, x2, y2: Integer): array of tPoint;
var
i, j: Integer;
H, S, L: Extended;
H1, S1, L1: Extended;
H2, S2, L2: Extended;
H3, S3, L3: Extended;
H4, S4, L4: Extended;
begin
for i := x to x2 do
begin
for j := y to y2 do
begin

if (j > y) and (i > x) and (j < y2) and (i < x2) then
begin
ColorToHSL(GetColor(i, j), H, S, L);
ColorToHSL(GetColor(i - 1, j), H1, S1, L1);
ColorToHSL(GetColor(i + 1, j), H2, S2, L2);
ColorToHSL(GetColor(i, j - 1), H3, S3, L3);
ColorToHSL(GetColor(i, j + 1), H4, S4, L4);
if {(not (abs(H1- H) < 30)) or}
(not (abs(H2 - H) < 20)) or
{ (not (abs(H3- H) < 30)) or }
(not (abs(H4 - H) < 20)) or
{ (not (abs(L1- L) < 5)) or }
(not (abs(L2 - L) < 20)) or
{ (not (abs(L3- L) < 5)) or }
(not (abs(L4 - L) < 20)) or
{ (not (abs(S1- S) < 5)) or }
(not (abs(S2 - S) < 20)) or
{ (not (abs(S3- S) < 5)) or }
(not (abs(S4 - S) < 20)) then
begin
SetLength(result, Length(result) + 1);
result[high(result)] := inttopoint(i - x, j - y)
end;
end;
end;
end;
end;

procedure DrawPicture(TPA: array of TPoint; x, y: Integer);
var
i: Integer;
begin
for i := 0 to High(TPA) do
begin
ClickMouse(TPA[i].x + x, TPA[i].y + y, True);
end;
end;

begin
SetLength(TPA2, 3);
wait(2000);
GetMousePos(x, y);
TPA2[0] := inttopoint(x, y);
writeln(inttostr(x));
wait(2000);
GetMousePos(x, y);
TPA2[1] := inttopoint(x, y);
writeln(inttostr(x));
wait(2000);
GetMousePos(x, y);
TPA2[2] := inttopoint(x, y);
writeln(inttostr(x));
TPA := CopyOutlines(TPA2[0].x, TPA2[0].y, TPA2[1].x, TPA2[1].y);
DrawPicture(TPA, TPA2[2].x, TPA2[2].y);
end.

MylesMadness

2008-08-30 09:30:40

[QUOTE=Dan's The Man;456730]Err. [B]Noice[/B] standards? [scar]program New;

var
TPA, TPA2: array of TPoint;
x, y: Integer;

function CopyPicture(x, y, x2, y2: Integer): array of tPoint;
var
i, j: Integer;
H, S, L: Extended;
begin
for i := x to x2 do
begin
for j := y to y2 do
begin
ColorToHSL(GetColor(i, j), H, S, L);
if random(100) > Round(L) then
begin
SetLength(result, Length(result) + 1);
result[high(result)] := inttopoint(i - x, j - y)
end;
end;
end;
end;

function CopyOutlines(x, y, x2, y2: Integer): array of tPoint;
var
i, j: Integer;
H, S, L: Extended;
H1, S1, L1: Extended;
H2, S2, L2: Extended;
H3, S3, L3: Extended;
H4, S4, L4: Extended;
begin
for i := x to x2 do
begin
for j := y to y2 do
begin

if (j > y) and (i > x) and (j < y2) and (i < x2) then
begin
ColorToHSL(GetColor(i, j), H, S, L);
ColorToHSL(GetColor(i - 1, j), H1, S1, L1);
ColorToHSL(GetColor(i + 1, j), H2, S2, L2);
ColorToHSL(GetColor(i, j - 1), H3, S3, L3);
ColorToHSL(GetColor(i, j + 1), H4, S4, L4);
if {(not (abs(H1- H) < 30)) or}
(not (abs(H2 - H) < 20)) or
{ (not (abs(H3- H) < 30)) or }
(not (abs(H4 - H) < 20)) or
{ (not (abs(L1- L) < 5)) or }
(not (abs(L2 - L) < 20)) or
{ (not (abs(L3- L) < 5)) or }
(not (abs(L4 - L) < 20)) or
{ (not (abs(S1- S) < 5)) or }
(not (abs(S2 - S) < 20)) or
{ (not (abs(S3- S) < 5)) or }
(not (abs(S4 - S) < 20)) then
begin
SetLength(result, Length(result) + 1);
result[high(result)] := inttopoint(i - x, j - y)
end;
end;
end;
end;
end;

procedure DrawPicture(TPA: array of TPoint; x, y: Integer);
var
i: Integer;
begin
for i := 0 to High(TPA) do
begin
ClickMouse(TPA[i].x + x, TPA[i].y + y, True);
end;
end;

begin
SetLength(TPA2, 3);
wait(2000);
GetMousePos(x, y);
TPA2[0] := inttopoint(x, y);
writeln(inttostr(x));
wait(2000);
GetMousePos(x, y);
TPA2[1] := inttopoint(x, y);
writeln(inttostr(x));
wait(2000);
GetMousePos(x, y);
TPA2[2] := inttopoint(x, y);
writeln(inttostr(x));
TPA := CopyOutlines(TPA2[0].x, TPA2[0].y, TPA2[1].x, TPA2[1].y);
DrawPicture(TPA, TPA2[2].x, TPA2[2].y);
end.[/scar][/QUOTE]Err. Nice spelling?

Metagen

2008-08-30 10:34:12

Alright nubs, look at the first post again, i made a video showing how, and i put a sample :p

Eduard

2008-08-30 13:19:19

i relaly don't understand even with the movie

Shuttleu

2008-08-30 13:25:39

neither do i
i try it and it still doesnt work

~shut

Gu3st...

2008-08-30 13:55:23

WTF IS THIS?! :D

EDIT: Just so I dont get an infraction: I doesnt understand it neither.

EDIT2: I GET IT!!! YAY!!!

But i dont got msn installed on this computer so i cant show my friends my leet drawning skills :(

Hugolord

2008-08-30 14:30:45

This is pretty awesome but it lags me the fuck out of msn lol

Metagen

2008-08-30 20:11:46

Yea, its not nice on msn :p because msn isnt designed to draw this way :p works well with paint (i think i shoudl slow it down though)

Waddo

2008-08-31 11:58:17

erm how do i do it lol

Hugolord

2008-08-31 13:14:48

From: Waddo
erm how do i do it lol

Have drawing enable on msn/paint opened
Start script, quickly move your mouse to top left of the part you want it to copy, after two seconds it will write down the coords and then quickly move your mouse to bottom right of what you want copied then quickly move your mouse to where you want it to draw..

Metagen

2008-08-31 17:28:00

Yep :D:D, also you can have it draw shading instead… its kindof wierd, i recommend that for light images only, just tinker with the script a bit