Click here to Skip to main content
15,568,965 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
In my windows 8 app we are using WCF service to fetch the data, in the app images are displaying with the image urls like "http://mysite.com/images/sample.png".

In the xaml i am using image tag to display the image like this.
<Image Margin="0"  Source="http://mysite.com/images/sample.png" Height="100" Stretch="UniformToFill"   HorizontalAlignment="Left"   VerticalAlignment="Top"  Style="{StaticResource ImageFadeInStyle}"/>

i want to display the image in such a way that if resolution changes i want another image to be displayed. can you please suggest any ideas.



thanks in advance.
Posted
Updated 17-Feb-14 5:38am
v2
Comments
Sergey Alexandrovich Kryukov 17-Feb-14 12:51pm    
What is the content of the image? Do you really have to use pixel graphics?
—SA

1 solution

See this link[^].
From this, you can get Resolution of your Image.
Now what you have to do is, once you get the particular resolution, put a check and within it write some logic to change the image.

Hope this info will help you. Give it a try.
Good Luck :)

-KR
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 17-Feb-14 12:54pm    
Krunal,

Resolution of the image is a "fictional" metadata element. It does not affect the view of the bitmap in any way. People often call the size of something in pixel "resolution". This is a misnomer. OP probably means to detect screen size in pixels, and depending on it, re-sample images to some different size.

So, this answer won't be helpful.

—SA

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900