我想在image上随机花10个点,代码如下:
procedure TForm1.Button1Click(Sender: TObject);
var i,x,y:integer;
begin
for i:=1 to 10 do begin
Randomize;
x:=Random(form1.image1.width);
y:=Random(form1.image1.height);
Image1.Canvas.Pixels[x,y]:=clred;
end;
end;
现在的问题是,当我点一次button的时候,它只能产生一个点,我想同时就产生10个点,怎么不行呢?请高手指教!谢谢!
procedure TForm1.Button1Click(Sender: TObject);
var i,x,y:integer;
begin
for i:=1 to 10 do begin
Randomize;
x:=Random(form1.image1.width);
y:=Random(form1.image1.height);
Image1.Canvas.Pixels[x,y]:=clred;
end;
end;
现在的问题是,当我点一次button的时候,它只能产生一个点,我想同时就产生10个点,怎么不行呢?请高手指教!谢谢!
解决方案 »
- 数据库字符串连接和数字统计问题,比较难一点。
- 如何在listview中显示jpg、gif等格式的图像,而不是图标?
- 请问怎样在DELPHI编写的程序中关闭与打开ctrl+alt+del 也就是让人无法打开任务管理器
- 用delphi写的程序如何打包?有没有打包软件!
- 我想做一个ocx控件实现调用客户端的notes的应用程序
- 请教一个取数据问题!!
- Delphi 安装的问题
- 诚心求助,delphi源码 传奇登陆器问题
- 已经告别了DELPHI ,回来看看
- Delphi有两个button 第一个添加数据到Listview第一和第二列 第二个怎么添加数据到第三列
- 怎样判断一个日期型字段是否为空?
- 有关form2.showmodal=mrOK 的问题?
procedure TForm1.Button1Click(Sender: TObject);
var i,x,y:integer;
begin
Randomize;
for i:=1 to 10 do
begin
//Randomize;
x:=Random(form1.image1.width);
y:=Random(form1.image1.height);
Image1.Canvas.Pixels[x,y]:=clred;
end;
end;