随笔 - 2146  文章 - 19 评论 - 11846 阅读 - 1267万

随笔分类 -  API 绘图函数

上一页 1 2 3 下一页
WinAPI: SetBkMode - 设置背景模式
摘要:本例效果图: 代码文件: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls; type TForm1 = class(TForm) RadioGroup1: ... 阅读全文
posted @ 2008-05-24 20:35 万一 阅读(7466) 评论(3) 推荐(0) 编辑
WinAPI: CloseFigure
摘要:本例效果图: 代码文件: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, ExtCtrls; type TForm1 = class(TForm) CheckBox1: TC... 阅读全文
posted @ 2008-05-24 00:03 万一 阅读(1892) 评论(3) 推荐(0) 编辑
WinAPI: BeginPath、EndPath、StrokePath、FillPath、StrokeAndFillPath
摘要:BeginPath {路径开始} EndPath {路径结束} StrokePath {绘制路径} FillPath {填充路径} StrokeAndFillPath {绘制并填充路径} //在路径中可以使用的图形命令有: AngleArc Arc ArcTo Chord CloseFigure Ellipse ExtText... 阅读全文
posted @ 2008-05-23 22:39 万一 阅读(7234) 评论(3) 推荐(0) 编辑
WinAPI: EqualRect、EqualSid、EqualPrefixSid - 判断一个矩形(或其他结构)是否相等
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2: TButton... 阅读全文
posted @ 2008-05-23 15:59 万一 阅读(2095) 评论(1) 推荐(0) 编辑
WinAPI: SetRectEmpty、IsRectEmpty
摘要:SetRectEmpty: 使矩形为空; IsRectEmpty: 判断矩形是否为空; 所谓矩形为空就是矩形是无区域的, 或者说是 Right unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs; type T... 阅读全文
posted @ 2008-05-23 13:16 万一 阅读(2628) 评论(0) 推荐(0) 编辑
WinAPI: SetRect 及初始化矩形的几种办法
摘要:本例分别用五种办法初始化了同样的一个矩形, 运行效果图: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1:... 阅读全文
posted @ 2008-05-23 11:50 万一 阅读(6121) 评论(0) 推荐(0) 编辑
WinAPI: PtInRect - 判断点是否在矩形中
摘要:本例效果图: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; procedur... 阅读全文
posted @ 2008-05-23 00:13 万一 阅读(5409) 评论(2) 推荐(1) 编辑
WinAPI: InvertRect - 翻转矩形中像素的颜色
摘要:本例效果图: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2:... 阅读全文
posted @ 2008-05-22 23:55 万一 阅读(2496) 评论(0) 推荐(0) 编辑
WinAPI: OffsetRect - 移动矩形
摘要:本例效果图: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2:... 阅读全文
posted @ 2008-05-22 23:04 万一 阅读(3968) 评论(2) 推荐(0) 编辑
WinAPI: IntersectRect、SubtractRect、UnionRect - 用两个矩形合成一个新的矩形
摘要:本例效果图: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls; type TForm1 = class(TForm) Button1: TButton; Button2:... 阅读全文
posted @ 2008-05-22 21:22 万一 阅读(5586) 评论(0) 推荐(0) 编辑
WinAPI: StrokePath - 描绘路径轮廓
摘要:本例效果图: unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs; type TForm1 = class(TForm) procedure FormPaint(Sender: TObject); ... 阅读全文
posted @ 2008-05-20 18:27 万一 阅读(2798) 评论(0) 推荐(0) 编辑
WinAPI: GetRegionData
摘要:GetRegionData( RGN: HRGN; {区域句柄} p2: DWORD; {区域数据缓冲区大小} p3: PRgnData {区域数据结构 TRgnData 的指针, 见下表} ): DWORD; {成功返回 1} //TRgnData 是 _RGNDATA 结构的重命名: _RGNDATA = record rdh: TRgnDataHeade... 阅读全文
posted @ 2008-05-20 16:18 万一 阅读(4865) 评论(10) 推荐(0) 编辑
WinAPI: GetCurrentPositionEx - 获取当前的画笔位置
摘要://声明: GetCurrentPositionEx( DC: HDC; {设备场景句柄} Point: PPoint {点指针} ): BOOL; //举例: var pt: TPoint; begin GetCurrentPositionEx(Canvas.Handle, @pt); ShowMessage(Format('%d,%d',[pt.X,pt.Y... 阅读全文
posted @ 2008-02-11 22:16 万一 阅读(2336) 评论(0) 推荐(0) 编辑
WinAPI: DrawFrameControl - 绘制控件
摘要://声明: DrawFrameControl( DC: HDC; {设备环境句柄} const Rect: TRect; {矩形} uType, uState: UINT {控件类型与控件状态} ): BOOL; //控件类型 uType 参数可选值: DFC_CAPTION = 1; {标题按钮} DFC_MENU = 2; {菜单} DF... 阅读全文
posted @ 2008-02-10 22:01 万一 阅读(10662) 评论(3) 推荐(1) 编辑
WinAPI: SetPixel 和 SetPixelV - 设置设备环境中指定位置的颜色
摘要://声明: SetPixel( DC: HDC; {设备环境句柄} X, Y: Integer; {坐标} Color: COLORREF {颜色值} ): COLORREF; {返回颜色值} SetPixelV( DC: HDC; {设备环境句柄} X, Y: Integer; {坐标} Color: COLORREF {颜色... 阅读全文
posted @ 2008-02-10 18:44 万一 阅读(4153) 评论(0) 推荐(2) 编辑
WinAPI: GetPixel - 获取设备环境中指定位置的颜色
摘要://声明: GetPixel( DC: HDC; {设备环境句柄} X, Y: Integer {坐标} ): COLORREF; {返回颜色值} 阅读全文
posted @ 2008-02-10 17:27 万一 阅读(3318) 评论(2) 推荐(0) 编辑
WinAPI: DrawCaption - 绘制标题栏
摘要://声明: DrawCaption( p1: HWND; {窗口句柄} p2: HDC; {设备环境句柄} const p3: TRect; {矩形} p4: UINT {选项} ): BOOL; //p4 参数可选值: DC_ACTIVE = 1; {使用活动标题栏颜色} DC_SMALLCAP = 2; {使... 阅读全文
posted @ 2008-02-10 17:10 万一 阅读(4606) 评论(0) 推荐(0) 编辑
WinAPI: CreateBrushIndirect - 根据画刷结构建立画刷
摘要://声明: CreateBrushIndirect( const p1: TLogBrush {画刷结构} ): HBRUSH; {返回画刷句柄} //TLogBrush 是 tagLOGBRUSH 结构的重定义: tagLOGBRUSH = packed record lbStyle: UINT; {画刷风格} lbColor: COLORREF; ... 阅读全文
posted @ 2008-02-10 15:55 万一 阅读(2895) 评论(0) 推荐(0) 编辑
WinAPI: CreatePatternBrush - 建立位图画刷
摘要://声明: CreatePatternBrush( Bitmap: HBITMAP {位图句柄} ): HBRUSH; {返回画刷句柄} //举例: procedure TForm1.FormPaint(Sender: TObject); var Bitmap: TBitmap; BrushHandle: HBRUSH; begin Bitmap := TBit... 阅读全文
posted @ 2008-02-10 15:37 万一 阅读(4326) 评论(2) 推荐(0) 编辑
WinAPI: CreateHatchBrush - 建立阴影画刷
摘要://声明: CreateHatchBrush( p1: Integer; {阴影样式} p2: COLORREF {颜色值} ): HBRUSH; {返回画刷句柄} //p1 参数可选值: HS_HORIZONTAL = 0; HS_VERTICAL = 1; HS_FDIAGONAL = 2; HS_BDIAGONAL = 3; HS_CROSS = ... 阅读全文
posted @ 2008-02-10 14:24 万一 阅读(3523) 评论(0) 推荐(0) 编辑

上一页 1 2 3 下一页


点击右上角即可分享
微信分享提示