Help Center

CGpGraphics.GetInterpolationModemethod

Gets the interpolation mode currently set for this **Graphics** object.

GraphicsmethodCGpGraphics.incdocumented

Syntax

FUNCTION GetInterpolationMode () AS InterpolationMode

Description

Gets the interpolation mode currently set for this Graphics object. The interpolation mode determines the algorithm that is used when images are scaled or rotated.

Example

' ======================================================================================== ' Set/get the interpolation mode. ' ======================================================================================== SUB Example_SetInterpolationMode (BYVAL hdc AS HDC)

' // Create a graphics object from the window device context DIM graphics AS CGpGraphics = hdc ' // Set the scale transform graphics.ScaleTransformForDpi

' // Set the interpolation mode

graphics.SetInterpolationMode(InterpolationModeHighQuality)

' // Get the interpolation mode DIM mode AS InterpolationMode = graphics.GetInterpolationMode

' Create font and brush DIM font AS CGpFont = CGpFont("Arial", AfxGdipPointsToPixels(16, TRUE), FontStyleRegular) DIM brush AS CGpSolidBrush = ARGB_BLACK

' // Draw text with high contrast DIM layoutRect AS GpRectF = (0, 0, 0, 0) DIM info AS WSTRING * 128 = "Interpolation mode: " & mode graphics.DrawString(info, LEN(info), @font, @layoutRect, @brush)

END SUB ' ========================================================================================

Reference

  • Include file CGpGraphics.inc
  • Defined in AfxNova/CGpGraphics.inc:218
  • Documented in Graphics/GdiPlus Classes/CGpGraphics Classes.md
  • Topic: CGpGraphics Class