Recent Posts

Selamat datang di Coding Delphi Land Weblog kumpulan source code pemogram delphi

(Bukan maksud untuk menggurui tetapi marilah kita berbagi ilmu tuk perkembangan kemajuan teknologi kita

Selasa, 17 November 2009

Get Data Color Pixel Scanline

procedure Tform1.getdatapixel;
var
x,y : integer;
img : Pbytearray;
begin
STringgrid1.ColCount:= image1.Picture.Width;
STringgrid1.RowCount:= image1.Picture.Height;
image1.Picture.bitmap.PixelFormat:= pf24Bit;
for y := 0 to image1.Picture.Height-1 do
begin
img := image1.Picture.Bitmap.ScanLine[y];
for x := 0 to image1.Picture.Width-1 do
begin
STringgrid1.Cells[x,y] := 'R :'+IntToStr(img[3*x+2])+
'G :'+IntToStr(img[3*x+1])+
'B :'+IntToStr(img[3*x]);
end;
end;
end;

0 komentar:

Posting Komentar