warum eigentlich stretchdraw?
Delphi-Quellcode:
//initialization
uses jpeg;
function JPGToBMP(jpgImg: TJPEGImage): TBitmap; overload;
function JPGToBMP(jpgFile: string): TBitMap; overload;
//implementation
function JPGToBMP(jpgImg: TJPEGImage): TBitmap;
begin
Result := TBitmap.Create;
with Result do
begin
Width := jpgImg.Width;
Height := jpgImg.height;
Canvas.Draw(0,0,jpgImg);
end;
end;
function JPGToBMP(jpgFile: string): TBitMap;
var jpgImg: TJPEGImage;
begin
jpgImg := TJPEGImage.Create;
jpgImg.LoadFromFile(jpgFile);
Result := JPGToBMP(jpgImg);
//nur zur sicherheit
jpgImg.Free;
end;
EDIT: Vervollständigt... wer will, kanns gerne für die codelib vorschlagen
Lukas Erlacher
Suche Grafiktablett. Spenden/Gebrauchtangebote willkommen.
Gotteskrieger gesucht!
For it is the chief characteristic of the religion of science that it works. - Isaac Asimov, Foundation I, Buch 1