本人不是学计算机的,所以不太会编程,希望各位能帮帮我...
谢谢啦!!!!!!!!!!!
呵呵这个我没有办法帮你了
我给你个图片你看看是不是这样的
晕了真麻烦不给你整图片了
给你代码试试去吧你unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Image1: TImage;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
uses XMconsts;
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
var
x, l: Integer;
y, a: Double;
begin
Image1.Picture.Bitmap := TBitmap.Create;
//生成图片对象
Image1.Picture.Bitmap.Width := Image1.Width;
Image1.Picture.Bitmap.Height := Image1.Height;
l := Image1.Picture.Bitmap.Width;
//开始绘制图形
for x := 0 to l do
begin
a := (x / l) * 2 * Pi;
y := Sin(a);
y := y * (Image1.Picture.Bitmap.Height / 2);
y := y * -1;
y := y + (Image1.Picture.Bitmap.Height / 2);
Image1.Picture.Bitmap.Canvas.Brush.Style := bsSolid;
Image1.Picture.Bitmap.Canvas.Pixels[Trunc(x), Trunc(y)] := clred;
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Caption := '绘制正弦曲线'
end;
end.