注册 登录
编程论坛 Delphi论坛

[求助]DELPHI的曲线形式输出????????

dong 发布于 2006-04-07 18:00, 694 次点击
因做毕业设计,需要一个DELPHI7.0的曲线输出程序,要有原代码,以便和计算程序相连接.
本人不是学计算机的,所以不太会编程,希望各位能帮帮我...
谢谢啦!!!!!!!!!!!
3 回复
#2
dong2006-04-10 15:15

帮帮我啊!!!!!!!!!!!!!

#3
ysp_19842006-04-10 16:46

粘个相关图发上来,看看什么形式的。

#4
yuxue19852006-04-13 11:04

呵呵这个我没有办法帮你了

我给你个图片你看看是不是这样的

晕了真麻烦不给你整图片了

给你代码试试去吧你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.

1