📄 flexalpha.int
字号:
/////////////////////////////////////////////////////////
// //
// FlexGraphics library //
// Copyright (c) 2002-2009, FlexGraphics software. //
// //
// Alpha blending buffer support //
// //
/////////////////////////////////////////////////////////
unit FlexAlpha;
{$I FlexDefs.inc}
interface
uses
Windows, Classes, Graphics;
type
PAlphaLine = ^TAlphaLine;
TAlphaLine = array[0..MaxInt div SizeOf(TRGBQuad)-1] of TRGBQuad;
TStoreDrawEvent = procedure(Sender: TObject; Canvas: TCanvas;
Graphic: TGraphic) of object;
TAlphaBuffer = class
private
FParent: TAlphaBuffer;
FSourceDC: HDC;
FCanvas: TCanvas;
FCanvasDC: HDC;
FCanvasDCBitmap: HBitmap;
FPaintRect: TRect;
FPaintWidth: integer;
FPaintHeight: integer;
FWidth: integer;
FHeight: integer;
FBits: PAlphaLine;
FBytesPerLine: integer;
FInfo: TBitmapInfo;
FHandle: HBitmap;
FStored: boolean;
protected
procedure ResetCanvas(DeleteDIB: boolean = false);
procedure RecreateDIB(AWidth, AHeight: integer;
ForceRecreate: boolean = false; FillColor: cardinal = $FF000000);
public
constructor Create(AParent: TAlphaBuffer = Nil);
destructor Destroy; override;
function BeginPaint(ASourceDC: HDC;
const APaintRect: TRect): boolean; virtual;
function EndPaint(Transparency: integer): boolean; virtual;
function StoreFromGraphic(Graphic: TGraphic;
OnDraw: TStoreDrawEvent = Nil): boolean;
function PaintStored(Dest: TAlphaBuffer; const APaintRect,
ASrcRect: TRect): boolean;
property Canvas: TCanvas read FCanvas;
property SourceDC: HDC read FSourceDC;
property Handle: HBitmap read FHandle;
property Width: integer read FWidth;
property Height: integer read FHeight;
end;
implementation
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -