Monday, 2 September 2013

windows phone ,how can I use WriteableBitmap and UserControl render an image?

windows phone ,how can I use WriteableBitmap and UserControl render an image?

here is my code:
// create image1
var tileControl1 = new FlipCycleTileSmallControl("");
tileControl1.Measure(newSize(159, 159));
tileControl1.Arrange(newRect(0d, 0d, 159, 159));
var writeableBitmap1 = new
System.Windows.Media.Imaging.WriteableBitmap(tileControl1, null);
image1.Source = writeableBitmap1;
// create image2
var tileControl2 = new FlipCycleTileMediumControl("");
tileControl2.Measure(newSize(336, 336));
tileControl2.Arrange(newRect(0d, 0d, 336, 336));
var writeableBitmap2 = new
System.Windows.Media.Imaging.WriteableBitmap(tileControl2, null);
image2.Source = writeableBitmap2;
// create image3
var tileControl3 = new FlipCycleTileMediumControl("");
tileControl3.Measure(newSize(691, 336));
tileControl3.Arrange(newRect(0d, 0d, 691, 336));
var writeableBitmap3 = new
System.Windows.Media.Imaging.WriteableBitmap(tileControl3, null);
image3.Source = writeableBitmap3;
well,use this code,I want to create an image from
UserControl(FlipCycleTileSmallControl,FlipCycleTileMediumControl,FlipCycleTileMediumControl),and
save it to IsolatedStorage,but ,image1 is well,image2 and image3 are not
well with black background,
what can I do?

No comments:

Post a Comment