请教大家:这句为什么老通过不了?(5分)

  • 主题发起人 主题发起人 鲁皮皮
  • 开始时间 开始时间

鲁皮皮

Unregistered / Unconfirmed
GUEST, unregistred user!
unit brush1;

interface

uses
SysUtils, Windows, Messages, Classes, Graphics, Controls, Forms, Dialogs,
Buttons, ExtCtrls, StdCtrls, ComCtrls, Menus;

type
TDrawingTool = (dtLine, dtRectangle, dtEllipse, dtRoundRect);
TForm1 = class(TForm)
Panel1: TPanel;
LineButton: TSpeedButton;
RectangleButton: TSpeedButton;
EllipseButton: TSpeedButton;
RoundRectButton: TSpeedButton;
PenButton: TSpeedButton;
BrushButton: TSpeedButton;
PenBar: TPanel;
BrushBar: TPanel;
SolidPen: TSpeedButton;
DashPen: TSpeedButton;
DotPen: TSpeedButton;
DashDotPen: TSpeedButton;
DashDotDotPen: TSpeedButton;
ClearPen: TSpeedButton;
PenWidth: TUpDown;
PenSize: TEdit;
StatusBar1: TStatusBar;
ScrollBox1: TScrollBox;
Image: TImage;
SolidBrush: TSpeedButton;
ClearBrush: TSpeedButton;
HorizontalBrush: TSpeedButton;
VerticalBrush: TSpeedButton;
FDiagonalBrush: TSpeedButton;
BDiagonalBrush: TSpeedButton;
CrossBrush: TSpeedButton;
DiagCrossBrush: TSpeedButton;
PenColor: TSpeedButton;
BrushColor: TSpeedButton;
ColorDialog1: TColorDialog;
MainMenu1: TMainMenu;
File1: TMenuItem;
New1: TMenuItem;
Open1: TMenuItem;
Save1: TMenuItem;
Saveas1: TMenuItem;
N1: TMenuItem;
Exit1: TMenuItem;
Edit1: TMenuItem;
Cut1: TMenuItem;
Copy1: TMenuItem;
Paste1: TMenuItem;
OpenDialog1: TOpenDialog;
SaveDialog1: TSaveDialog;
procedure FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
procedure FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure LineButtonClick(Sender: TObject);

private
{ Private declarations }
public
{ Public declarations }
BrushStyle: TBrushStyle;
PenStyle: TPenStyle;
PenWide: Integer;
Drawing: Boolean;
Origin, MovePt: TPoint;
DrawingTool: TDrawingTool;
CurrentFile: string;

procedure DrawShape(TopLeft, BottomRight: TPoint; AMode: TPenMode);
end;

var
Form1: TForm1;

implementation

uses BMPDlg, Clipbrd;

{$R *.dfm}

procedure TForm1.FormMouseDown(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
Drawing := True;
Image.Canvas.MoveTo(X, Y);
Origin := Point(X, Y);
MovePt := Origin;
StatusBar1.Panels[0].Text := Format('Origin: (%d, %d)', [X, Y]);
end;

procedure TForm1.FormMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
begin
if Drawing then
begin
DrawShape(Origin, Point(X, Y), pmCopy);
Drawing := False;
end;
end;

procedure TForm1.FormMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
if Drawing then
begin
DrawShape(Origin, MovePt, pmNotXor);
MovePt := Point(X, Y);
DrawShape(Origin, MovePt, pmNotXor);
end;
StatusBar1.Panels[1].Text := Format('Current: (%d, %d)', [X, Y]);
end;

procedure TForm1.LineButtonClick(Sender: TObject);
begin
DrawingTool := dtLine;
end;


procedure TForm1.DrawShape(TopLeft, BottomRight: TPoint; AMode: TPenMode);
begin
with Image.Canvas do
begin
Pen.Mode := AMode;
case DrawingTool of
dtLine:
begin
Image.Canvas.MoveTo(TopLeft.X, TopLeft.Y);
Image.Canvas.LineTo(BottomRight.X, BottomRight.Y);
end;
dtRectangle: Image.Canvas.Rectangle(TopLeft.X, TopLeft.Y, BottomRight.X,
BottomRight.Y);
dtEllipse: Image.Canvas.Ellipse(Topleft.X, TopLeft.Y, BottomRight.X,
BottomRight.Y);
dtRoundRect: Image.Canvas.RoundRect(TopLeft.X, TopLeft.Y, BottomRight.X,
BottomRight.Y, (TopLeft.X - BottomRight.X) div 2,
(TopLeft.Y - BottomRight.Y) div 2);
end;
end;
end;








end.
请问:
implementation 下的第一句:
uses BMPDlg, Clipbrd;
老编译时出错,我想把DELPHI自带的做图程序自己做出来,可不明白这句什么意思。
详细见:DEMOS/DOC/GRAPHEX目录。
 
奇怪,我的可以编译。
 
报什么错?
 
把BMPDlg.pas拷到你自己的工程目录下。
 

Similar threads

I
回复
0
查看
721
import
I
I
回复
0
查看
576
import
I
I
回复
0
查看
734
import
I
后退
顶部