摘要:procedure TForm1.Button1Click(Sender: TObject);var lf:tlogfont;tf:tfont;begin tf:=tfont.Create; tf.Assign(button1.font); getobject(tf.handle,sizeof(lf
阅读全文
摘要:function EnumFontFamilyProc(var lf : TLogFont; var tm : TNewTextMetric; FontType : integer; var Memo : TMemo) : integer{$IFDEF WIN32} stdcall; {$ELSE}
阅读全文
摘要:function IsTrueTypeFont(FontName : string) : boolean;const PITCH_MASK: byte = $0F; var TxMetric: TTextMetric; TempCanvas : TCanvas; PitchTest : byte;b
阅读全文
摘要:function IsTrueTypeAvailable : bool;var {$IFDEF WIN32} rs : TRasterizerStatus; {$ELSE} rs : TRasterizer_Status; {$ENDIF}begin result := false; if not
阅读全文
摘要:unit Unit1; interface uses Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Registry; type TForm1 = class(TForm) Bu
阅读全文
摘要:StretchBlt 函数从源矩形中复制一个位图到目标矩形,必要时按目前目标设备设置的模式进行图像的拉伸或压缩以满足目标矩形的尺寸。 原型: BOOL StretchBlt( HDC hdcDest, int nXOriginDest, int nYOriginDest, int nWidthDes
阅读全文
摘要:PatBlt 该函数使用当前选入指定设备环境中的刷子绘制给定的矩形区域。通过使用给出的光栅操作来对该刷子的像素和表面像素进行组合。 原型: BOOL PatBlt( HDC hdc, int nXLeft, int nYLeft, int nWidth, int nHeight, DWORD dwR
阅读全文
摘要:我有两个位图,一个前景图,一个背景图(mask用途)。请问如何用MaskBlt实现两个位图的合并,从而实现背景透明! 核心代码:dcImage.SetBkColor(crColour);dcMask.BitBlt(0, 0, nWidth, nHeight, &dcImage, 0, 0, SRCC
阅读全文
摘要:procedure AngleTextOut(CV: TCanvas; const sText: String; x, y, angle:integer);var LogFont: TLogFont; SaveFont: TFont; begin SaveFont := TFont.Create;
阅读全文
摘要:procedure TForm1.Button1Click(Sender: TObject);begin canvas.Font.Name := 'Times New Roman'; canvas.Font.size := 72; canvas.Font.style := [fsItalic,fsB
阅读全文
摘要:procedure TForm1.Button1Click(Sender: TObject);begin Canvas.Font.Name := 'Times New Roman'; //这里的字体一定要是TrueType Font Canvas.Font.size := 72; Canvas.Fo
阅读全文
摘要:先将文字放大一倍字号画到临时内存中, 再用AntiAlias算法缩小, 绝对光滑.而且速度很快.我这有个AntiAlias算法的例子, 很简单但很说明问题:其中核心代码如下:procedure TAntiAliasForm.SeparateColor(color : TColor; var r, g
阅读全文
摘要:在Delph下调用PolyBezier();procedure TForm1.Button1Click(Sender: TObject);var point:array[0..6] of Tpoint; h:HDC;beginh:=getdc(form1.handle);point[0].x:=25
阅读全文
摘要:Several Points (2D and 3D) routinesFrom: "Verstraelen" <vsta@innet.be> unit Functs; interface uses WinTypes, Classes, Graphics, SysUtils; type TPoint2
阅读全文
摘要:思路: 扫描图象的scanline, 取不是背景色的连续坐标, 认为是一个height=1的rect,用CreateRectRgn生成region, 再用CombineRgn(.....RGN_OR)与先前生成的region合并生成新的region. 重复扫描完所有扫描线后就得到一个region了.
阅读全文
摘要:Here's code to rotate a bitmap 90 degrees From: Dave Shapiro <daves@cyber-fx.com>Counterclockwise, that is. This rotates a 640x480 24-bit bitmap 90 de
阅读全文
摘要:function GetColorDepth: integer var dc: HDC; begin dc := GetDC(0); Result := GetDeviceCaps(dc, BITSPIXEL); ReleaseDC(0, dc); end;
阅读全文
摘要:const MaxPointNum = 65535;type PXY = ^TXY; TXY = record // 点的数据结构 x, y: single; end; XYArray = array[0..MaxPointNum] of TXY; PXYArray = ^XYArray; // 线
阅读全文
摘要:MaskBlt 该函数使用特定的掩码和光栅操作来对源和目标位图的颜色数据进行组合。 原型: BOOL MaskBlt( HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHeight, HDC hdcSrc, int nXSrc, int n
阅读全文
摘要:procedure TForm1.Button1Click(Sender: TObject);var ptArray : array[0..9] of TPOINT; PtCounts : array[0..1] of integer;begin PtArray[0] := Point(0, 0);
阅读全文