Modern replacement ?

prior to 2019r3 this code would set the interpolation mode for GDI based drawing

//mode is 1 - 8, 8 being the best, but the slowest
Dim intMode As Integer = 8
Soft Declare Function GdipSetInterpolationMode Lib "Gdiplus" (graphics As Int32, Mode As Int32) As Int32

dim res as new picture(intWidth,intHeight)
Call GdipSetInterpolationMode(res.graphics.Handle(Graphics.HandleTypeGDIPlusGraphics),intMode)
res.graphics.drawpicture(inPic,0,0,intWidth,intHeight,0,0,inPic.width,inPic.height)
Return res

but with the demise of Graphics.HandleTypeGDIPlusGraphics whats the more modern D2D equivalent ?

There’s not an easy D2D equivalent. Is there a particular interpolation mode that you want to set? For most people setting Graphics.AntiAliasMode should be sufficient, this is what it maps to on Windows at least:

[quote]LowQuality = D2D1_INTERPOLATION_MODE_NEAREST_NEIGHBOR
DefaultQuality = D2D1_INTERPOLATION_MODE_LINEAR
HighQuality = D2D1_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC[/quote]

I assume I have to make sure AntAliased is true and set whatever mode I want to use
If antialiased is false then it wont use the anitaliased drawing mode ?

i rememer AntiAlias is on by default and doing also a little bit slow down.

[quote=471626:@Norman Palardy]I assume I have to make sure AntAliased is true and set whatever mode I want to use
If antialiased is false then it wont use the anitaliased drawing mode ?[/quote]
Correct.