0

Currently i'am developing app that will be possible to share image, with information take it of longlistselector as is showed in app, i'am trying save an ui element as a image, i don't know how can i achieve this task.

In android i realized that is possible to do this with getDrawingCache , but in windows phone 8 if is it possible?. I won´t to create new image with each element of LLS,

How can i save UI longlistselector as a image in windows phone?

I tried to do screen shoot of the current view, but not of all elements of LLS are visible.

Thanks in advance!.

1 Answer 1

1

Put this code to the Image where you want to render and apply as source

var writeableBitmap = new WriteableBitmap((int)YourLongListSelector.RenderSize.Width, (int)LongListSelector.RenderSize.Height); writeableBitmap.Render(YourLongListSelector, new ScaleTransform() { ScaleX = 1, ScaleY = 1 }); writeableBitmap.Invalidate(); image.Source = writeableBitmap; 
Sign up to request clarification or add additional context in comments.

3 Comments

This work fine if the longlistselector is totally visible, but fail when if there are some elements those not are visible. UI Elements are not in visual tree wont be set in the image =(
@Lu1zZz Is not it helpful? why do you want to make it invisible?
yeah, this is so helpful, I mean "not visible" when the longlistselector have scrollview elements , do you know how can include them in writeableBitmap?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.