![]() |
Probleme mit Bildgrößen bei Konvertierung zu Wmf
Hallo,
ich habe drei funktions, die von Bmp, Jpg oder Ico zu wmf konvertieren gestern hat ein freund festgestellt, dass die Bilder als wmf von der skalierung kleiner sind als die originale weiss jemand warum? hier mal die drei funktions als Code:
Code:
mfg
procedure BmpToWmf(BitmapFile, WmfFile: TFileName);
var MetaFile: TMetaFile; MFCanvas: TMetaFileCanvas; Bitmap: TBitmap; begin try Bitmap := TBitmap.Create; MetaFile := TMetaFile.Create; with Bitmap do begin LoadFromFile(BitmapFile); MetaFile.Height := Height; MetaFile.Width := Width; end; MFCanvas := TMetafileCanvas.Create(MetaFile, 0); try MFCanvas.Draw(0, 0, Bitmap); finally MFCanvas.Free; end; MetaFile.SaveToFile(WmfFile); finally MetaFile.Free; Bitmap.Free; end; end; procedure JpgToWmf(JPEGFile, WmfFile: TFileName); var MetaFile: TMetaFile; MFCanvas: TMetaFileCanvas; Bitmap: TBitmap; JpgImage: TJPEGImage; begin try JpgImage := TJPEGImage.Create; Bitmap := TBitmap.Create; MetaFile := TMetaFile.Create; with JpgImage do begin CompressionQuality := 100; {Standard-Wert} LoadFromFile(JPEGFile); end; with Bitmap do begin Assign(JpgImage); MetaFile.Height := Height; MetaFile.Width := Width; end; MFCanvas := TMetafileCanvas.Create(MetaFile, 0); try MFCanvas.Draw(0, 0, Bitmap); finally MFCanvas.Free; end; MetaFile.SaveToFile(WmfFile); finally MetaFile.Free; Bitmap.Free; JpgImage.Free; end; end; procedure IcoToWmf(IconFile, WmfFile: TFileName); var MetaFile: TMetaFile; MFCanvas: TMetaFileCanvas; Bitmap: TBitmap; Icon: TIcon; begin try Icon := TIcon.Create; Bitmap := TBitmap.Create; MetaFile := TMetaFile.Create; Icon.LoadFromFile(IconFile); with Bitmap do begin Height := Icon.Height; Width := Icon.Width; Canvas.Draw(0, 0, Icon); MetaFile.Height := Height; MetaFile.Width := Width; end; MFCanvas := TMetafileCanvas.Create(MetaFile, 0); try MFCanvas.Draw(0, 0, Bitmap); finally MFCanvas.Free; end; MetaFile.SaveToFile(WmfFile); finally MetaFile.Free; Bitmap.Free; Icon.Free; end; end; Helmi |
Re: Probleme mit Bildgrößen bei Konvertierung zu Wmf
***Update***
weiss jemand warum das oben so ist? |
Alle Zeitangaben in WEZ +1. Es ist jetzt 03:25 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