Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Multimedia (https://www.delphipraxis.net/16-multimedia/)
-   -   GDI+: Vergrößerung ohne AntiAliasing etc. (https://www.delphipraxis.net/160602-gdi-vergroesserung-ohne-antialiasing-etc.html)

Jazzman_Marburg 22. Mai 2011 15:42

GDI+: Vergrößerung ohne AntiAliasing etc.
 
Liste der Anhänge anzeigen (Anzahl: 1)
Hallo Gemeinde,
vielleicht ist ja gerade ein GDI+ Experte unterwegs:
Ich möchte aus einem Image ein Teilstück vergrößert anzeigen. Das klappt ansich gut -- nur, dass mir das GDI+ leider auch so einen Anti-Aliasing Effekt dazu macht. Ich hätte gern eine einfache Vergrößerung quasi "ohne alles" -- so wie ich sie erhalten würde, wenn ich ein Bild in ein Image mit StrecthDraw laden würde.

Das ist mein Code wie ich es z.Z. mache:

Delphi-Quellcode:
  ZoomGraphics := TGPGraphics.Create(Main_Form.ZoomImage.Canvas.Handle);

  Left  := ARect.Left;
  Top   := ARect.Top;
  Width := ARect.Right - Left;
  Height := ARect.Bottom - Top;

  DestinationRect.Initialize(0, 0, Width * ZoomFactor, Height * ZoomFactor);
 
  ZoomGraphics.SmoothingMode    := SmoothingModeNone;
  ZoomGraphics.InterpolationMode := InterpolationModeHighQualityBicubic;

  Main_Form.ZoomImage.Width := Width * ZoomFactor;
  Main_Form.ZoomImage.Height := Height * ZoomFactor;

  ZoomGraphics.DrawImage(gImage, DestinationRect,
                         Left, Top, // upper-left corner of source rectangle
                         Width,     // width of source rectangle
                         Height,    // height of source rectangle
                         UnitPixel);
Wie ihr seht, habe ich schon mit "SmoothingMode" und "InterpolationMode" rumgespielt -- leider ohne Erfolg.
Mein vorläufiges Ergebnis habe ich zur Demonstration hochgeladen.

Kann jemand behilflich sein?
(Ach ja, ich benutze die GDI+ Library von Erik van Bilsen -- aber das dürfte je eigentlich egal sein.)

Vielen Dank & Gruß
Jazzman

jfheins 22. Mai 2011 15:49

AW: GDI+: Vergrößerung ohne AntiAliasing etc.
 
Versuch es mal mit InterpolationMode auf NearestNeighbor.

Jazzman_Marburg 22. Mai 2011 16:56

AW: GDI+: Vergrößerung ohne AntiAliasing etc.
 
Zitat:

Zitat von jfheins (Beitrag 1102197)
Versuch es mal mit InterpolationMode auf NearestNeighbor.

100 Punkte! :thumb:

Das war es, was ich gesucht habe!

Lieben Dank!

Gruß
Jazzman


Alle Zeitangaben in WEZ +1. Es ist jetzt 09:26 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz