请给出代码!
解决方案 »
- FR3换页
- 菜鸟问题:如何让TADOConnection不弹出数据库登录对话框,通过什么方法在程序中设定 userid和password
- 大侠们,我搞不懂这个OLE的错误...
- 关于MessageBox,MessageDlg的用法!
- 请问delphi中*.bpl是什么文件,在目标机运行还需要这些文件吗?
- 上海合租住房!请版主先别删!
- 为什么在Delphi6中添加Quickreport控件的时候出现错误?????help me!
- 利用DAO创建access数据库时,需要给字段创建一个标题属性,运行时报错。
- 怎样做到每隔10秒打开一个指定的文件?
- 有关日期计算
- 大家帮忙看看下面这段代码怎么老是存取错误!
- 在开发多语言系统时遇到问题,请教
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtDlgs, StdCtrls, ExtCtrls;type
TForm1 = class(TForm)
Image1: TImage;
Image2: TImage;
Button1: TButton;
handle: TButton;
OpenPictureDialog1: TOpenPictureDialog;
procedure Button1Click(Sender: TObject);
procedure handleClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation
uses math;
{$R *.dfm}procedure TForm1.Button1Click(Sender: TObject);
begin
Self.OpenPictureDialog1.Filter := '*.bmp|*.bmp';
if self.OpenPictureDialog1.Execute then
begin
Image1.Picture.Bitmap.LoadFromFile(OpenPictureDialog1.FileName);
end;
end;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;
end.