I’m upgrading from Xojo 2019 to 2022.

In 2019, I had this code to get higher quality drawing:

Public Sub SetGDIInterpolationMode(g as Graphics)
  #if TargetWin32
    // sets high quality interpolation mode for resizing info
    // useful when using @2x retina graphics on Win32 
    // Note: you set this on the destination graphics, not on the source
    // see
    if g = nil then
    end if
    dim ghnd as integer = g.Handle(Graphics.HandleTypeGDIPlusGraphics)
    // see
    Soft Declare Function GdipSetInterpolationMode Lib "gdiplus" (graphicsHandle as int32, Mode as int32) As int32
    const InterpolationModeDefault = 0
    const InterpolationModeLowQuality = 1
    const InterpolationModeHighQuality = 2
    const InterpolationModeBilinear = 3
    const InterpolationModeBicubic = 4
    const InterpolationModeNearestNeighbor = 5
    const InterpolationModeHighQualityBilinear = 6
    const InterpolationModeHighQualityBicubic = 7
    dim mode as integer = InterpolationModeHighQualityBicubic    
    call GdipSetInterpolationMode(ghnd,mode)

End Sub

This no longer compiles in 2022.

Is it still needed? If so, what’s the new method?

I would think this is gone since GDI plus is no longer used at all ?

1 Like

I think you are right. Is there an explanation of the new graphics framework xojo is using these days?

Its called Direct2D.

There is some info on Microsoft web. Though its sort of sparse, its not used all that much.

There is now an AntiAliasMode property built into the graphics class. I’ve never used it but it might be a suitable replacement.

Thanks! - but it appears to have a documentation bug - it’s not a Boolean…

AntiAliasMode As Boolean

Controls the level of interpolation/quality when drawing scaled Pictures. Valid modes are from the Graphics.AntiAliasModes enumeration: LowQuality, DefaultQuality, and HighQuality. The default is DefaultQuality.

Use High Quality (set in Paint event of a Canvas):