哪位有图像放大、缩小、亮度、对比度的算法 不打算用控件 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 研究一下 IMAGEX或 GRAPHICSEX 的代码吧 图象的坐标变化应该可以用一个给出的比例从已知点推出它新点的rgb 亮度调节:procedure TForm1.handleClick(Sender: TObject);var p: PByteArray; x, y: Integer; Bmp: TBitmap;begin Bmp := TBitmap.Create; Bmp.Assign(Image1.Picture.Bitmap); //24位真彩色 Bmp.PixelFormat := pf24Bit; randomize; for y := 0 to Bmp.Height - 1 do begin p := Bmp.scanline[y]; for x := 0 to Bmp.Width - 1 do begin //每个象素点的R、G、B分量进行调节 begin p[x * 3] := Min(255, p[x * 3] + 20); //不能越界,限制在0~255 p[x * 3 + 1] := Min(255, p[x * 3 + 1] + 20); p[x * 3 + 2] := Min(255, p[x * 3 + 2] + 20); end end; end; Image2.Picture.Bitmap.Assign(Bmp); Bmp.Free;end;对比度:procedure TForm1.handleClick(Sender: TObject);var p: PByteArray; x, y: Integer; Bmp: TBitmap;begin Bmp := TBitmap.Create; Bmp.Assign(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 //确定阀值为128 if (p[x * 3] < 246) and (p[x * 3] > 128) and (p[x * 3 + 1] > 128) and (p[x * 3 + 1] < 246) and (p[x * 3 + 2] > 128) and (p[x * 3 + 2] < 246) then begin p[x * 3] := p[x * 3] + 10; p[x * 3 + 1] := p[x * 3 + 1] + 10; p[x * 3 + 2] := p[x * 3 + 2] + 10; end; if (p[x * 3] > 10) and (p[x * 3] < 128) and (p[x * 3 + 1] > 10) and (p[x * 3 + 1] < 128) and (p[x * 3 + 2] > 10) and (p[x * 3 + 2] < 128) then begin p[x * 3] := p[x * 3] - 10; p[x * 3 + 1] := p[x * 3 + 1] - 10; p[x * 3 + 2] := p[x * 3 + 2] - 10; end; end; end; Image2.Picture.Bitmap.Assign(Bmp); Bmp.Free;end; 我有一套纯图像处理的源码,可以处理大部分PS的功能,要就留个EM啦 谢谢xzhifei和楼上的几位!mail: [email protected] [email protected]一个邮箱不保险:) 大部分PS的功能?这么牛...而且,才一个单元?这个单元不会有几十万行代码吧?我也要[email protected] [email protected] 我们平时有好多图片,也要一个 [email protected] 以前用过放大矩阵,旋转矩阵,有好东西,当然要[email protected]谢谢另外,很高兴看到一个和我一样抵制日货的 我也要啊@ [email protected] 我要呀,谁给传一个,谢谢了[email protected] 给我也发个吧,谢谢 [email protected] 我也正在编写一个图象处理软件,麻烦帮忙给我发一个,谢谢[email protected] 宝物!还有没?!各位还有这份收藏的,劳烦发给我一份啊![email protected] 请教:TidHTTP中403 Forbidden的问题 关于日期的比较 请教:模块化设计问题 求助:为何每次创建的对象地址都一样?在线等,问题解决马上结贴,谢谢! 奇怪?向sql的表添加记录后,导致数据库无法连接 求:API HOOK的实现!!!!!!! 求在网站上查找邮件地址的思路及实现 怎么样得到dbgrid中显示的记录数 哪个网站可以申请到免费的个人主页空间 Delphi菜鸟求救,Internet分页中的NMHTTP和NMFTP怎么用? 100分请教:PaintBox.canvas保存为bmp图像问题,请指教!!!! 谁能讲一下对象引用和类引用得区别:谢了
或 GRAPHICSEX 的代码吧
procedure TForm1.handleClick(Sender: TObject);
var
p: PByteArray;
x, y: Integer;
Bmp: TBitmap;
begin
Bmp := TBitmap.Create;
Bmp.Assign(Image1.Picture.Bitmap);
//24位真彩色
Bmp.PixelFormat := pf24Bit;
randomize;
for y := 0 to Bmp.Height - 1 do
begin
p := Bmp.scanline[y];
for x := 0 to Bmp.Width - 1 do
begin
//每个象素点的R、G、B分量进行调节
begin
p[x * 3] := Min(255, p[x * 3] + 20); //不能越界,限制在0~255
p[x * 3 + 1] := Min(255, p[x * 3 + 1] + 20);
p[x * 3 + 2] := Min(255, p[x * 3 + 2] + 20);
end
end;
end;
Image2.Picture.Bitmap.Assign(Bmp);
Bmp.Free;
end;
对比度:
procedure TForm1.handleClick(Sender: TObject);
var
p: PByteArray;
x, y: Integer;
Bmp: TBitmap;
begin
Bmp := TBitmap.Create;
Bmp.Assign(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
//确定阀值为128
if (p[x * 3] < 246) and (p[x * 3] > 128) and (p[x * 3 + 1] >
128)
and (p[x * 3 + 1] < 246)
and (p[x * 3 + 2] > 128) and (p[x * 3 + 2] < 246) then
begin
p[x * 3] := p[x * 3] + 10;
p[x * 3 + 1] := p[x * 3 + 1] + 10;
p[x * 3 + 2] := p[x * 3 + 2] + 10;
end;
if (p[x * 3] > 10) and (p[x * 3] < 128) and (p[x * 3 + 1] >
10)
and (p[x *
3 + 1] < 128)
and (p[x * 3 + 2] > 10) and (p[x * 3 + 2] < 128) then
begin
p[x * 3] := p[x * 3] - 10;
p[x * 3 + 1] := p[x * 3 + 1] - 10;
p[x * 3 + 2] := p[x * 3 + 2] - 10;
end;
end;
end;
Image2.Picture.Bitmap.Assign(Bmp);
Bmp.Free;
end;
[email protected]
谢谢
另外,很高兴看到一个和我一样抵制日货的
[email protected]