![]() |
tbitmap kann nur bmp
hallo erstmal.
wie lade ich denn z.b. jpegs in ein tbitmap wenn das geht. und wenn nicht bitte eine komponente anbieten, die auch bmp kann. wie man meinem programm ![]() bitte um hilfe :pale: |
Re: tbitmap kann nur bmp
Installier Dir die JVCL ;)
|
Re: tbitmap kann nur bmp
Musst du gar nicht!
Delphi-Quellcode:
Edit:
jpeg:=TJPEGImage.Create;
try jpeg.LoadFromFile(Filename); bmp:=TBitmap.Create; try bmp.Assign(jpeg); bmp.SaveToFile('blabla.bmp')); finally bmp.free; end; finally jpeg.free; end; Oops falsch herum :lol:
Delphi-Quellcode:
uses jpeg;
... Jpg:=TJpegImage.Create; try Jpg.CompressionQuality:=88; Jpg.Assign(bmp2); Jpg.SaveToFile('deinjpeg.jpg'); finally jpg.free; |
Re: tbitmap kann nur bmp
Wenn es Dir nur um das Laden der anderen Format geht, würde ich Dir die Unit "GraphicEx" empfehlen:
![]() |
Re: tbitmap kann nur bmp
Oder die Unit GIFImage, ich hab nur leider gerade keinen Link parat.
|
Re: tbitmap kann nur bmp
Zitat:
Ansonsten: Danke, ich seh mal wie es klappt ;-) |
Re: tbitmap kann nur bmp
Eine TBitmap kann wirklich nur BMP. Man braucht ein TPicture um verschiedene Formate handhaben zu koennen.
Aus der Delphi-Hilfe: "TPicture is a TGraphic container, used to hold a graphic, the type of which is specified in the Graphic property. It is used in place of a TGraphic if the graphic can be of any TGraphic class. LoadFromFile and SaveToFile are polymorphic." TGraphic-Formate kann man nachinstallieren. Die JVCL macht das z. B. fuer .ani-Cursors und fuer .gif. |
Re: tbitmap kann nur bmp
Zitat:
|
Re: tbitmap kann nur bmp
Zitat:
|
Re: tbitmap kann nur bmp
Zitat:
|
Re: tbitmap kann nur bmp
TBitmap ist eine Klasse für Bitmaps. Es wäre schlimm wenn TBitmap autos und flugzeuge laden könnte. TBitmap ist wie der Name schon sagt für Bitmaps.
|
Re: tbitmap kann nur bmp
das wollt ich gar nicht wissen aber egal.
|
Re: tbitmap kann nur bmp
Habe eben länger gesucht und die Lösung ist wirklich ganz einfach:
Einfach die Unit Jpeg mit einbinden und das Öffnen von .bmp UND .jpg funktioniert perfekt...
Delphi-Quellcode:
Stahli
uses
Jpeg; // !!! {$R *.dfm} procedure TFormSpielerBildDefinieren.BitBtnSpielerBildDateiOeffnenClick( Sender: TObject); begin if (OpenPictureDialog1.Execute) then begin Image1.Picture.LoadFromFile(OpenPictureDialog1.FileName); end; end; |
Re: tbitmap kann nur bmp
danke
|
Alle Zeitangaben in WEZ +1. Es ist jetzt 18:10 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz