Showing a high resolution image in WP8? - image

In my Windows phone 8 app, I am binding web-URL to Image control.
I have two pages, on first page i am binding a low resolution image(I Have web-URL of multiple resolutions). On next page I have to show the same Image in full screen mode so I am binding high resolution image URL. But it takes some time to load.
Then I tried to bind the same low resolution image which I have on previous page to this Full screen Image Control and then binding the high resolution image.
So my problem is here, when I am adding a low res image, its getting displayed and then I am binding a high res image. so for some time no image is appear.
Please suggest, How can i show the continuous image, Image should not be disappear.

You should use the MultiScaleImage control or wait until your High-Res image completes downloading, then re-bind your control.

I would recommend using two Image solution. Place your lo-res image into visible Image control and place your hi-res image into hidden Image control. Once hi-res image is loaded you can hide lo-res image and show hires one. For extra smooth user experience you can use animations to cross-fade images.
Subscribe to ImageOpened event so you know then image is loaded.

Related

manage images issue Swift

I have a problem to understand how do I manage the various image resolution in iOS with Swift.
For example if I have an image that i use it in my app , I have to create to for various devices resolution , but after that I insert in my project the various image resolution where I have to insert it, in a special folder?.
Can you help me?
You can simply drag your images with different resolutions from finder to the Asset Catalog in Xcode.
First, you need to understand why images with 1x, 2x, and 3x resolutions are needed.
Some devices' screen have denser pixels than others. These devices have what is called "Retina Displays". Imagine that you want to display a 100px by 100px image on a normal display. Now imagine that the same image is displayed on a display where the pixels are more closely packed. Obviously, the image on the second display will appear smaller. That's not a very good user experience.
To solve this problem, you can provide 2x and 3x images. The operating system will automatically choose to use these images whenever the display is a retina display.
Now let's see how you can put the images into Xcode.
First open your asset catalog:
q
Then drag the image that you want to add to this panel:
Then you will see that your image is added:
Now do you see those 1x 2x 3x thingys? That's where you need to drag the images with higher resolutions to!
So here I dragged a 2x image to the 2x slot:
Now when your app runs on a device with retina display, the 2x image will be used!
It's rather not for image resolution but screen's pixel density. Basically you've got non-retina devices (standard) and retina ( 2xstandard and 3xstandard). So, in example if you've got 100x100 point imageView that you would like to feed with image named square.png asset you will need 3 kind of images: square.png (100x100px), square#2x.png (200x200px) and square#3x.png (300x300px).
In Xcode, put these images in something called Asset Catalog - it will handle images' size managing for you.
More info: https://developer.apple.com/library/ios/recipes/xcode_help-image_catalog-1.0/_index.html

QLabel show image slowly

I develop a image browser to show image series with QSlider. I connncet valueChanged(int) of QSlider to a self-defined function:
QObject::connect(ui.imgIndexSlider, SIGNAL(valueChanged(int)), this,SLOT(onimgIndexSliderValueChanged(int)));
when I drag the slider, the image that QLabel shows will changed by the QSlider value.It works.But there is a problem that if you drag fast,the Application will not run acceptably.
Could you tell me how to slove this problem.
Thank you very much.
It is not clear much from your question, but I am assuming that you are showing images like a slideshow using the slider. When you slide it fast your application is getting choked i.e. freezes?
Qt is rendering the image in your GUI thread.
If the images are all high resolution then it will take much more time in rendering each image.
When you slide faster than Qt can render a single image you will experience problems.
So here is what I would ideally do if I were in your place:
Implement a custom algorithm which will read the image file and
create a preview image of much smaller size. Since you are only
generating a pixmap in memory, you can do this by multi threading.
You can do this when your application is launched.
Show all the preview's as scrollable tiles on left pane similar to
Powerpoint. You can reduce some coding here by letting Qt render
these preview's by using QLabel.
Have a central widget which occupies the major chunk of the window
which will render the images using your custom algorithm. Your
algorithm will be such that it will read the actual image if the
slider is not running. If slider is running fast enough then you simply need to
scale your preview images and display in the widget.
Feel free to ask questions if you find anything difficult to understand. :)

drupal image in view is displayed full screen, how to get the image smaller?

We have got a view of a content type with an image and some fields, but the image is displayed way to large. We tried to adjust maximum resolution but that just crops the image and makes it pixelated. How can we get this image to be displayed smaller?
thanks.
In Drupal 7, you can use the core Image Styles (admin/config/media/image-styles) to set pre-defined image sizes, cropping, and more. Once you have an image style configured, you can use it to style an image in a view. This gives you complete control over image cropping and sizing. If you're using Drupal 6, the ImageCache module does the same thing.

Images & Icons are getting pixelated when gallery loads

I have a Content Slider (All-in-one-banner sort of) on the home page of my website.
Every time this banner slides onto the next image in the queue, the other images (png format) on my page are getting pixelated. Especially it happens in Chrome.
Images and Icons such as the logos, icons used for navigation, etc... - they get pixelated when a new slide changes on the banner.
Please help me.
Demo link (Open in chrome):
When the slides in the banner change, Look at the logo on the top and the logos to the right, and also the profile pics below,: indiaemerge.com/ieys2013
The solution I could figure out is that one should NOT use an image with large dimensions.
For example: I was trying to use an image of size 800px X 400px to fit it into a division of 200px X 50px. Because of this the image was getting distorted when slides would change.
I reduced the dimensions and resolution of the image to match the target division's dimensions and it worked.
Another way to fix this is to use an svg image file.
So the lesson to be learnt here is that always try to use an image (in case it is png or jpg) whose size meets your requirement as precisely as possible. If it is an svg image file then there won't be any problem.

Images taking long time to load WinRT XAML

In our WinRT app, we have provided image as a background to grid and buttons through XAML.
We observed that images taking long time to load, app showing only other text controls (like TextBlock) first, then after some duration, our images loaded. Till the time we only see text controls in page.
We are setting background as below
<ImageBrush ImageSource="ms-appx:////Images/image.png"/>
Please let me know, what can we do to resolve this issue.
Thanks.
You can
reduce the resolution of the image
wait for it to load before you show the page - either by starting that earlier somehow or by showing the page completely black and, say, fading in when the image loads
use a lower resolution image or other asset until the image loads
not use that image at all
I have a hunch that if the image source gets set early enough - WinRT will wait for a short time (a fraction of a second) before it shows a new page to give the image a chance to load before it starts running transition animations etc., so lowering the image resolution altogether or using a lower resolution before a higher resolution one loads is one approach.
one more option is to have a background be outside of the root frame - e.g. modify App.xaml.cs to have a grid as root visual and put the background image and the frame inside of it so you can change the image at any time.
This is a weird behaviour,
However you can try to opt for images with smaller size/resolution to optimize rendering time.
Also, try to set the background image in the Page's constructor - Since, Microsoft may(I am not sure though) handle XAML Parsing via Async Operations
Instead of ImageBrush try to use regular Image with CashMode property set to "BitmapCache":
<Grid>
<Image Source="ms-appx:////Images/image.png"
CacheMode="BitmapCache" />
<!-- Your other content above background image -->
</Grid>

Resources