Implementing loading image in WinrT - windows-8

How i can implement a default loading image to my image control while the time of image loading. ie need to display the loading image initially and after the actual image loads i need to set that image as my image source. I windows phone i implemented the same with the help of LowProfileImageLoader class. But in windows 8 how i can implement the same.

It's fairly easy to do this in a Windows Store app by using the async functionality. You would set your image source to your loading image (maybe using the ms-appx protocol and loading it from your package) while you use a HttpClient to download the larger image for example. Here is a sample on how to use HttpClient asynchronously.
Per comment: You can use the ProgressRing class and change to the image when you get the ImageOpened event. See this example.

Related

How to detect map container resize due to slow loading image?

I am creating an app with a Leaflet map in Nuxt using Vue2Leaflet plugin.
I am having a problem though: I am using Bootstrap columns to size the map and accompanying image, but the image loads too slow (this cannot be resolved at this time), so the container is not the proper size when the map loads.
This causes the map to be half grey. I have attempted to call map.invalidateSize() in the mounted event, but even that must be happening before the image finishes loading.
I have setup a sandbox at: https://codesandbox.io/s/eager-bohr-c3453?file=/src/App.vue
In order to see the bug, you have to view the rendered app at https://c3453.csb.app/ (the internal codesandbox render does not show the problem)
I think I need some way to wait until the image has completed loading (so the BS col is the proper size), then call map.invalidateSize(), but I am not sure how...
You can attach an onload listener on your <img>, so that you can call (again?) your Leaflet map invalidateSize() method.

codename one how to place component on an image viewer that capture camera?

I have a GUI Builder created form in codename one, how can i open the camera in a resizable view at the show() of the form and place container like text area or anything else on it?
I saw the camera demo but i don't understand it very well because on the simulator it open a file picker.
My purpose is to create a form with a camera resizable capture when you have two labels and you can also write or paint on your photo used in background, I do this only for hobby and fun, i do what i can, Any advice is well accepted, thank you for the attenction
You can now place a component on top of a camera view with a new cn1lib: https://github.com/codenameone/CameraKitCodenameOne
Original answer below:
I'm assuming you mean overlay on a live camera view. While this is possible it's not supported at this time in the Java API layer.
If you mean grabbing a photo and setting it as a background for the form for overlay you can create an image with the result of the Capture API and use setBgImage() to set that image to the background of a component or form.

QML Loader strange behavior

I'm having issues rendering using OpenGL with a QQuickItem.
The setup:
I've partitioned the app window into a status bar and a display area. The display area will be used to render output from various Qt plugins. I'm using the QML Loader object to dynamically load the objects from the plugins as needed.
The problem:
I've duplicated the opengl rendering with qml example. If I load it into the display area directly it works perfectly. If I load it into the display area using a Loader it displays nothing. I've logged debugging messages and it's definitely running. I've debugged the app using GDebugger and it appears to be sending OpenGL calls.
Does the loader object mess with the window context?
Any suggestions on how to get this to work?
Is source for the loader object available somewhere?
The problem was not that the custom control wasn't drawing. It was my misuse of QML.
The dynamic loader was adding the content to a 'column' control. The layout controls exhibit 'undefined behavior' if you use them incorrectly. Changing to manual layout using anchors corrected the issue.

Image loading animation

I'm looking for a good example on how to have an image loading animation in my metro xaml app.
I have an image control that has a source set through mvvm binding directly to an URL.
So I know there is the ImageOpened and the ImageFailed events to stop any animation, but when does the 'download' start to start it?
Because the second time the app starts the image is still cached and the ImageOpened event isn't fired anymore.
Any tips/tricks?
Have you looked at the DownloadProgress event? It looks like the event args contain a Progress value between 0-100 that you could use to determine if a new download is starting.
Also, there is a generic XAML animation library sample in case that helps.

how could I load the Google map in terrain view in iphone

I'm new in iPhone. How could I load the Google map in terrain view.
MKMapView provides only three options, MKMapTypeStandard, MKMapTypeSatellite, MKMapTypeHybrid.
But I want to show the terrain view, how could I do that.
You can set the value of the mapType property on your MKMapView instance to 3 (instead of using one of the named constants):
yourMapView.mapType = 3;
Works for me when compiling against the 5.0 SDK. No idea if it'll get through the app store approval process...
I solved that problem.
You have to use the webview and html file which contains the javascript and Google maps API.
Just load the html file in webkit which loads the maps.google.com page and the Google maps API directly show the terrain view without interacting with webview.