![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
delphi
qq_43466604
这个作者很懒,什么都没留下…
展开
-
Delphi Try Except 实例
try except raise Exception.Create('123'); exit; end; try except ShowMessage(Exception(ExceptObject).Message); exit; end; try except on e:Exception do be...原创 2018-11-02 11:03:18 · 3798 阅读 · 0 评论 -
两张BMP图片叠加
procedure BlendImage(BackBmp, ForeBmp: TBitmap; TransColor: TColor; Alpha: Integer);type TRGBArray = array[0..32767] of TRGBTriple; PRGBArray = ^TRGBArray;var X, Y, OffX, OffY: Integer; B...原创 2019-01-02 13:20:03 · 1580 阅读 · 2 评论 -
根据文件头确认文件类型
function ExtractFileHead(Stream: TStream): string; overload;var tmpPos: Longint; dwHead0, dwHead1: Word;begin Result := ''; if Assigned(Stream) then try tmpPos := Stream.Position; ...原创 2019-01-01 11:51:51 · 229 阅读 · 0 评论 -
检校MD5
uses IdHashMessageDigest, IdHash; { 从流中校验数据的MD5值 }function MD5Stream(const Stream: TStream): string;var MyMD5: TIdHashMessageDigest5; Digest: T4x4LongWordRecord;begin Result := ''; try...原创 2018-12-07 11:37:36 · 133 阅读 · 1 评论 -
使自定义右键菜单快捷键生效
function TCustomThumbView.IsMenuKey(var Message: TWMKey): Boolean;var LocalPopupMenu: TPopupMenu;begin Result := True; if not (csDesigning in ComponentState) then begin LocalPopupMenu :...原创 2018-12-06 13:15:27 · 650 阅读 · 0 评论 -
ObjectList模板
TObjects = class(TObject) private FItems: TList; function GetCount: Integer; function GetItem(Index: Integer): TObject; public constructor Create; virtual; destructor Destro...原创 2018-11-28 09:38:24 · 95 阅读 · 0 评论 -
图像比例缩放
function ScaleRect(var dst: TRect; ref: TRect): Boolean; overload;var dw, dh, rw, rh: Integer; xyscale: Double;begin dw := dst.Right - dst.Left; dh := dst.Bottom - dst.Top; rw := ref.Righ...原创 2018-11-08 11:43:06 · 333 阅读 · 0 评论 -
image 控件加载bmp、JPG、GIF、PNG等图片的办法
procedure TForm1.Button1Click(Sender: TObject);var jpg: TJPEGImage; // 要use Jpeg单元 png: tpngimage; gif: tgifimage;begin jpg := TJPEGImage.Create; jpg.LoadFromFile('...\pic.jpg'); Image1...原创 2018-11-08 09:37:03 · 3853 阅读 · 0 评论 -
失去焦点的时候模拟选中状态
if Item.Selected and not Focused then begin Canvas.Font.Color := clHighlightText; Canvas.Brush.Color := clHighlight; end;原创 2018-11-02 11:02:44 · 201 阅读 · 0 评论 -
ScreenCap
procedure TForm1.ScreenCap(LeftPos, TopPos, RightPos, BottomPos: Integer);var RectWidth, RectHeight: Integer; SourceDC, DestDC, Bhandle: Integer; Bitmap: TBitmap;begin RectWidth := RightPos...原创 2019-01-16 15:46:04 · 1108 阅读 · 0 评论