You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried to use the following which is directly taken from a test in this repo:
var device = new CanvasDevice();
var rt = new CanvasRenderTarget(device, 16, 16, 96);
But I get the following exception: Specified cast is not valid.
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode)
at WinRT.IObjectReference.As[T](Guid iid)
at WinRT.IObjectReference.As(Guid iid)
at Microsoft.UI.Xaml.DependencyObject..ctor(IObjectReference objRef)
at Microsoft.Graphics.Canvas.CanvasBitmap..ctor(IObjectReference objRef)
at Microsoft.Graphics.Canvas.CanvasRenderTarget..ctor(IObjectReference objRef)
at Microsoft.Graphics.Canvas.CanvasRenderTarget..ctor(ICanvasResourceCreator resourceCreator, Single width, Single height, Single dpi)
at <my app>.FrameAvailable(MediaPlayer sender, Object args) in <my console app>\WmfFrameSource.cs:line 87
I believe it is an issue with cswinrt that prevents CanvasBitmap and CanvasRenderTarget from working in net5.0 right now.
The issue tracking this is here: microsoft/CsWinRT#779
Once this issue is fixed CanvasBitmap and CanvasRenderTarget should start working.
I'm attempting to use Win2D because I need something that implements
IDirect3DSurface
so that I can process video frames written to it. (Related question here https://stackoverflow.com/questions/67011957/how-to-get-decoded-video-frames-using-winrt-in-net5)I've tried to use the following which is directly taken from a test in this repo:
But I get the following exception:
Specified cast is not valid.
#813 is likely related.
I have tried #707 (comment), Microsoft.Graphics.Win2D, and #735 (comment).
The text was updated successfully, but these errors were encountered: