......
type
TRGB=record
R,G,B:BYTE;
end;
TRGBLine=array[0..65535]of TRGB;
PRGBLine=^TRGBLine;
......
procedure TForm1.Button2Click(Sender: TObject);
var
i,j,k:integer;
scanline:PRGBLine;//我指的就是这个指针,我想让它指向image2的第一个象素;
a,d,c,t,z:byte;
m,n,m1,n1:double;
h:Thue;
r,g,b:byte;
begin
j:=0;
quantization(image2);
for k:=0 to ((image2.Width)*(image2.height)-1) do
begin
a:=(hsvdata[k]) div 32;
d:=(hsvdata[k] mod 32)div 4;
c:=(hsvdata[k] mod 128) ;
if a=0 then
h:=10
else if a=1 then
h:=30
else if a=2 then
h:=60
else if a=3 then
h:=100
else if a=4 then
h:=180
else if a=5 then
h:=250
else if a=6 then
h:=280
else if a=7 then
h:=310; if d=0 then
m:=0.1
else if d=1 then
m:=0.5
else if d=2 then
m:=0.8
else m:=0; if c=0 then
n:=0.1
else if c=1 then
n:=0.5
else if c=2 then
n:=0.8
else n:=0;
m1:=m*255;
n1:=n*255;
t:=trunc(m1);
z:=trunc(n1);
hsvtorgb(h,t,z,r,g,b);
scanline[j].R:=r;
scanline[j].G:=g;
scanline[j].B:=b;
inc(j);
end;
Image2.Refresh;
end;
end
type
TRGB=record
R,G,B:BYTE;
end;
TRGBLine=array[0..65535]of TRGB;
PRGBLine=^TRGBLine;
......
procedure TForm1.Button2Click(Sender: TObject);
var
i,j,k:integer;
scanline:PRGBLine;//我指的就是这个指针,我想让它指向image2的第一个象素;
a,d,c,t,z:byte;
m,n,m1,n1:double;
h:Thue;
r,g,b:byte;
begin
j:=0;
quantization(image2);
for k:=0 to ((image2.Width)*(image2.height)-1) do
begin
a:=(hsvdata[k]) div 32;
d:=(hsvdata[k] mod 32)div 4;
c:=(hsvdata[k] mod 128) ;
if a=0 then
h:=10
else if a=1 then
h:=30
else if a=2 then
h:=60
else if a=3 then
h:=100
else if a=4 then
h:=180
else if a=5 then
h:=250
else if a=6 then
h:=280
else if a=7 then
h:=310; if d=0 then
m:=0.1
else if d=1 then
m:=0.5
else if d=2 then
m:=0.8
else m:=0; if c=0 then
n:=0.1
else if c=1 then
n:=0.5
else if c=2 then
n:=0.8
else n:=0;
m1:=m*255;
n1:=n*255;
t:=trunc(m1);
z:=trunc(n1);
hsvtorgb(h,t,z,r,g,b);
scanline[j].R:=r;
scanline[j].G:=g;
scanline[j].B:=b;
inc(j);
end;
Image2.Refresh;
end;
end
解决方案 »
- 请求帮助,数字算法问题。请看下面的一组数字。在线~~~~~~~[
- 我想定义是HWND和DWORD这两个类型的变量.但是用uses会出错...
- SQL语句问题。完了直接请吃饭,给分
- DBGRID导出EXCLE后,怎样保持原来的数据格式和自动调整列宽?
- 谁有用delphi写的计算器?
- 怎样禁止网页中的弹出式广告,在线等待。
- Delphi5/6/7的差别?
- 用rave做报表,如何自定义报表的大小?
- 如何吧string型的变量转换成pwidechar类型的
- (10+1.31-0.3)<>(10.00+1.31-0.3)???
- 请教关于Delphi中FTP的问题!!!(急,急,急)
- 一个delphi调用sql server 2000的问题
然后scanline[0]即为第一个像素。