ratishphilip / CompositionProToolkit

Collection of Helper classes and controls (using Win2d) for Windows.UI.Composition
MIT License
235 stars 29 forks source link

Problem with CompositionImageFrame #4

Closed Hanzalah-Adalan closed 8 years ago

Hanzalah-Adalan commented 8 years ago

I tried to use CompositionImageFrame in my project.. the build was successful, but I get a runtime error.. I don't have any idea how to fix it.. this is the exception message:

System.TypeLoadException: Requested Windows Runtime type 'Microsoft.Graphics.Canvas.CanvasDevice' is not registered. ---> System.Runtime.InteropServices.COMException: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))

--- End of inner exception stack trace --- at System.StubHelpers.StubHelpers.GetWinRTFactoryObject(IntPtr pCPCMD) at Microsoft.Graphics.Canvas.CanvasDevice.GetSharedDevice() at CompositionProToolkit.CompositionGenerator..ctor(Compositor compositor,

ratishphilip commented 8 years ago

Can you please provide more details on this? Did you add CompositionProToolkit as a NuGet to your project? Did it also install the Win2d NuGet along with it?

Could you please share how you are using CompositionImageFrame in your code?

Hanzalah-Adalan commented 8 years ago

after I added reference to Win2d and rebuilt the solution, that error has gone! sorry sir I thought that Win2d dependency will get referenced automatically as I install CompositionProToolkit nugget..

Sir just one more question, does CompositionImageFrame support caching like ImageEx https://github.com/wasteam/waslibs/tree/master/src/AppStudio.Uwp/Controls/ImageEx in AppStudio.Uwp or the newer version of it, UWPCommunityToolkit https://github.com/Microsoft/UWPCommunityToolkit/tree/dev/Microsoft.Toolkit.Uwp.UI.Controls/ImageEx

if it does I believe this control would be one of the best Image control for UWP platform..

ratishphilip commented 8 years ago

Well, it is supposed to add a reference to Win2d automatically when you install the CompositionProToolkit NuGet. I tested here on a new blank UWP app. When you add the CompositionProToolkit Nuget it should show the following dialog cpt_license

ImageCaching feature is not added to CompositionImageFrame yet. This feature is certainly planned for a future release.

Hanzalah-Adalan commented 8 years ago

Oh I see.. thanks sir, really looking forward to it!