我使用3個半透明tImage3D創建FireMonkey應用程序。 這是代碼和屏幕。一切似乎都很好。Firemonkey半透明Image3D有時是不透明的
procedure TForm1.Form3DCreate(Sender: TObject);
// create a new semi-transparent timage3d
// object with color and Z position.
procedure NewImage (const nColor : tColor;
const nZ : integer);
begin
// create the image
with tImage3D . Create (self) do
begin
// put it on the screen
Parent := self;
// set the size
Width := 10;
Height := 10;
// set the image to a single pixel.
Bitmap . Width := 1;
Bitmap . Height := 1;
// set the Alpha to $80 to make it
// semi-transparent
Bitmap . Pixels [ 0, 0 ] := $80000000 + nColor;
// set the z position
Position . Z := nZ;
end;
end;
begin
NewImage (claRed, +10);
NewImage (claGreen, 0);
NewImage (claBlue, -10);
end;
現在顛倒順序。現在它們是不透明的。
begin
NewImage (claRed, -10);
NewImage (claGreen, 0);
NewImage (claBlue, +10);
end;
我缺少什麼?
顯然,一個對象對前面創建的對象只是半透明的。如果那有意義的話。紅色框呈現爲粉紅色,因爲儘管可以看到白色背景,但您無法通過它看到綠色或藍色框。通過綠色框,你可以看到白色背景和紅色框,但不是藍色框。我也有同樣的事情與text3d對象發生。 – 2011-12-14 00:22:12