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

  • Home
  • SEARCH
  • 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 6700175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:46:58+00:00 2026-05-26T06:46:58+00:00

I am developing picture viewer application and I want to add new function to

  • 0

I am developing picture viewer application and I want to add new function to it.
Till this time, I have fixed size of Image control in the XAML
Height="422" Width="444",but I want to use all possible space on the page and it is Width="447" Height="585"

<StackPanel Height="422" Width="444">
                            <Image Height="414" HorizontalAlignment="Center" Margin="9,6,0,0" Name="image2" Stretch="Uniform" VerticalAlignment="Center" Width="441" />
                        </StackPanel>

Code behind

var stream = new IsolatedStorageFileStream(path, FileMode.Open, _file);
            var image = new BitmapImage();
            image.SetSource(stream);
            stream.Close();
            if (image1 != null) image1.Source = image;

So, my question is:

  1. How I can set the size of the Image control from the code behind, so the picture will fit to the Width="447" Height="585" size, I have both portrait and landscape oriented pictures?
  2. I need to have portrait and landscape orientation support, so when orientation is change I would like to picture fit to new size Width="585" Height="447", how I can manage that? (I guess if I will find solution to the first, than only think I need is right event to handle this) Similar to this (http://stackoverflow.com/questions/6857142/handling-size-of-image-after-orientation-change-wp7), but I need to see some code t in order to understand.

Please, post some code or link to the tutorial, in order to prevent “classic” dialog where one person now how to do it and think it is simple and other person have now idea how it work.

  • 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-26T06:46:59+00:00Added an answer on May 26, 2026 at 6:46 am

    You can directly change the size of image control through it’s Width and Height properties.

    image2.Width = "447";
    image2.Height = 585;
    

    If you want to fit in your picture in the Image Control properly then you can use property Stretch

    image2.Stretch = Stretch.UnifromToFill;
    

    For handling the orientation change handle the OrientationChanged event of your page and do the image manipulation inside it

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In the application I am developing I have polygons as show in the picture
I am developing a WP7 application and want to post a picture to the
I am developing an application where I have to take picture without using Media
I am developing a small application to get some picture from a scanner. What
I'm new and just developing on J2EE. I am modifying an existing application (an
im developing a c# application (Photo Album Viewer), Im having Picturebox (Displays the selected
I am developing an application in which I have to block android default camera
I am developing the chat application.I want to show the pop up view when
I am developing an application allow user load an image in a layer. User
We're in the process of developing a new desktop application for a customer which

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.