亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? transcanvas.pas

?? 這部分與維生素D3
?? PAS
?? 第 1 頁 / 共 2 頁
字號:
unit TransCanvas;
{
	TTransCanvas By Paul van Dinther Copyright Diprode 24-01-2000
	e-mail: paul@diprode.com
	Website: http://www.diprode.com

	Having strugled for a while with several methods to display a semi transparent
	area, I thought it would be usefull to encapsulate the whole thing into a
	component. TransCanvas is similar to TPaintBox and would make a great control
	to inherit from to create other semi transparent controls. TTransCanvas
	controls can quite happily be stacked on top of each other with each level
	clearly visible.

	Just set the Transparency type to ttAlpha and set the transparency percentage
	(0 to 100) and presto. The Graphic controls (be aware that windowed controls
	such as buttons are always on top of Graphic controls) behind TTransCanvas
	show through!.

	Transparency types are:

	ttnone		Is like having a transparent canvas to start with.
	ttKey			Key color transparency. to be used with TransKeyColor
	ttAlpha		Full range of transparency from 0 percent to 100
	ttRed			Red Screening. More red means more transparent.
	ttGreen   Green Screening. More red means more transparent.
	ttBlue		Blue Screening. More red means more transparent.

	Note: The last 3 types are slower to render because additional calculations
	are performed for each pixel. Still pretty fast though.

	Use ScreenBiasPercent to improve the Bluescreening effect.The result is often
	a better blue screen effect because it reduces transperency even more in
	colors that are less that 100% blue. (Try it!)
}

interface

uses
	Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
	extctrls, math;
type
	TRGB = record
	R,G,B: Word;
end;

type
	TCalcEvent = procedure (Sender: TObject; ForeColor,BackColor:TRGB; var MergeColor: TRGB; X,Y: Integer) of object;
	TPaintEvent =  procedure (Sender: TObject; Canvas: TCanvas) of object;
	TCanvasType = (ctTransparent, ctLumFilter);
	TTransFade = (tfNone,tfLeft,tfRight,tfUp,tfDown,tfLeftDown,tfRightDown,tfLeftUp,tfRightUp,tfCenter,tfPeak, tfHorizon, tfVertical, tfButton, tfRoundButton);
	TTransType = (ttNone,ttKey,ttAlpha,ttRed,ttGreen,ttBlue);
	TCustomTransCanvas = class(TGraphicControl)
	private
		FCanvasType: TCanvasType;
		FTransBiasPercent: Integer;
		FTransBias: Double;
		FScreenBias: Double;
		FScreenBiasPercent: Integer;
		FTransFade: TTransFade;
		FOnCalc: TCalcEvent;
		FUseCalcEvent: Boolean;
		FonPaint: TPaintEvent;
		FTransMinCutoff: Integer;
		FTransMaxCutoff: Integer;
		FInverse: Boolean;
		FTransType: TTransType;
		FTransPercent: Integer;
		FTransKeyColor: TColor;
		FBackground :TBitmap;
		FTransBand: Integer;
		procedure CanvasToBitmap;
		procedure SetCanvasType(Value : TCanvasType);
		procedure SetScreenBiasPercent(Value: Integer);
		procedure SetTransBiasPercent(Value: Integer);
		function bias(PValue,PBias: Double):Double;
		procedure SetTransFade(Value: TTransFade);
		procedure SetTransBand(Value: Integer);
		procedure SetTransMinCutoff(Value: Integer);
		procedure SetTransMaxCutoff(Value: Integer);
		procedure SetInverse(Value: Boolean);
		procedure SetTransType(Value: TTransType);
		procedure SetTransPercent(Value: Integer);
		procedure SetTransKeyColor(Value: TColor);
		procedure PaintTransArea;
	protected
		procedure paint; override;
		procedure DoPaint(PCanvas: TCanvas); virtual;
		function CalculateTransFade(PX,PY: Integer; PTransPercent: Integer): Integer;
		property CanvasType: TCanvasType read FCanvasType write SetCanvasType;
		property TransBiasPercent: Integer read FTransBiasPercent write SetTransBiasPercent;
		property ScreenBiasPercent: Integer read FScreenBiasPercent write SetScreenBiasPercent;
		property TransFade: TTransFade read FTransFade write SetTransFade;
		property TransBand: Integer read FTransBand write SetTransBand;
		property UseCalcEvent: Boolean read FUseCalcEvent write FUseCalcEvent;
		property OnCalc: TCalcEvent read FOnCalc write FOnCalc;
		property TransType: TTransType read FTransType write SetTransType;
		property TransPercent: Integer read FTransPercent write SetTransPercent;
		property TransMinCutoff: Integer read FTransMinCutoff write SetTransMinCutoff;
		property TransMaxCutoff: Integer read FTransMaxCutoff write SetTransMaxCutoff;
		property TransKeyColor: TColor read FTransKeyColor write SetTransKeyColor;
		property Inverse: Boolean read FInverse write SetInverse;
		property OnPaint: TPaintEvent read FOnPaint write FOnPaint;
	public
		procedure Refresh;
		constructor Create(AOwner: TComponent); override;
		destructor Destroy; override;
	end;

	{TTransCanvas}
	TTransCanvas = class(TCustomTransCanvas)
	published
		//New Properties
		property CanvasType;
		property UseCalcEvent;
		property OnCalc;
		property TransFade;
		property TransType;
		property TransPercent;
		property TransMinCutoff;
		property TransMaxCutoff;
		property TransKeyColor;
		property ScreenBiasPercent;
		property TransBiasPercent;
		property Inverse;
		property OnPaint;
		//Standard Properties
		property Align;
		property Color;
		property DragCursor;
		property DragMode;
		property Enabled;
		property Font;
		property ParentColor;
		property ParentFont;
		property ParentShowHint;
		property PopupMenu;
		property ShowHint;
		property Visible;
		property OnClick;
		property OnDblClick;
		property OnDragDrop;
		property OnDragOver;
		property OnEndDrag;
		property OnMouseDown;
		property OnMouseMove;
		property OnMouseUp;
		property OnStartDrag;
	end;

procedure Register;

implementation

procedure Register;
begin
	RegisterComponents('Diprode', [TTransCanvas]);
end;

constructor TCustomTransCanvas.Create(AOwner: TComponent);
begin
	inherited Create(AOwner);
	//Setting of the default values
	FTransType := ttNone;
	FBackground := TBitmap.Create;
	FBackground.PixelFormat := pf24Bit;
	FTransPercent := 50;
	FCanvasType := ctTransparent;
	FTransMaxCutoff := 100;
	Width := 50;
	Height := 50;
end;

destructor TCustomTransCanvas.Destroy;
begin
	FBackGround.Free;
	inherited Destroy;
end;

procedure TCustomTransCanvas.CanvasToBitmap;
var
	LPoint: Tpoint;
	HDC: Integer;
	function Min(PValue1,PValue2:Integer): Integer;
	begin
		if PValue1 <= PValue2 then Result := PValue1
		else result := PValue2;
	end;
	function Max(PValue1,PValue2:Integer): Integer;
	begin
		if PValue1 > PValue2 then Result := PValue1
		else result := PValue2;
	end;
begin
	if FBackground.Width <> width then FBackground.Width := Width;
	if FBackground.Height <> Height then FBackground.Height := Height;
	{
		Translate the Top-Left of the control to screen coordinates
		Grab the screen device, take a snapshot and copy the picture accross to FBackground
	}
	LPoint := ClientToScreen(point(Left,Top));
	HDC := GetDC(0);
	BitBlt(FBackground.Canvas.Handle,0,0,min(TPanel(parent).Width - Left,Width),min(TPanel(Parent).Height - Top,Height),HDC,LPoint.X - Left,LPoint.Y - Top, SRCCOPY);
	ReleaseDc(0,HDC);
end;

{
	This procedure calculates the resulting bitmap pixel by pixel using the
	foreground and backgound bitmaps. The calculation method depends on the TransType
	property value selected. An onCalc event exposes the calculation to the
	user and let's the user apply it's own merge calculation.
}
procedure TCustomTransCanvas.PaintTransArea;
var
	LWidth,LHeight: Integer;
	FForeground: TBitmap;
	FCombined: TBitmap;
	LLumPercent: Integer;
	LFCol,LBCol,LMCol: TRGB;
	LTransPercent: Integer;
	x,y : Integer;
	LForeScan: PByteArray;
	LBackScan: PByteArray;
	LCombinedScan: PByteArray;
	function CalcPartLum(PValue1,PValue2,Part: Integer): Integer;
	var
		LLum: Integer;
	begin
		if PValue1 = 0 then begin
			LLum := Part - 50;
			if LLum = 0 then Result := PValue2;
			if LLum > 0 then Result := trunc(PValue2 + ((256 - PValue2) * 0.02 * LLum));
			if LLum < 0 then Result := trunc(PValue2 + (PValue2 * 0.02 * LLum));
		end else Result := PValue2;
	end;
	function CalcPartValue(PValue1,PValue2,Part: Integer): Integer;
	begin
		Result := ((PValue1 * (100 - Part)) + (PValue2 * Part)) div 100;
	end;
	function Min(PValue1,PValue2:Integer): Integer;
	begin
		if PValue1 <= PValue2 then Result := PValue1
		else result := PValue2;
	end;
	function Max(PValue1,PValue2:Integer): Integer;
	begin
		if PValue1 > PValue2 then Result := PValue1
		else result := PValue2;
	end;
begin
	//Crate and Adjust bitmaps
	FForeGround := TBitmap.Create;
	FForeGround.PixelFormat := pf24Bit;
	FCombined := TBitmap.Create;
	FCombined.PixelFormat := pf24Bit;
	FForeGround.Width := Width;
	FForeGround.Height := Height;
	FCombined.Width := Width;
	FCombined.Height := Height;
	DoPaint(FForeground.Canvas);
	LHeight := min(FBackground.Height,TPanel(parent).Height - Top);
	LWidth := Min(FBackground.Width, TPanel(parent).Width  - Left);
	if FCanvasType <> ctTransparent then begin
		{
		This procedure modifies the luminosity value of the background pixel in  those
		locations were the foreground pixel is painted. The amount of Luminosity change
		is defined by the FilterFadeType, MinLum and MaxLum properties. Luminosity is
		defined as a value from 0 to 255. Background luminosity is seen as a value of 0
		and the range from that luminosity value to MinLum and MaxLum is always + and - 100
		}
		for y := 0 to LHeight - 1 do	begin
			LForeScan := FForeground.ScanLine[y];
			LBackScan := FBackground.ScanLine[y];
			LCombinedScan := FCombined.ScanLine[y];
			X := 0;
			while X < LWidth * 3 do begin
				LLumPercent := CalculateTransFade(X div 3,Y,FTransPercent);
				if FInverse then LLumPercent := 100 - LLumPercent;
				LCombinedScan[x] := CalcPartLum(LForeScan[X]+LForeScan[X+1]+LForeScan[X+2],LBackScan[X],LLumPercent);
				LCombinedScan[x+1] := CalcPartLum(LForeScan[X]+LForeScan[X+1]+LForeScan[X+2],LBackScan[X+1],LLumPercent);
				LCombinedScan[x+2] := CalcPartLum(LForeScan[X]+LForeScan[X+1]+LForeScan[X+2],LBackScan[X+2],LLumPercent);
				inc(X,3);
			end;
		end
	end	else begin
		LTransPercent := FTranspercent;
		//these two nested For loops using Y and X provide a step through for each pixel
		for y := 0 to LHeight - 1 do
		begin
			LForeScan := FForeground.ScanLine[y];
			LBackScan := FBackground.ScanLine[y];
			LCombinedScan := FCombined.ScanLine[y];
			X := 0;
			//Width * 3 because the internal bitmaps are always 24 Bit (3 Bytes per pixel)
			while X < LWidth * 3 do begin
				if (assigned(FOnCalc)) and FUseCalcEvent then begin
					//Collect the foreground color for this pixel
					LFCol.R := LForeScan[X + 2];
					LFCol.G := LForeScan[X + 1];
					LFCol.B := LForeScan[X];
					//collect the background color for this pixel
					LBCol.R := LBackScan[X + 2];
					LBCol.G := LBackScan[X + 1];
					LBCol.B := LBackScan[X];
					//Call the event handler
					FOnCalc(self,LFCol,LBCol,LMCol,X,Y);
					//Assign the merged result to the scanline pixel of the destination
					LCombinedScan[X+2] := LMCol.R;
					LCombinedScan[X+1] := LMCol.G;
					LCombinedScan[X] := LMCol.B;
				end else begin
					Case FTransType of
						ttNone:
							LTransPercent := FTransPercent;
						ttKey:
							begin
							if FForeGround.Canvas.Pixels[x div 3,y] = FTransKeyColor then LTransPercent := 100
							else LTransPercent := FTransPercent;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品不卡在线| 欧美一卡二卡三卡四卡| 欧美国产精品v| 成人性生交大片免费| 国产精品青草综合久久久久99| 韩国女主播一区| 欧美国产精品v| 日本韩国欧美三级| 日本中文字幕一区二区有限公司| 欧美一区二区视频在线观看| 韩国一区二区视频| 国产精品国产自产拍高清av王其| 91麻豆精东视频| 三级亚洲高清视频| 国产色综合久久| 欧美午夜理伦三级在线观看| 蜜臀a∨国产成人精品| 久久久精品影视| 色拍拍在线精品视频8848| 石原莉奈一区二区三区在线观看| 欧美一区二区三区免费| 国产黄人亚洲片| 亚洲一区电影777| 日韩美女视频在线| 91视频在线看| 久久99久国产精品黄毛片色诱| 国产精品女主播在线观看| 欧美天天综合网| 国产一区二区三区免费在线观看| 亚洲少妇屁股交4| 日韩免费观看高清完整版| 成人精品电影在线观看| 日本免费新一区视频| 国产精品久久久久aaaa樱花| 欧美日韩综合色| 国产成人午夜电影网| 亚洲18女电影在线观看| 国产欧美日产一区| 91精品国产综合久久婷婷香蕉| 国产91丝袜在线18| 日韩电影在线观看网站| 亚洲视频一二三区| 久久尤物电影视频在线观看| 欧美色手机在线观看| 成a人片亚洲日本久久| 美腿丝袜在线亚洲一区| 一区二区三区毛片| 亚洲国产美女搞黄色| 国产欧美日韩综合| 日韩三级在线免费观看| 欧美唯美清纯偷拍| www.欧美色图| 国产成人免费视频网站| 日本欧美一区二区在线观看| 一区二区在线看| 中文成人综合网| 久久理论电影网| 欧美成人猛片aaaaaaa| 欧美猛男gaygay网站| 色婷婷久久久亚洲一区二区三区 | 国产老妇另类xxxxx| 亚洲aaa精品| 亚洲综合一区二区精品导航| 国产精品灌醉下药二区| 国产日产精品1区| 久久久久久久久97黄色工厂| 日韩一级视频免费观看在线| 欧美日韩久久一区| 欧美体内she精高潮| 在线视频一区二区免费| 91小视频免费观看| 91小视频免费观看| 91免费小视频| 一本大道av一区二区在线播放| 波多野洁衣一区| 99精品视频中文字幕| 91在线看国产| 日本伦理一区二区| 在线观看中文字幕不卡| 欧美专区亚洲专区| 欧美性猛交一区二区三区精品| 色成年激情久久综合| 色播五月激情综合网| 欧美日韩在线不卡| 欧美群妇大交群中文字幕| 欧美另类久久久品| 日韩一区二区三区视频| 日韩欧美一级二级三级| 久久久五月婷婷| 国产精品欧美极品| 一区二区高清在线| 日韩精品三区四区| 韩国成人精品a∨在线观看| 国产精品99久久久久久宅男| av在线播放不卡| 在线免费不卡视频| 91精品国产麻豆国产自产在线| 欧美精品三级在线观看| 精品国产一区二区精华| 亚洲国产成人一区二区三区| 亚洲视频香蕉人妖| 日韩主播视频在线| 国内精品视频666| 97aⅴ精品视频一二三区| 欧洲av在线精品| 日韩欧美亚洲一区二区| 国产精品免费看片| 亚洲国产毛片aaaaa无费看| 久久99国产精品成人| 不卡影院免费观看| 欧美巨大另类极品videosbest| 久久综合九色综合欧美就去吻| 国产精品久久久久久久久免费樱桃 | 日本在线不卡一区| 国产成人在线影院 | 国产成人免费在线| 色呦呦一区二区三区| 日韩一级高清毛片| 亚洲特级片在线| 久久99国产乱子伦精品免费| av亚洲产国偷v产偷v自拍| 欧美一区日韩一区| 中文字幕一区二区三区在线观看| 日韩高清不卡在线| 波多野结衣亚洲| 欧美va亚洲va香蕉在线| 亚洲欧美成人一区二区三区| 国内精品嫩模私拍在线| 欧美性高清videossexo| 国产免费久久精品| 免费观看久久久4p| 色爱区综合激月婷婷| 国产日本一区二区| 免费看日韩a级影片| 色激情天天射综合网| 久久久久久久av麻豆果冻| 五月综合激情网| 91丨九色丨尤物| 久久久精品国产99久久精品芒果| 五月婷婷综合激情| 99re成人精品视频| 国产日韩精品一区| 韩国视频一区二区| 欧美一区二区在线免费观看| 一区二区高清免费观看影视大全 | 国产欧美日韩三级| 韩国v欧美v亚洲v日本v| 正在播放亚洲一区| 亚洲一卡二卡三卡四卡五卡| av在线播放不卡| 国产精品国产三级国产aⅴ原创| 狠狠狠色丁香婷婷综合久久五月| 欧美日韩国产高清一区二区| 玉足女爽爽91| 97久久超碰国产精品| 国产精品久久看| 成人综合婷婷国产精品久久蜜臀| 26uuu精品一区二区三区四区在线 26uuu精品一区二区在线观看 | 欧美三级中文字幕| 一个色综合av| 欧美亚洲动漫精品| 一二三四社区欧美黄| 91浏览器打开| 一区二区三区在线播放| 99久久99久久免费精品蜜臀| 国产精品夫妻自拍| 91美女在线看| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 成人av网址在线| 国产精品国产三级国产a| 99久久婷婷国产精品综合| 亚洲欧洲日韩av| 在线精品亚洲一区二区不卡| 一区二区理论电影在线观看| 欧美日韩一区中文字幕| 天堂蜜桃91精品| 91精品国产色综合久久不卡蜜臀| 天堂va蜜桃一区二区三区| 欧美一卡二卡在线| 国产一区二区福利视频| 欧美国产1区2区| 91毛片在线观看| 日日夜夜精品视频免费| 日韩欧美国产综合一区 | 91精品在线观看入口| 麻豆成人免费电影| 国产日韩欧美麻豆| 午夜精品123| 国产一区在线视频| 一级中文字幕一区二区| 久久精品99国产精品日本| 久久新电视剧免费观看| 不卡的看片网站| 一区二区三区高清| 日韩美女视频一区二区在线观看| 国产精品一区二区果冻传媒| 综合久久久久久| 69堂亚洲精品首页| 国产大陆精品国产| 亚洲一区在线观看免费观看电影高清 |