?? readme.txt
字號(hào):
Contents of Translib.zip
readme.txt (This text file)
TransCanvas.dcr (Pallete Icon)
TransCanvas.pas (source)
TransImage.dcr (Pallete Icon)
TransImage.pas (source)
TransLabel.dcr (Pallete Icon)
TransLabel.pas (source)
TransShape.dcr (Pallete Icon)
TransShape.pas (source)
This component works with D3,D4 and D5
Translib is based on the baseclass TCustomTransCanvas. This class is capable to render its canvas semi transparent. The transparency is controlled by a range of parameters giving a high level of control over the output.
TransCanvas creates an internal bitmap of the area just behind the control. Paint instructions to the controls Canvas are then applied onto the background using several computations to create the transparency effects.
a special event OnCalc is exposed to allow you to provide your own transparency calculation algorythms / effects.
This library was developped for GIFLine Pro. Download GIFLine Pro if you would like to see these components in action. Visit http://www.diprode.com/giflinepro.htm
Copyrights
This library is made available as is. Use it for Commercial or noncommercial applications. This source code may not be used for the creation of commercial components!
Copyright Diprode June 2000
Below an overview of the additional transparency properties:
Properties:
property CanvasType: TCanvasType read FCanvasType write SetCanvasType;
Use this property to use the component as a luminosity filter simply processing whatever is behind it or as a canvas to paint on.
Possible values:
ctTransparent
The default mode of use. You can paint to the controls canvas and have the canvas rendered accrding the transparency parameters
ctLumFilter:
To use the component as a Luminosity Filter. Only the areas on the canvas with color clBlack will act as a filter. other pixel colors will not affect the luminosity of the underlying area.
property TransBiasPercent: Integer read FTransBiasPercent write SetTransBiasPercent;
Used in combination with TransFade effects. Most build in transfade effects use the pixel position to modify their transparency. For example when tfRight is used the far left pixel is rendered at 0 % transparency were as the most right pixel will be fully transparent. The pixels in between will have a transparency related to their x position. TransBiasPercent changes this linear relationship (TransBiasPercent = 0) to a non linear relationship. Great property to control the gradient of the transparency change.
property ScreenBiasPercent: Integer read FScreenBiasPercent write SetScreenBiasPercent;
Used in combination with the Blue, Green or Red Screening effect. Possible values range from -100 to 100. This property allows control over how the amount of screen color in a pixel affects the transparency of the pixel.
property TransFade: TTransFade read FTransFade write SetTransFade;
The transface effect will apply a different transparency value to every pixel depending of the selected effect and position of the pixel. The following effects are build into the component:
tfNone : No Transfade effect is applied
tfLeft : Left Pixels are Transparent. Right Pixels are not
tfRight : Right Pixels are Transparent. Left Pixels are not
tfUp : Top pixels are transparent. Bottom pixels are not
tfDown : Bottom Pixels are Transparent. Top pixels are not
tfLeftDown : Left Bottom Pixels are Transparent. Right Top are not
tfRightDown : Right Bottom Pixels are Transparent. Left Top are not
tfLeftUp : Left Top Pixels are Transparent. Right Bottom are not
tfRightUp : Right Top Pixels are Transparent. Right Bottom are not
tfCenter : Pixels away from the center are transparent. In the center are not
tfPeak : Pixels on the edges are transparent. Pixels in the center are not
tfHorizon : Pixels on top and bottom are transparent. In the middele are not
tfVertical : Pixels on Left and Right are transparent. In the middle are not
tfButton : Special button effect algorythm
tfRoundButton : Special round button algorythm
The maximum amount of transparency is controlled by the TransPercent property.
property UseCalcEvent: Boolean read FUseCalcEvent write FUseCalcEvent;
Turns the calling of the calc event on or off.
property OnCalc(Sender: TObject; ForeColor,
BackColor: TRGB; var MergeColor: TRGB; X, Y: Integer);
This event is raised for each pixel. It provides the Background pixel color in BackColor and the Foreground pixel color in ForeColor. You may apply any calculation you like in combining the two pixel colors and store the resulting color in MergeColor. this color is ten painted to the canvas.
The X and Y value indicate which pixel is being processed allowing you to write your own effect routines
property TransType: TTransType read FTransType write SetTransType;
The canvas can be of different transparency types. These are:
ttNone : No transparency is being applied at all (May as well use TPaintBox)
ttKey : Makes the pixels mathing the TransKey Color transparent
ttAlpha : Every pixel in the canvas is rendered transparent
ttRed : The amount or Red in a pixels defines the transparency
ttGreen : The amount or Green in a pixels defines the transparency
ttBlue : The amount or Blue in a pixels defines the transparency
The amount of transparency applied depends on the TransPercent property
property TransPercent: Integer read FTransPercent write SetTransPercent;
This property defines the maximum transparency that can be applied to a pixel. Values range from 0 to 100 percent. The actual transparency of the pixel will also depend on the Transfade effects and TransType properties
property TransMinCutoff: Integer read FTransMinCutoff write SetTransMinCutoff;
Used in conjuction with the Screening (TransType: ttRed, ttGree, ttBlue) the property can apply a cutoff point. this means that any transparency value for a pixel below the given value will be made 0 transparent (opaque)
property TransMaxCutoff: Integer read FTransMaxCutoff write SetTransMaxCutoff;
Used in conjuction with the Screening (TransType: ttRed, ttGree, ttBlue) the property can apply a cutoff point. this means that any transparency value for a pixel above the given value will be made 100 transparent
property TransKeyColor: TColor read FTransKeyColor write SetTransKeyColor;
Used in conjunction with the ttKey transtype. Any pixel matching this color will be rendered transparent according the TransPercent property.
property Inverse: Boolean read FInverse write SetInverse;
Inverses the Transparency value for each pixel.
property OnPaint: TPaintEvent read FOnPaint write FOnPaint;
Like the TPaintBox onPaint event except that this event exposes a special canvas on which to draw.
Installation Instructions.
Copy the pas and dcr files to your library directory.
Start Delphi.]
Select 'Component' - 'Install Component' and so on.
All components get installed onto the pallette under the Diprode tab
Send me an e-mail if you have any questions
paul@diprode.com
The latest version are always on http://www.diprode.com
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -