Writeablebitmap from UIElement with transparent background (WP and Silverlight)

Creating an image from UIElement covered in another matter . However, I am trying to make a UIElement image in which an unfilled background remains transparent. This is currently being done in my code ( DOES NOT work for transparency):

 var imageBrush_Final = new ImageBrush { ImageSource = bi, Stretch = Stretch.None }; FinalCanvas.Background.Opacity = 0; FindChildShieldCanvas_FinalCanvas(FinalCanvas, imageBrush_Final); FinalCanvas.InvalidateArrange(); FinalCanvas.UpdateLayout(); WriteableBitmap writeableBitmap_Finals = new WriteableBitmap(FinalCanvas, null); String tempPNG = results.Username + "My_Crest.png"; using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication()) { using (IsolatedStorageFileStream imageStream = new IsolatedStorageFileStream(tempPNG, System.IO.FileMode.OpenOrCreate, isf)) { await Cimbalino.Toolkit.Extensions.WriteableBitmapExtensions.SavePngAsync(writeableBitmap_Finals, imageStream); } } 

Created an image from canvas , inside which one form was added. The form is filled with ImageBrush , in particular imageBrush_Final . The canvas is partially filled by the artist of the internal form, which was painted by imageBrush_Final . Therefore, I would like the created writeableBitmap_Finals be filled only with the form, and the rest should be completely transparent.

Does anyone know how I can achieve this, and why it is not saved when a UIElement , i.e. canvas set its background on Opacity to 0 ?

+7
c # silverlight canvas windows-phone-8
source share

No one has answered this question yet.

See similar questions:

10
Silverlight 4 - Render UIElement as Picture
one
How to save WriteableBitmap as PNG image with transparency

or similar:

1658
Get int value from enum in C #
1270
Why not inherit from List <T>?
nineteen
Drawing a transparent button
12
Android: can I create a view / canvas that is not rectangular, but round for example?
5
UWP - How to make a background image?
one
the problem of obtaining a background image form
one
Screen image: there were problems with an unlimited and transparent form
one
How to get an image from a cropped area (rotated rectangular area) in canvas
0
Drawing an image in a canvas removes the background fll
0
Transparency of DataGridView cells in BackColor

All Articles