Closed rickbrew closed 1 year ago
The check for inputBitmap != null should be inputBitmap == null. Otherwise this method does nothing when given a bitmap, or will AV when given null when it calls inputBitmap->GetDpi(...):
inputBitmap != null
inputBitmap == null
null
inputBitmap->GetDpi(...)
public unsafe static HRESULT SetDpiCompensatedEffectInput(ID2D1DeviceContext* deviceContext, ID2D1Effect* effect, uint inputIndex, ID2D1Bitmap* inputBitmap, D2D1_INTERPOLATION_MODE interpolationMode = D2D1_INTERPOLATION_MODE.D2D1_INTERPOLATION_MODE_LINEAR, D2D1_BORDER_MODE borderMode = D2D1_BORDER_MODE.D2D1_BORDER_MODE_HARD) { HRESULT hr = 0; ID2D1Effect* dpiCompensationEffect = null; if (inputBitmap != null) { effect->SetInput(inputIndex, null, 1); return hr; } ... }
I think @Sergio0694 has been writing code for ComputeSharp.D2D1 / Win2D that makes use of this.
The check for
inputBitmap != null
should beinputBitmap == null
. Otherwise this method does nothing when given a bitmap, or will AV when givennull
when it callsinputBitmap->GetDpi(...)
: