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.
Related
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.
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.
I'm trying to create a simple animation example on the Windows Phone 8, but I imagine this should apply for WPF, WinRT, etc. anywhere XAML is used.
How do you animate the opacity of an to change from 0 to 1 when a 's click event is fired?
I've seen many examples of animations, but the button is always animating it's own properties, not the properties of a different control. I know I'm missing something small but I'm stumped -- no matter what I try I get XAML parse exceptions. I can get this to work with C#, but not with XAML.
Here is easy way to handle storyboard animation on any component and control by another component
http://msdn.microsoft.com/en-us/library/windows/apps/dn263220.aspx
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.
As you can see the progress bar there, I am trying to create that same progress bar in VB WinForms. I was able to find an image of the blue bar line and just put it into a picturebox on the form, but I can't get the shiny thing to come out. You can see the exact animation here: http://www.youtube.com/watch?v=00nbQEvA1yg#t=10s
Any help is appreciated.
If you don't have a moving image type like gif or if you don't have a video version of loading animation, you simply have no way to get it moving properly. Only way would be creating a similar animation using DirectX or OpenGL from scratch or rendering a video of that and embedding it to your form, which are not simple at all.
Also you should not forget about copyright!