M
Miros
Unregistered / Unconfirmed
GUEST, unregistred user!
如下代码放到Form的OnPaint上,
我看到的是红色的背景,蓝色的矩形。(2台电脑测试都相同)
procedure TForm1.FormPaint(Sender: TObject);
var
pColor: PDWord;
I : Integer;
begin
Color := $000000FF;//红色
with TBitmap.Create do
begin
PixelFormat := pf32bit;
Width := 256;
Height:= 256;
pColor := ScanLine[Height - 1];
ZeroMemory( pColor, Width * Height * 4 );
for I := 0 to Width * Height - 1 do
begin
pColor^:= $000000FF;//注意是还是红色,可是为什么我看到的是蓝色???
Inc( pColor );
end;
BitBlt( Self.Canvas.Handle, 0, 0, Width, Height, Canvas.Handle, 0, 0, SRCCOPY );
Free();
end;
end;
[][][][][][][][][][]
我看到的是红色的背景,蓝色的矩形。(2台电脑测试都相同)
procedure TForm1.FormPaint(Sender: TObject);
var
pColor: PDWord;
I : Integer;
begin
Color := $000000FF;//红色
with TBitmap.Create do
begin
PixelFormat := pf32bit;
Width := 256;
Height:= 256;
pColor := ScanLine[Height - 1];
ZeroMemory( pColor, Width * Height * 4 );
for I := 0 to Width * Height - 1 do
begin
pColor^:= $000000FF;//注意是还是红色,可是为什么我看到的是蓝色???
Inc( pColor );
end;
BitBlt( Self.Canvas.Handle, 0, 0, Width, Height, Canvas.Handle, 0, 0, SRCCOPY );
Free();
end;
end;
[][][][][][][][][][]