小女告急:如何实现现类似Photoshop中的色阶调节功能?(0分)

  • 主题发起人 主题发起人 laohe
  • 开始时间 开始时间
L

laohe

Unregistered / Unconfirmed
GUEST, unregistred user!
请大侠支持,我现在没钱了
 
小女子没钱了

我只能帮你up
 
如果你会MFC的话,不妨到www.codeproject.com或www.codeguru.com上找找。
 
不知道这样行不行?

procedure TMainForm.RAdjustClick(Sender: TObject);
var
p :PByteArray;
x,y :Integer;
Bmp :TBitmap;

begin
Bmp :=TBitmap.Create;
Bmp.Assign(ChildForm.Image1.Picture.Bitmap);
Bmp.PixelFormat :=pf24Bit;
for y:=0 to Bmp.Height-1 do
begin
p:=Bmp.scanline[y];
for x:=0 to Bmp.Width-1 do
begin

if p[x*3+2] <245 then
begin
p[x*3+2]:=p[x*3+2]+10;
end;
end ;

end;

ChildForm.image1.Picture.Bitmap.Assign(Bmp);
Bmp.Free;
bmpnumber:=bmpnumber+1;
ChildForm.image1.Picture.SaveToFile('c:/temp/'+inttostr(bmpnumber)+'.bmp');
end;


procedure TMainForm.GAdjustClick(Sender: TObject);
var
p :PByteArray;
x,y :Integer;
Bmp :TBitmap;

begin
Bmp :=TBitmap.Create;
Bmp.Assign(ChildForm.Image1.Picture.Bitmap);
Bmp.PixelFormat :=pf24Bit;
for y:=0 to Bmp.Height-1 do
begin
p:=Bmp.scanline[y];
for x:=0 to Bmp.Width-1 do
begin

if p[x*3+1] <245 then
begin
p[x*3+1]:=p[x*3+1]+10;
end;
end ;

end;

ChildForm.image1.Picture.Bitmap.Assign(Bmp);
Bmp.Free;
bmpnumber:=bmpnumber+1;
ChildForm.image1.Picture.SaveToFile('c:/temp/'+inttostr(bmpnumber)+'.bmp');
end;



procedure TMainForm.BAdjustClick(Sender: TObject);
var
p :PByteArray;
x,y :Integer;
Bmp :TBitmap;

begin
Bmp :=TBitmap.Create;
Bmp.Assign(ChildForm.Image1.Picture.Bitmap);
Bmp.PixelFormat :=pf24Bit;
for y:=0 to Bmp.Height-1 do
begin
p:=Bmp.scanline[y];
for x:=0 to Bmp.Width-1 do
begin

if p[x*3] <245 then
begin
p[x*3]:=p[x*3]+10;
end;
end ;

end;

ChildForm.image1.Picture.Bitmap.Assign(Bmp);
Bmp.Free;
bmpnumber:=bmpnumber+1;
ChildForm.image1.Picture.SaveToFile('c:/temp/'+inttostr(bmpnumber)+'.bmp');
end;
 
http://www.efg2.com/Lab/ImageProcessing/HistoStretchGrays.htm
http://www.efg2.com/Lab/ImageProcessing/HistoStretchGrays.ZIP
 
你再加点分数,我给你写个算法

 
这位小女子叫老何?? :)
看在都是老字辈的份上,我可以提供赞助. ^_^
 
我没有分数了,支持我的朋友,我只能这有钱时再请你过来,
 
你可以和俺要啊:)
 
一个叫老河的女人~~~~``````
 
这里是谈技术的地方!请大侠出马
 
老兄不要这么懒,我已经给出具体地文章和Source了,你到底看过没有?

有什么需要讨论的,先看了再提出来。
 
Huazai's code can take some tips to you!
 

Similar threads

D
回复
0
查看
959
DelphiTeacher的专栏
D
D
回复
0
查看
893
DelphiTeacher的专栏
D
D
回复
0
查看
798
DelphiTeacher的专栏
D
D
回复
0
查看
973
DelphiTeacher的专栏
D
后退
顶部