с помощью WriteableBitMapExWPhone Я успешно создал изображение с эффектом маски, однако мне интересно, как я могу установить это изображение в качестве фона моей страницы? Мой код ниже:
ImageBrush imageBrush = new ImageBrush();
ImageBrush imageBrush2 = new ImageBrush();
////load the photo
WriteableBitmap bgImage = LoadBitmap("/Music;component/Images/MainPage/covertart_bg.jpg");
WriteableBitmap mask = LoadBitmap("/Music;component/Images/MainPage/mask_bg.png");
//instantiate the empty parts for composition
Rect cRect = new Rect(0, 0, bgImage.PixelWidth, bgImage.PixelHeight);
//mask the photo
bgImage.Blit(cRect, mask, cRect, WriteableBitmapExtensions.BlendMode.Mask);
//My code is working as I can set the bgImage to BlitImage (this is the image control)
BlitImage.Source = bgImage;
//I want to set bgImage as my Panorama background, but the code below doesn't do the trick
imageBrush2.ImageSource = bgImage;
mainPanorama.Background = imageBrush2;