1

my problem is a bit strange!! I'm going to create a calendar tile with writable bitmap for windows phone 8. so I'm using this character "". I'm using the below code and everything works fine as I expected on emulator. but when I test my app on a real device,calendar character will be appeared different

private void RenderText9()
    {
        int width = 159;
        int height = 159;
        string imagename = "SmallBackground";

        WriteableBitmap b = new WriteableBitmap(width, height);

        var canvas = new Grid();
        canvas.Width = b.PixelWidth;
        canvas.Height = b.PixelHeight;

        var background = new Canvas();
        background.Height = b.PixelHeight;
        background.Width = b.PixelWidth;

        SolidColorBrush backColor = new SolidColorBrush((Color)Application.Current.Resources["PhoneAccentColor"]);
        background.Background = backColor;

        var textBlock = new TextBlock();
        textBlock.Text = "25";
        textBlock.TextAlignment = TextAlignment.Center;
        textBlock.Margin = new Thickness(0, 72, 0, 0);
        textBlock.Width = 159;
        textBlock.TextWrapping = TextWrapping.Wrap;
        textBlock.Foreground = new SolidColorBrush(Colors.White);
        textBlock.FontSize = 35;

        var textBlock2 = new TextBlock();
        textBlock2.Text = "";
        textBlock2.TextAlignment = TextAlignment.Center;
        textBlock2.Margin = new Thickness(0, 40, 0, 0);
        textBlock2.Width = 159;
        textBlock2.TextWrapping = TextWrapping.Wrap;
        textBlock2.Foreground = new SolidColorBrush(Colors.White); //color of the text on the Tile    
        textBlock2.FontSize = 75;

        canvas.Children.Add(textBlock);
        canvas.Children.Add(textBlock2);

        b.Render(background, null);
        b.Render(canvas, null);
        b.Invalidate(); //Draw bitmap

        //Save bitmap as jpeg file in Isolated Storage    
        using (IsolatedStorageFile isf = IsolatedStorageFile.GetUserStoreForApplication())
        {
            using (IsolatedStorageFileStream imageStream = new IsolatedStorageFileStream("/Shared/ShellContent/" + imagename + ".jpg", System.IO.FileMode.Create, isf))
            {
                b.SaveJpeg(imageStream, b.PixelWidth, b.PixelHeight, 0, 100);
            }
        }
    }

this is the tile on both emulator and real device(pay attention to difference). anybody knows any solution??? I don't understand the reason !! enter image description here

FSystem
  • 83
  • 1
  • 8
  • hmm, looks like a render problem. Are these use the same screen resolution or same ram or same build? BTW. you look very cool on the pic. on your phone :) – ave May 03 '14 at 22:29

0 Answers0