Registriert seit: 8. Mai 2005
Ort: Sondershausen
4.274 Beiträge
Delphi 6 Personal
|
AW: 15Bit RGB in TBitmap32 konvertieren
8. Mai 2011, 07:59
Delphi-Quellcode:
procedure Load15BitPicFromRawFile(Filename: String; W, H: integer;
DestBitmap32: TBitmap32; PosX, PosY: integer);
var
i: Integer;
b: Word;
P: PColor32;
begin
with TMemoryStream.Create do
try
LoadFromFile(Filename);
Position := 0;
with TBitmap32.Create do
try
SetSize(W, H);
P := PixelPtr[0, 0];
for i := 0 to Width * Height - 1 do
begin
ReadBuffer(b, 2);
P^ := $FF000000 or (b and $7C00 shr 7) or (b and $3E0 shr 2) or (b and $1F shl 3);
Inc(P);
end;
DrawTo(DestBitmap32, PosX, PosY);
finally
Free;
end;
finally
Free;
end;
end;
Oder so ?
Geändert von turboPASCAL ( 8. Mai 2011 um 08:13 Uhr)
|