var
testPNG:TImagingBitmap;
X, Y: Integer;
Dest, Src: PByte;
Alpha: Byte;
begin
FLayeredWindow:=TO3LayeredWindow.Create(Form1);
FLayeredWindow.Parent:=Form1;
testPNG:=TImagingBitmap.create;
testPNG.LoadFromFile('..\Images\image_not_working.png');
FLayeredWindow.Surface.Width:=testPNG.Width;
FLayeredWindow.Surface.Height:=testPNG.Height;
FLayeredWindow.Surface.PixelFormat:=pf32Bit;
with FLayeredWindow.Surface do
for Y := 0 to Height - 1 do
begin
Src := testPNG.Scanline[y];
Dest := ScanLine[y];
for X := 0 to Width - 1 do
begin
Alpha := Src[X * 4 + 3];
Dest[X * 4 + 0] := Src[x * 4 + 0] * Alpha div 255;
Dest[X * 4 + 1] := Src[x * 4 + 1] * Alpha div 255;
Dest[X * 4 + 2] := Src[x * 4 + 2] * Alpha div 255;
Dest[X * 4 + 3] := Alpha;
end;
end;
FLayeredWindow.UpdateLayer;
end;
http://communicom.w8w.pl/SampleApps.rar
TestPNG:=TImagingBitmap.Create;
TestPNG.LoadFormFile('Skinwindow.png');
FLayeredWindow.Surface.Width:=Form1.Width;
FLayeredWindow.Surface.Height:=Form1.Height;
FLayeredWindow.Surface.Assign(TestPNG);
FLayeredWindow.UpdateLayer;
FImage2:=TMultiImage.create;
FImage2.loadmultifromfile('Skin\window.png');
FLayeredWindow.Surface.Width:=Form1.Width;
FLayeredWindow.Surface.Height:=Form1.Height;
ImagingComponents.DisplayImage(FLayeredWindow.Surface.Canvas,Rect(0,0,Form1.Width,Form1.Height),Fimage2);
FLayeredWindow.UpdateLayer;
FImage2.Free;
TestPNG:=TPNGObject.Create;
TestPNG.LoadFormFile('Skin\window.png');
FLayeredWindow.Surface.Width:=Form1.Width;
FLayeredWindow.Surface.Height:=Form1.Height;
FLayeredWindow.Surface.Assign(TestPNG);
FLayeredWindow.UpdateLayer;
Page created in 0.012 seconds with 19 queries.