Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7045621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:33:10+00:00 2026-05-28T02:33:10+00:00

How do you create a wp7 tile with a png as background? What I

  • 0

How do you create a wp7 tile with a png as background? What I have is a png that is white and transparent. I want the white to show on the tile, but I would also like to write some dynamic data on the transparent part, and how do you do that?

I have tried several different approaches like setting the opacity mask for different elements and write it out to a writeable bitmap but I can’t get it to work properly.

The cowboy code below is what I have right now:

var backgroundUri = new Uri("Graphics/Icon_173.png", UriKind.Relative);
var imageStream = App.GetResourceStream(backgroundUri).Stream;
var bitmapImage = new BitmapImage();
bitmapImage.SetSource(imageStream);
ImageBrush backgroundBrush = new ImageBrush();
backgroundBrush.ImageSource = bitmapImage;
backgroundBrush.Opacity = 100;            

var backgroundRectangle = new Rectangle();
backgroundRectangle.Height = 173;
backgroundRectangle.Width = 173;
backgroundRectangle.Fill = Resources.Brushes.PhoneAccentBrush;
backgroundRectangle.OpacityMask = backgroundBrush;

WriteableBitmap writeableBitmap = new WriteableBitmap(173, 173);
writeableBitmap.Render(backgroundRectangle, new TranslateTransform());

this almost does what I want, I get the background from the background rectangle correct but the mask is black instead of white.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T02:33:11+00:00Added an answer on May 28, 2026 at 2:33 am

    You’re probably not saving the image as a PNG. In your code you left out the save part, but if you use the SaveJPEG method, you’ll obviously not get transparency.

    Consider using the SavePNG method from the WriteableBitmapEx library, and see if that works better.

    Or you could set the background like this:

    backgroundBrush = (Brush)Application.Current.Resources["PhoneAccentBrush"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create WatermarkTextBox in WP7.1 I followed the link http://www.windowsphonegeek.com/articles/WP7-WatermarkedTextBox-custom-control But that
I'm trying to create maps application like the WP7 Maps. I know that in
I would like to create a page in panorama in WP7, using wrap panel
I have a page in my WP7 app that I build dynamically. I create
I would like to create a location-aware application on WP7.5 Is it possible to
I have an XNA project on WP7. I would like to get access to
How to create a photo viewer in wp7. I have some 10 to 25
I'm working with a webservice in WP7, but I get some syntax I have
I am trying to create a simple app in WP7 which will show traffic
I have built a WP7.1 application that uses a local database. I used sqlmetal

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.