Einzelnen Beitrag anzeigen

Benutzerbild von Helmi
Helmi

Registriert seit: 29. Dez 2003
Ort: Erding, Republik Bayern
3.312 Beiträge
 
Delphi XE2 Professional
 
#16

AW: nach StretchBlt schwarzer Hintergrund

  Alt 25. Feb 2015, 14:37
Klappt denn dein ursprünglicher Code wenn du Pixelformat auf pf32Bit stellst?
Hab nämlich letztens noch genau das selbe gemacht und das hat funktioniert.
Leider nein

Ich hab alle drei Bitmaps (Bitmap, Temp_Bitmap, Copy_Bitmap) mal testweise auf pf32Bit gesetzt, aber ohne Verbesserung des Problemes

[edit]
Ich glaub ich weiss wo das Problem ist
Der schwarze Hintergrund ist schon im Original-Bitmap vorhanden

Das Original-Bitmap beinhaltet ein Icon

Test-Code:
Delphi-Quellcode:
procedure TForm3.Button2Click(Sender: TObject);
var
  S: String;
  Bitmap: TBitmap;
  Icon: TIcon;

begin
  S := ExtractFilePath(Application.ExeName);

  Bitmap := TBitmap.Create;
  Icon := TIcon.Create;

  try
// Bitmap.LoadFromFile(S + 't.bmp');

    Icon.Handle := ExtractIcon(Application.Handle, PChar(Application.ExeName), 0);

    Icon.SaveToFile(S + 'test.ico');

    Bitmap.Assign(Icon);

    Bitmap.SaveToFile(S + 'origtest.bmp');

    Scale_Bitmap(Bitmap, 100, 200, true);

    Bitmap.SaveToFile(S + 'test.bmp');
  finally
    Bitmap.Free;
    Icon.Free;
  end;
end;
Schon origtest.bmp hat den schwarzen Hintergrund
mfg
Helmi

>> Theorie ist Wissen, dass nicht funktioniert - Praxis ist, wenn alles funktioniert und keiner weiss warum! <<

Geändert von Helmi (25. Feb 2015 um 14:54 Uhr)
  Mit Zitat antworten Zitat