06-04-2008, 02:38 PM
السلام عليكم
الأمر بسيط
بواسطة Timer يمكن أن نظهر الصورة بيكسل تلو الأخر
timer أسميته TimerPixel
قد تجد أحسن من هذه الشيفرة .. لكنها قد تجعلك على الطريق
مثال كامل تجده في المرفقات
تحياتي
الأمر بسيط
بواسطة Timer يمكن أن نظهر الصورة بيكسل تلو الأخر
timer أسميته TimerPixel
كود :
[FONT="Courier New"]
var
c : TColor;
x : Integer = 0;
y : Integer = 0;
[FONT="Tahoma"][color=Blue]//------------------------------------Timer قبل بداية عمل [/color]
image2.Height := image1.Picture.Graphic.Height;
image2.Width := image1.Picture.Graphic.Width;
[FONT="Tahoma"][color=Blue]// نجعل لون خلفية الصورة نفسه لون الأرضي[/color]
image2.Canvas.Brush.Color := Form1.color;
Image2.Canvas.FillRect(rect(0,0,Image2.Width, Image2.height));
[FONT="Tahoma"][color=Blue]//-------قد تستغني عن التالي إذا لم ترد صورة شفافة[/color]
C := image1.Canvas.Pixels[0,0];
[color=Blue]//------------------------------------------------------------------[/color]
procedure TForm1.TimerPixelTimer(Sender: TObject);
begin
if (image1.Canvas.Pixels[x,y]<> C) then [color=Blue] // لعدم إظهار لون معين[/color]
image2.Canvas.Pixels[x,y] := image1.Canvas.Pixels[x,y];
if x < image1.Picture.Width then
x := x+1
else
begin
x := 0;
if y < image1.Picture.Height then
y := y+1
else
TimerPixel.Enabled := false;
end;
end;قد تجد أحسن من هذه الشيفرة .. لكنها قد تجعلك على الطريق
مثال كامل تجده في المرفقات
تحياتي

