hojjatcroos
دوشنبه 12 بهمن 1388, 13:28 عصر
سلام به دوستان عزیزم
سوالی از خدمت دوستان داشتم در مورد دو دستور زیر که آقای mzjahromi در تاپیک قراردادند
function Picture.NextRow(i:Integer;var down:Integer):Boolean;
var
x,y,count:Integer;
flag:Boolean;
begin
y:=i+1;
Flag:=False;
repeat
count:=0;
for x:=0 to w-1 do
if getpixel(X,y)<>BackColor then
Count:=Count+1;
if count>0 then
flag:=True;
y:=Y+1;
until ((Flag and(count=0))or(y=h));
down:=y;
if Y>=h then
NextRow:=False
Else
NextRow:=True;
End;
function Picture.Nextcol(top,down,i:Integer;var Right:Integer):Boolean;
var
x,y,count:Integer;
flag:Boolean;
begin
X:=i+1;
Flag:=False;
repeat
count:=0;
for y:=top to down do
if getpixel(X,y)<>BackColor then
Count:=Count+1;
if count>0 then
flag:=True;
X:=X+1;
until ((Flag and(count=0))or(X>=W));
Right:=X;
if X>=W then
Nextcol:=False
Else
Nextcol:=True;
End;
آیا در دستور اول منظور از W همون عرض تصویر هست؟
ایا در دستور اول دو متغییر گرفته شده مقادیر سطر و ستون پیکسلی هستند؟
اگر به زبان پاسکال نوشته شده چرا getpixel دو آرگومان می گیرد؟
بی زحمت یک توضیح کلی هم درباره دستور دوم بدید.
ممنون.
سوالی از خدمت دوستان داشتم در مورد دو دستور زیر که آقای mzjahromi در تاپیک قراردادند
function Picture.NextRow(i:Integer;var down:Integer):Boolean;
var
x,y,count:Integer;
flag:Boolean;
begin
y:=i+1;
Flag:=False;
repeat
count:=0;
for x:=0 to w-1 do
if getpixel(X,y)<>BackColor then
Count:=Count+1;
if count>0 then
flag:=True;
y:=Y+1;
until ((Flag and(count=0))or(y=h));
down:=y;
if Y>=h then
NextRow:=False
Else
NextRow:=True;
End;
function Picture.Nextcol(top,down,i:Integer;var Right:Integer):Boolean;
var
x,y,count:Integer;
flag:Boolean;
begin
X:=i+1;
Flag:=False;
repeat
count:=0;
for y:=top to down do
if getpixel(X,y)<>BackColor then
Count:=Count+1;
if count>0 then
flag:=True;
X:=X+1;
until ((Flag and(count=0))or(X>=W));
Right:=X;
if X>=W then
Nextcol:=False
Else
Nextcol:=True;
End;
آیا در دستور اول منظور از W همون عرض تصویر هست؟
ایا در دستور اول دو متغییر گرفته شده مقادیر سطر و ستون پیکسلی هستند؟
اگر به زبان پاسکال نوشته شده چرا getpixel دو آرگومان می گیرد؟
بی زحمت یک توضیح کلی هم درباره دستور دوم بدید.
ممنون.