// Einige werden
das Problem kennen. Wenn man mit der // -------------------- Allgemein ------------------ uses SynGdiPlus; procedure TForm1.FormCreate(Sender: TObject); begin Gdip := nil; Gdip.RegisterPictures(false); // false = kein Gif end; // -------------- Anwendungsbeispiele --------------- procedure TForm1.Button1Click(Sender: TObject); begin Image1.Picture.LoadFromFile('C:\test.png'); Image2.Picture.LoadFromFile('C:\test.tif'); Image3.Picture.LoadFromFile('C:\test.jpg'); end; procedure TForm1.Button2Click(Sender: TObject); var syn: TSynPicture; begin syn := TSynPicture.create; syn.LoadFromFile('C:\test.png'); canvas.draw(10, 10, syn); syn.LoadFromFile('C:\test.tif'); canvas.draw(210, 10, syn); syn.LoadFromFile('C:\test.jpg'); canvas.draw(410, 10, syn); syn.free; end; procedure TForm1.Button3Click(Sender: TObject); var jp: TJpegImage; pn: TPngImage; tf: TTiffImage; begin pn := TPngImage.create; pn.LoadFromFile('C:\test.png'); canvas.draw(10, 10, pn); pn.free; tf := TTiffImage.create; tf.LoadFromFile('C:\test.tif'); canvas.draw(210, 10, tf); tf.free; jp := TJpegImage.create; jp.LoadFromFile('C:\test.jpg'); canvas.draw(410, 10, jp); jp.free; end; procedure TForm1.Button4Click(Sender: TObject); var jp: TJpegImage; pn: TPngImage; tf: TTiffImage; bm: TBitmap; sn: TSynPicture; fs: TFilestream; begin bm := TBitmap.create; bm.LoadFromFile('C:\test.bmp'); pn := TPngImage.create; pn.assign(bm); pn.SaveToFile('C:\dbr.png'); pn.free; tf := TTiffImage.create; tf.assign(bm); tf.SaveToFile('C:\dbr.tif'); tf.free; jp := TJpegImage.create; jp.assign(bm); jp.SaveToFile('C:\dbr.jpg'); jp.free; sn := TSynPicture.create; sn.assign(bm); fs := TFilestream.create('C:\versuch.png', fmcreate); sn.saveas(fs, gptPNG); fs.free; fs := TFilestream.create('C:\versuch.tif', fmcreate); sn.saveas(fs, gptTIF); fs.free; fs := TFilestream.create('C:\versuch.jpg', fmcreate); sn.saveas(fs, gptJPG, ); fs.free; sn.free; bm.free; end; |
Zugriffe seit 6.9.2001 auf Delphi-Ecke