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 7009421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:51:36+00:00 2026-05-27T21:51:36+00:00

** Found the solution Because of the fact this is a tile, the image

  • 0

**
Found the solution

Because of the fact this is a tile, the image will always be strechted to 173 by 173!

To avoid this first create a dummy 173 by 173 and merge this with the resized one!

Rect rect = new Rect(0.0, 0.0, width, height);
WriteableBitmap bitmapDummy = new WriteableBitmap(173, 173);
bitmapDummy.Blit(rect, resized, rect, WriteableBitmapExtensions.BlendMode.None);

**

Well I have created a Background agent to update the live tile of my WP7 app.
But no matter what I try to resize it, I’m not getting a good result!

Any tips? Currently I have following code, but I also tried 135 by 173 and also the other Interpolation.

WriteableBitmap writeableBitmap = new WriteableBitmap(bitmapImage);
var resized = writeableBitmap.Resize(173, 173, System.Windows.Media.Imaging.WriteableBitmapExtensions.Interpolation.Bilinear);

There is also a small rectangle added below to show the title of the app! It’s 40px in height, would be great if image would be cropped above.
The actual image is always 250 by 321px

Current Tile

Actual image

  • 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-27T21:51:37+00:00Added an answer on May 27, 2026 at 9:51 pm

    Your problem is that you’re not calculating the width/heights to a correct Aspect ratio.

    So to get a 1:1 proportions, you would need a width of 134.735 pixels, for a 173 pixel height.

    This can be done by first determining what side is the largest

    var aspect = Math.Max(bitmapImage.Width, bitmapImage.Height)
    var ratio = largest / 173;
    var width = width / ratio;
    var height = height / ratio;
    
    var resizedImage = writeableBitmap.Resize(width, height, System.Windows.Media.Imaging.WriteableBitmapExtensions.Interpolation.Bilinear);
    

    And remember to set Stretch="Uniform" to avoid stretching the image to unnecessary proportions.

    To create a 173×173 pixel image, with the other image applied on top, use the Blit function from WriteableBitmapEx

    var tileImage = new WriteableBitmap(173, 173, ...)
    tileImage.Blit(new Rect(width, height), resizedImage, new Rect(width, height), BlendMode.None);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

problem euler #5 i found the solution but i don't know why this first
Edited: SOLUTION FOUND. This is strange and not the best solution, but I just
I found this solution which works, but I find it hard to believe there
I found the solution for this question in C# , but I can't translate
Edited to Add * I haven't found a solution for this one yet, can
I edited this question after i found a solution... i need to understand why
[edit] Found the solution. Reinstall EVERYTHING - xcode, mono, monodevelop and monotouch. Now it
Following the solution found at Can I access session state from an HTTPModule? ,
I've found a solution for finding the position of an underscore with PATINDEX :
I have searched for hours now and haven't found a solution for my problem.

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.