xyzzer / WinRTXamlToolkit

WinRT XAML Toolkit
Other
282 stars 67 forks source link

Exception method not found in Composition #57

Open mixturify opened 5 years ago

mixturify commented 5 years ago

Hi,

I wanted to use the method WriteableBitmapRenderExtensions.Render(xxx), but trown an method not found exception:

Method not found: 'Windows.Foundation.Rect WinRTXamlToolkit.Controls.Extensions.VisualTreeHelperExtensions.GetBoundingRect(Windows.UI.Xaml.FrameworkElement, Windows.UI.Xaml.FrameworkElement)'

It's for an UWP app.

I don't know if this library still maintained but would be cool to fix that issue. Until them, I have to render inside xaml visual tree with some trick :)

Thanks !

xyzzer commented 5 years ago

I haven't touched that project in a very long time since the platform now has a built in method for rendering the visual tree. Any reason why it doesn't work for you?

Get Outlook for iOShttps://aka.ms/o0ukef


From: Giu notifications@github.com Sent: Sunday, February 24, 2019 2:42 AM To: xyzzer/WinRTXamlToolkit Cc: Subscribed Subject: [xyzzer/WinRTXamlToolkit] Exception method not found in Composition (#57)

Hi,

I wanted to use the method WriteableBitmapRenderExtensions.Render(xxx), but trown an method not found exception:

Method not found: 'Windows.Foundation.Rect WinRTXamlToolkit.Controls.Extensions.VisualTreeHelperExtensions.GetBoundingRect(Windows.UI.Xaml.FrameworkElement, Windows.UI.Xaml.FrameworkElement)'

It's for an UWP app.

I don't know if this library still maintained but would be cool to fix that issue. Until them, I have to make on xaml visual tree with some trick instead :)

Thanks !

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/xyzzer/WinRTXamlToolkit/issues/57, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ABrAsHttr4AGSdn59zIGfnAIqAEYbWuRks5vQmyygaJpZM4bOdso.

mixturify commented 5 years ago

With RenderTargetBitmap I can do a bitmap rendering of an XAML component (visible in the tree) but if I want to do the same by code (so in off screen), it doesn't work despite using the methods .Measure() .Arrange() and especially .UpdateLayout(). Throw, the annoying exception "Value does not fall within the expected range." from RenderAsync().

So I looked for an alternative that could allow me to capture XAML components created via the code and I came across the WriteableBitmapRenderExtensions.

It's not a big issue (I use the trick of hiding the xaml from the visible UI) but that could have had more flexibility to instance xaml elements when needed.

Anyway, thank you for your quick response!