Einzelnen Beitrag anzeigen

Benutzerbild von turboPASCAL
turboPASCAL

Registriert seit: 8. Mai 2005
Ort: Sondershausen
4.274 Beiträge
 
Delphi 6 Personal
 
#10

AW: 15Bit RGB in TBitmap32 konvertieren

  Alt 8. Mai 2011, 06: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 ?
Matti
Meine Software-Projekte - Homepage - Grüße vom Rüsselmops -Mops Mopser

Geändert von turboPASCAL ( 8. Mai 2011 um 07:13 Uhr)
  Mit Zitat antworten Zitat