created live tile looks corrupt - isolatedstorage

am creating custom live tiles by updating the text in a 173x173 XAML control, then using writablebitmap.Render to create a JPEG. Finally, create StandardTileData, set the two images, and put them on the correct tile. Works most of the time. Actually it always updates fine. But once in a while when a new tile is created, or deleted, the image is corrupted. The text is all mushed on the left side of the tile and there is no background color.
Any ideas what could be happening? It's not a background task as that is disabled. Something to do with the system scanning the newly created jpegs while I'm trying to set the tile data?
thanks.

found solution here
rendering usercontrol live tile windows phone
Obviously a system bug.
calling UpdateLayout before and after each measure and arrange call

Related

UICollectionview lags with local stored images

I have simple application, who consumes data from local core data storage. I am displaying images in collectionview & it lags when i scroll. All images are from local bundle itself.
Can anyone help?
Thanx.
Store all the images in an array once and use that array instead of fetching images from core data everytime the cell loads.
A typical solution to this would be to use the proxy design pattern and to load images asynchronously on a background thread.
You could have a UIImageView subclass that shows a placeholder image or a blank rectangle, but that is automatically updated once the image has been loaded. Some apps even use this to make a fancy "polaroid fade" effect, i.e. fade the image from white or black when it goes on-screen.
To prevent placeholder images from ever being seen (although you'd want to test this on device, as local storage might be fast enough to make this unnoticeable), you could pre-cache images in advance (for example by anticipating a number of extra rows in your cellForRowAtIndexPath method)

Memory consumption of images in iOS Web Application

I have a iPad (magazine) web application which displays a set of medium sized (~500kb) images. They're displayed one per view (1024x768), and when swiped another one is displayed.
I have three images (previous, current and next) as display:block at the same time while other images are hidden with display:none.
Everything works fine on some extent. However, when application has run for some time and larger set (20+) of images has been displayed, the application crashes, mostly on iPad 1. My assumption is this has something to do with memory consumption of device.
My question is: what are the best practices to keep the memory consumption as low as possible? Obviously setting images to display:none is not working. Should I remove the images from DOM and then re-apply them when coming into view? Or are the any other simple tricks to prevent application from crashing?
There is an approach where you have to set the source of an image to an empty string before removing the element for the DOM: http://blog.thinkingtype.com/2012/07/ios-mobile-web-application-image-memory.html
So in your case you could store the source in an data attribute of the image element when you set the display to none, and set the source again when you made image visible while setting display to block.

Showing large UIImage causes jittering even though it is already in memory

I have app similar to sample app PhotoScroller, e.g. lot of large images (2048x1536) in scrollview. I am not using tile approach as I don't like that partial load effect. I would like to show whole image at once. I am loading images in background thread. When I try to use loaded image in UIImageView for the first time, it blocks main thread for half a second even tho it is already in memory.
I used profiler to see where this lag is coming from but I couldn't find any useful information there.
Is iOS copying image data when it is used for the first time or something like that? Can I somehow do that in background thread as well?
EDIT: when I scroll there and back again and use that same UIImage second time, there is no delay
Try to make image in background thread too.
Do you loading image from inet or locally? bundle or custom path?
I think I solved it. Turns out when ios loads UIImage from disc or web, it doesn't load it in correct format. So when you want to display it, ios has to reformat this image into the format that he can use. This reformating can cause visible stuttering when image is big enough.
To prevent this, you need to reformat UIImage after it was loaded and you can do that safely in background (as far as I know). This link show how to do it.

Animation on top of MapField in Blackberry

I am using blackberry maps to write my Application and want to show current location of the user on the map using a Blue dot image. I am able to do it by overriding the paint() method of the MapField and place the image at the right place.
However now I want to pulsate(breathing bubble) the image, for that I am using a gif image with 3 different frames. Here i am not sure how to display all the 3 frames at certain frame rate so that I don't have to rely upon mapfield.paint() to draw my images. Initially I thought of using AnimatedGifField's thread for this, but not sure how to using it coz i can't add a field(AnimatedGifField) to a field(MapField). I am using JDE 6.0
Does anyone has any idea about it..?
I would probably just keep using the paint() method, but when you need to redraw the bubble, invalidate a region instead of invalidating the entire screen. This will allow you to continue using the paint method without needing to have the entire thing redraw itself.

Putting info on BlackBerry homescreen

We're developing some application and want to display some information on the device homescreen like Weather Plus application does.
Could you tell me how i can do the same thing? Thank you!
From what I've seen in the Weather Plus video demos, the app doesn't (or can't) paint on the current background image, but you can choose an image to be the homescreen background with all the weather info painted on it. It also doesn't need a custom theme, so I'm pretty sure they just use the HomeScreen.setBackgroundImage() method.
As far as the image generating is concerned, my best bet would be opening the background image picked by the user in a Bitmap object, passing it to a new Graphics object to do all the necessary rendering and creating a new .png file using the encode(Bitmap bitmap) method of PNGEncodedImage.
If you wanted the homescreen image to be for example animated you might want to try the Blackberry Theme Studio, but I don't think it offers the amount of interactivity (retrieving data, loading images) you are looking for, at least for now.

Resources