Can I use Silverlight WriteableBitmap to save invisible parts of my user interface for a bitmap?

Let's say I have a grid that you need to scroll down to see all of its lines, and I'm interested in saving some lines that are not currently visible as bitmaps. Is this possible, or do I need to actually scroll down, “take a picture”, and then scroll the page again?

This is a matter of feasibility, and therefore I have no code to share.

+6
source share
1 answer

Yes. You can display any UIElement (and its children) for the recorded bitmap.

When you do this, you also indicate the conversion. This means that you can display any part of the UIElement (if you do not want it).

Whether it is “visible” on the screen is completely irrelevant to the rendering of raster images. This does not work like screen capture.

Cutting output is limited only by the size of the target bitmap and the rendered rendering transformation.

As an example, Silverlight Rotate and scale a bitmap to fit a rectangle without cropping , using UIElements, which are never part of the visual tree to create a bitmap that is then rendered.

+4
source

Source: https://habr.com/ru/post/894266/


All Articles