J
jibi
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TMainForm.CreatePal();
var
Pal: HPalette;
i: Integer;
lplogpal: pmaxLogPalette;
pal2: array[0..255] of TPaletteEntry;
begin
GetMem(lplogpal, sizeof(TLOGPALETTE) + (255 * sizeof(TPALETTEENTRY)));
lplogpal.palVersion := $300;
lplogpal.palNumEntries := 256;
for i := 0 to 255 do
begin
lplogpal.palPalEntry.peRed := 255;
lplogpal.palPalEntry.peGreen := 255;
lplogpal.palPalEntry.peBlue := 255;
end;
Pal := CreatePalette(pLogPalette(lplogpal)^);
FreeMem(lplogpal, sizeof(TLOGPALETTE) + (255 * sizeof(TPALETTEENTRY)));
GetPaletteEntries(Pal, 0, 256, pal2);//这里不成功
end;
var
Pal: HPalette;
i: Integer;
lplogpal: pmaxLogPalette;
pal2: array[0..255] of TPaletteEntry;
begin
GetMem(lplogpal, sizeof(TLOGPALETTE) + (255 * sizeof(TPALETTEENTRY)));
lplogpal.palVersion := $300;
lplogpal.palNumEntries := 256;
for i := 0 to 255 do
begin
lplogpal.palPalEntry.peRed := 255;
lplogpal.palPalEntry.peGreen := 255;
lplogpal.palPalEntry.peBlue := 255;
end;
Pal := CreatePalette(pLogPalette(lplogpal)^);
FreeMem(lplogpal, sizeof(TLOGPALETTE) + (255 * sizeof(TPALETTEENTRY)));
GetPaletteEntries(Pal, 0, 256, pal2);//这里不成功
end;