Help Center

CGpGraphics.SetInterpolationModemethod

Sets the interpolation mode of this **Graphics** object.

GraphicsmethodCGpGraphics.incdocumented

Syntax

FUNCTION SetInterpolationMode (BYVAL interpolationMode AS LONG) AS GpStatus

Parameters

NameDescription
interpolationModeElement of the InterpolationMode enumeration that specifies the interpolation mode.

Return value

If the function succeeds, it returns StatusOk, which is an element of the GpStatus enumeration.

If the function fails, it returns one of the other elements of the GpStatus enumeration.

Description

Sets the interpolation mode of this Graphics object. The interpolation mode determines the algorithm that is used when images are scaled or rotated.

Example

' ======================================================================================== ' Set 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:229
  • Documented in Graphics/GdiPlus Classes/CGpGraphics Classes.md
  • Topic: CGpGraphics Class