AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Multimedia Bitmap in TMetafile ausgeben Windows 7
Thema durchsuchen
Ansicht
Themen-Optionen

Bitmap in TMetafile ausgeben Windows 7

Ein Thema von rweinzierl · begonnen am 19. Apr 2012 · letzter Beitrag vom 22. Apr 2012
 
Benutzerbild von Bummi
Bummi

Registriert seit: 15. Jun 2010
Ort: Augsburg Bayern Süddeutschland
3.470 Beiträge
 
Delphi XE3 Enterprise
 
#9

AW: Bitmap in TMetafile ausgeben Windows 7

  Alt 22. Apr 2012, 07:24
folgender Code liefert bei mir unter WIN7 D2010 das erwartete Ergebnis
Delphi-Quellcode:
var
  MyMetafile: TMetafile;
  Bitmap: TBitmap;
  myc: TMetafileCanvas;

begin
  MyMetafile := TMetafile.Create;
  Bitmap := TBitmap.Create;
  try
    MyMetafile.Width := 200;
    MyMetafile.Height := 200;
    Bitmap.Width := 100;
    Bitmap.Height := 100;
    Bitmap.Canvas.pen.Color := clRed;
    Bitmap.Canvas.pen.Width := 2;
    Bitmap.Canvas.Ellipse(0, 0, 99, 99);
    Bitmap.PixelFormat := pf32bit;
    myc := TMetafileCanvas.Create(MyMetafile, 0);
    try
      myc.pen.Color := clBlue;
      myc.Ellipse(0, 0, 199, 199);
      myc.Draw(0, 0, Bitmap);
    finally
      myc.Free;
    end;
    MyMetafile.SaveToFile('c:\temp\mist.wmf');
    self.Canvas.Draw(0, 0, MyMetafile);
  finally
    Bitmap.Free;
    MyMetafile.Free;

  end;

end;
Angehängte Dateien
Dateityp: zip mist.zip (2,0 KB, 3x aufgerufen)
Thomas Wassermann H₂♂
Das Problem steckt meistens zwischen den Ohren
DRY DRY KISS
H₂ (wenn bei meinen Snipplets nichts anderes angegeben ist Lizenz: WTFPL)

Geändert von Bummi (22. Apr 2012 um 09:57 Uhr) Grund: berechtigte Forderung von DeddyH
  Mit Zitat antworten Zitat
 

 

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 00:14 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