上一页 1 ··· 162 163 164 165 166 167 168 169 170 ··· 215 下一页
摘要: Delphi 的 Graphic 单元有五个重要的图像类: TGraphic、TBitmap、TMetafile、TIcon、TPicture. TBitmap 用来操作位图; TMetafile 用来操作图元文件; TIcon 用来操作图标(包括鼠标指针)文件; TBitmap、TMetafile、TIcon 都是 TGraphic 的子类, 由于 TCanvas.Draw(X, Y: ... 阅读全文
posted @ 2008-02-18 21:03 万一 阅读(6552) 评论(0) 推荐(0)
摘要: //画刷类 TBrush 有三个重要属性: Color、Style、Bitmap. {Style: 样式; Delphi 为画刷定义了样式枚举 TBrushStyle, 包含以下样式:} bsSolid bsClear bsHorizontal bsVertical bsFDiagonal bsBDiagonal bsCross bsDiagCross //下面小程序展示了上面的其中填充样... 阅读全文
posted @ 2008-02-18 18:52 万一 阅读(6592) 评论(1) 推荐(0)
摘要: //奇妙的异或运算, 就这些简单的代码, 反复点击按钮... procedure TForm1.Button1Click(Sender: TObject); begin Canvas.Pen.Color := clYellow; {指定笔颜色为黄色} Canvas.Pen.Width := 20; {笔宽 20} Canvas.Pen.Mode := pmXor; ... 阅读全文
posted @ 2008-02-18 15:18 万一 阅读(6373) 评论(2) 推荐(0)
摘要: //TPen 的主要属性有四: Color、Width、Style、Mode {Color: 颜色} {Width: 宽度; 默认是 1; 如果赋予 //下面的例子依次展示了各种样式: var i,x,y,n: Integer; begin x := 10; y := 15; n := ClientWidth - 2*x; Canvas.Pen.Color := cl... 阅读全文
posted @ 2008-02-17 22:59 万一 阅读(10045) 评论(3) 推荐(0)
摘要: //先来个例子: procedure TForm1.FormPaint(Sender: TObject); const S = '万一的 Delphi 博客'; var font: TFont; begin font := TFont.Create; font.Name := '微软雅黑'; font.Style := [fsBold, fsItalic]; font.C... 阅读全文
posted @ 2008-02-17 18:43 万一 阅读(7904) 评论(3) 推荐(0)
摘要: //第一种重载的声明: TextRect( Rect: TRect; {矩形} X, Y: Integer; {相对于窗体的位置} const Text: string {文本} ); {如果要输出的文本超出指定的矩形将不被显示} //第一种重载的举例: procedure TForm1.Button1Click(Sender: TObject); cons... 阅读全文
posted @ 2008-02-17 16:23 万一 阅读(14073) 评论(10) 推荐(2)
摘要: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedure Button... 阅读全文
posted @ 2008-02-17 15:49 万一 阅读(8540) 评论(13) 推荐(1)
摘要: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton... 阅读全文
posted @ 2008-02-17 10:44 万一 阅读(5666) 评论(0) 推荐(0)
摘要: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton... 阅读全文
posted @ 2008-02-17 10:41 万一 阅读(9421) 评论(0) 推荐(1)
摘要: 在窗体上添加 Panel1、PaintBox1 和 Button1, 代码如下: procedure TForm1.Button1Click(Sender: TObject); var cvs: TCanvas; begin {PaintBox1 就像窗体一样, 也有 Canvas 属性} PaintBox1.Canvas.Brush.Color := clRed; Pain... 阅读全文
posted @ 2008-02-16 23:25 万一 阅读(12430) 评论(3) 推荐(1)
上一页 1 ··· 162 163 164 165 166 167 168 169 170 ··· 215 下一页