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 https://forum.xojo.com/9403-scale-quality-of-canvas-control/0
if g = nil then
return
end if
dim ghnd as integer = g.Handle(Graphics.HandleTypeGDIPlusGraphics)
// see https://msdn.microsoft.com/en-us/library/windows/desktop/ms534141(v=vs.85).aspx
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)
#endif
End Sub
This no longer compiles in 2022.
Is it still needed? If so, what’s the new method?