---------------------------------------------------
Drawing Manager Copyright (r) by DreamFactory
Version : 1.75 Author : William Yang
Last Update 10 - Sep - 97
---------------------------------------------------
BmpIsNil - Check if bitmap is Empty.
BytesPaint - This one for paint big picture, it will chop it into small pieces
and paint them on to the dest.
CreateMask - Create a mask for the source bitmap.
Draw3D - Draw a 3D rectangle which the colours are fit the given "Color"} {Style: 1:Raise, 2:Sunk, 3:Frame
Draw3DText - Like Frame3D but this is for text
DrawOutlinedText - Draw the given text and the outlines} {SC : Outline Colour
DrawShadowText - Draw text with shadow
DrawShadowTextExt - Draw the given text with shadow and more options} {SC : Outline Colour
DrawTextAnglo - if Tb.
DrawTextOutline - Draw only the outlines of the given text
GetCtrlPoint -
GetCtrlRect - This function will give the rect measure in screen mode} {ClientToScreen only give Point of its parent control
Compare the Right/Bottom kepp the Big ones
MergeRect - Merge rectangles to one piece
ensure that font.
MultiClipPaint - Like multipaint but this can work out the Clipping area
so you dont need to refresh the whole area when repaint,
simply by send Canvas.
MultiPaint - Paint Tiled "Src" in "Dest"
Area indicates the painting rectangle
-- Delphi 2.
PaintOnMask -
PaintOnText - Some functions that will make you a nice text } { Paint bitmaps on text
Font can be modified before send the Canvas.
ReadPixels -
ReadText - Use canvas so you send the font together.
RoundButton - Draw a rounded button
Clear the area with backcolor
SetSize - Set the size of bitmap rather than Width :=, Height :=.
SmoothBlt -
StretchPaintOnMask - Paint bitmaps on the mask.
StretchPaintOnText - Stretch the bitmap to fit on the text.
TextSmooth - Not in Image area, becase the size
TransBlt - One parameter ignored, TransColor is the first pixel of your bitmap
TransColor -
TransparentBlt - Paint transparent "Bmp" on the "Dest"
Deallocate system resources.
TReadPixelProcs
function BmpIsNil(Bitmap: TBitmap): Boolean;
Check if bitmap is Empty.
procedure BytesPaint(Dest : TCanvas; Area: TRect; Src : TBitmap);
This one for paint big picture, it will chop it into small pieces
and paint them on to the dest. (if you have few ram
function CreateMask(Src: TBitmap; TransColor: TColor): HBitmap;
Create a mask for the source bitmap.Must be black;
procedure Draw3D(Dest : TCanvas; Area : TRect; Color : TColor;
Style, Width : Integer);
Draw a 3D rectangle which the colours are fit the given "Color"} {Style: 1:Raise, 2:Sunk, 3:Frame
procedure Draw3DText(Dest : TCanvas; Text: String; X, Y : Integer; HighEdge, LowEdge: TColor);
Like Frame3D but this is for text
procedure DrawOutlinedText(Dest: TCanvas; X, Y : Integer; Text: String; SC: TColor);
Draw the given text and the outlines} {SC : Outline Colour
procedure DrawShadowText(Dest: TCanvas; X, Y : Integer; Text: String);
Draw text with shadow
procedure DrawShadowTextExt(Dest: TCanvas; X, Y : Integer; Text: String; SC: TColor;
SX, SY: Integer);
Draw the given text with shadow and more options} {SC : Outline Colour
procedure DrawTextAnglo(Canvas: TCanvas; X, Y: Integer; Text: String; Anglo: Integer);
if Tb.Canvas.Pixels[i, j-1] <> clBlack then SSetPixel(Tmp.Canvas, i, J-1, Canvas.Font.Color);
procedure DrawTextOutline(Dest: TCanvas; X, Y : Integer; Text: String; SC: TColor);
Draw only the outlines of the given text
function GetCtrlPoint(const Ctrl: TControl): TPoint;
function GetCtrlRect(const Ctrl: TControl): TRect;
This function will give the rect measure in screen mode} {ClientToScreen only give Point of its parent control Compare the Right/Bottom kepp the Big ones
function MergeRect(R : array of TRect): TRect;
Merge rectangles to one pieceensure that font.color is Black.
procedure MultiClipPaint(Dest : TCanvas; Src : TBitmap; Area, Clip : TRect);
Like multipaint but this can work out the Clipping area
so you dont need to refresh the whole area when repaint,
simply by send Canvas.ClipRect.
procedure MultiPaint(Dest : TCanvas; Src : TBitmap; Area : TRect);
Paint Tiled "Src" in "Dest"
Area indicates the painting rectangle -- Delphi 2.0 or C++ Builder
procedure PaintOnMask(Dest: TCanvas; X,Y : Integer; XMask, Bmp: TBitmap);
procedure PaintOnText(Dest: TCanvas; X,Y : Integer; Text: String; Bmp: TBitmap);
Some functions that will make you a nice text } { Paint bitmaps on text
Font can be modified before send the Canvas.
the size of your program.
procedure ReadPixels(Src: TBitmap; ReadProcs: TReadPixelProcs);
procedure ReadText(Canvas: TCanvas; Text: String; ReadProcs: TReadPixelProcs);
Use canvas so you send the font together.
procedure RoundButton(Canvas : TCanvas; Size : TRect;
ButtonColor, SeatColor : TColor; SWidth : Integer );
Draw a rounded buttonClear the area with backcolor
procedure SetSize(Bitmap: TBItmap; W, H: Integer);
Set the size of bitmap rather than Width :=, Height :=.
procedure SmoothBlt(Canvas: TCanvas; X, Y: Integer; Bmp: TBitmap; Trans: TColor);
procedure StretchPaintOnMask(Dest: TCanvas; X,Y : Integer; XMask, Bmp: TBitmap);
Paint bitmaps on the mask.
the mask must be monochrome.
procedure StretchPaintOnText(Dest: TCanvas; X,Y : Integer; Text: String; Bmp: TBitmap);
Stretch the bitmap to fit on the text.
procedure TextSmooth(Canvas: TCanvas; X, Y: Integer; Text: String);
Not in Image area, becase the size
procedure TransBlt(Dest : TCanvas; Bmp : TBitmap;
destX, destY : Integer);
One parameter ignored, TransColor is the first pixel of your bitmap
function TransColor(Bmp: TBitmap): TColor;
procedure TransparentBlt (Dest : TCanvas; Bmp : TBitmap;
destX, destY : Integer; TransColor : TColor);
Paint transparent "Bmp" on the "Dest"Deallocate system resources.
TReadPixelProcs = procedure (Color: TColor)
Read Text Pixels