文件名称:Gray-Image
-
所属分类:
- 标签属性:
- 上传时间:2012-11-16
-
文件大小:9.08kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
procedure GrayScale(const Image:TImage)
var
BytesPerScan: Integer
iWidth, iHeight: Integer
pScanLine: pByteArray
R,G,B: Byte
begin
try
BytesPerScan := Abs(Integer(Image.Picture.Bitmap.ScanLine[1])-
Integer(Image.Picture.Bitmap.ScanLine[0]))
except
raise exception.create(‘Error’)
end
for iHeight := 0 to Image.Picture.Bitmap.Height - 1 do
begin
pScanLine := Image.Picture.Bitmap.ScanLine[iHeight]
iWidth := 0
while(iWidth <= BytesPerScan - 1) do
begin
R := pScanLine^[iWidth + 2]
G := pScanLine^[iWidth + 1]
B := pScanLine^[iWidth + 0]
pScanLine^[iWidth + 2] := Byte(Round(0.299 * R + 0.587 * G + 0.114 * B))
pScanLine^[iWidth + 1] := Byte(Round(0.299 * R + 0.587 * G + 0.114 * B))
pScanLine^[iWidth + 0] := Byte(Round(0.299 * R + 0.587 * G + 0.114 * B))
iWidth := iWidth + 3
end
end
Image.Refresh
end
var
BytesPerScan: Integer
iWidth, iHeight: Integer
pScanLine: pByteArray
R,G,B: Byte
begin
try
BytesPerScan := Abs(Integer(Image.Picture.Bitmap.ScanLine[1])-
Integer(Image.Picture.Bitmap.ScanLine[0]))
except
raise exception.create(‘Error’)
end
for iHeight := 0 to Image.Picture.Bitmap.Height - 1 do
begin
pScanLine := Image.Picture.Bitmap.ScanLine[iHeight]
iWidth := 0
while(iWidth <= BytesPerScan - 1) do
begin
R := pScanLine^[iWidth + 2]
G := pScanLine^[iWidth + 1]
B := pScanLine^[iWidth + 0]
pScanLine^[iWidth + 2] := Byte(Round(0.299 * R + 0.587 * G + 0.114 * B))
pScanLine^[iWidth + 1] := Byte(Round(0.299 * R + 0.587 * G + 0.114 * B))
pScanLine^[iWidth + 0] := Byte(Round(0.299 * R + 0.587 * G + 0.114 * B))
iWidth := iWidth + 3
end
end
Image.Refresh
end
(系统自动生成,下载前可以参看下载内容)
下载文件列表
ImageProcessor6/BrightnessUnit.dfm
ImageProcessor6/BrightnessUnit.pas
ImageProcessor6/ContrastUnit.dfm
ImageProcessor6/ContrastUnit.pas
ImageProcessor6/HistogramUnit.dfm
ImageProcessor6/HistogramUnit.pas
ImageProcessor6/ImageProcessor.dpr
ImageProcessor6/ImageProcessor.res
ImageProcessor6/ImageUnit.dfm
ImageProcessor6/ImageUnit.pas
ImageProcessor6/MainUnit.dfm
ImageProcessor6/MainUnit.pas
ImageProcessor6/BrightnessUnit.pas
ImageProcessor6/ContrastUnit.dfm
ImageProcessor6/ContrastUnit.pas
ImageProcessor6/HistogramUnit.dfm
ImageProcessor6/HistogramUnit.pas
ImageProcessor6/ImageProcessor.dpr
ImageProcessor6/ImageProcessor.res
ImageProcessor6/ImageUnit.dfm
ImageProcessor6/ImageUnit.pas
ImageProcessor6/MainUnit.dfm
ImageProcessor6/MainUnit.pas
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.