Windows Phone 8: how to include image in sample photos? - c#

I am testing a PhotoChooserTask based Windows Phone 8 application in an emulator. I want to test a specific image. Is it possible to somewhere add your own images to the sample photos that the emulator provides?
To be more specific, I want to test a library for decoding JPEG 2000 images, but it is not clear to me how to access arbitrary images on Windows Phone? FileOpenPicker compiles, but it throws a NotSupportedException when the constructor is invoked. The PhotoChooserTask is currently my best bet, but so far I have not been able to figure out to access images that are not part of the sample photos. And as far as I have been able to find out, MSDN documentation also does not provide a good enough answer.

Upload the photo somewhere online, go to that URL in WP8 IE10, tap and hold and click "Save Picture". The picture should now be in your "Saved Pictures" folder which is visible in the PhotoChooserTask.
FileOpenPicker isn't currently supported on WP8. It's only useful for choosing photos from C++ code since PhotoChooserTask is a managed API and is unavailable to C++ apps. Read more about that here # http://msdn.microsoft.com/en-us/library/windowsphone/develop/jj215901(v=vs.105).aspx

Related

Unity iOS making saved image show in photos

I have an image saved from my game at Application.persistentDataPath + #"/p.png" I am trying to make this visible in iOS, I have managed it in android using the Android wrappers in Unity C# but I have no idea where to start with iOS.
Is it possible for me to pass the path to my Image to iOS so that it will show up in the Photos app? If I need to write my own plugin does anyone have any decent documentation on how it's done?
If I need to write my own plugin does anyone have any decent
documentation on how it's done?
That seems like the only way. Make a plugin that can read and write byte array to Picture folder on the iOS. You can also use already made one from here that cost $10. This plugins works with iOS, Android and Windows Phone 8 and I recommend you got with it.
The fact is that I can't write the whole process here. You first need to know how to write and read from the photo folder. Here is a link for that.
Now you need to know how to call a C# function fro Objective-C and vice versa. Many tutorials for this.
http://twnkls.com/2016/04/11/creating-native-plugins-for-unity3d/
http://alexanderwong.me/post/29861010648/call-objective-c-from-unity-call-unity-from
https://www.quora.com/How-do-you-call-native-iOS-functions-from-Unity
https://stackoverflow.com/a/30946257/3785314

Opening WebP image format in Windows Phone 8 application

Is there anyway to open WebP images in windows phone applications? I have a huge set of images to be downloaded from the web and jpg/png are heavy, so looking for an image format that would reduce the data to be downloaded without compromising much on the quality.
First, I recommends you to read https://en.wikipedia.org/wiki/WebP#Criticism. Secondly, since the fact that WebP is a web standard for images, you can try using a WebBrowser as your image control.
Finally, I believe that the reason you cannot reduce the quality its because you want to use the same image as an thumbnail. I suggest you to create a process that will generate a thumbnail, something like 480px x 800px for example. Now your Windows Phone app can show a "preview" of the image, and if the user wants to see the full one, must wait.

Share images/videos from Photos Hub via my WP app

I am developing a Windows Phone 8 App. I want to add my app in the list of apps that appear when you use the ShareMediaTask. It should be possible since installing Facebook automatically adds the Facebook share to this list. So how do I register my app for this?
If this is not possible, is there a way to use FileOpenPicker() for videos??
Thanks
Sorry, there is no way to register your app to display in the Share Picker for video files.
We tried to do the same, with no success, and the same goes for photos other than JPEG files, like for example PNG.
To add a quote from the article posted by #ahandersson on "Extending the share picker for Windows Phone 8":
This topic describes how your app can appear in the share picker, a page that lets the user pick an app for sharing the photo they are viewing. Note that this extensibility is only available when the photo is a JPG file.
This http://msdn.microsoft.com/en-us/library/windowsphone/develop/ff967563(v=vs.105).aspx should help you register your application to display in the Share Picker.

Select multiple photos in windows phone 8

How do i select multiple photos in WP8. I saw in demos, that its possible but was unable to find any SDK related to it in MSDN.
Currently I am selecting one image at once by using PhotoChooserTask.
I don't think that the WP API let you select more than one photo at time. The "multiple selection" feature is intended just for selecting several pictures in the Pictures app and it's meant for quick share or deletion.
MSDN documentation is very clear about it, PhotoChooserTask is meant for selecting just one picture a time (http://msdn.microsoft.com/en-US/library/windowsphone/develop/microsoft.phone.tasks.photochoosertask(v=vs.105).aspx). I don't know any other way to access saved photos programmatically.
you could leverage this WP8 library:
https://multiphotochooser.codeplex.com/
It functions like a photochoosertask but it's capable of returning several images at a time.

WP7: Render a video from image sequence

I am currently developing a Windows Phone 7 application. What I want to do, is to render a video file (avi, wmv, whatever...) from a sequence of images. So, I just need something like a frame writer for video files (e.g. create an in-game video: write every X frame to video stream).
I searched the whole internet and also stackoverflow but I didn't find anything. As far as I know, there are a lot of APIs and interfaces in the Windows Phone 7 stack to handle audio and video, so I think there must be a solution for this somehow.
BTW: I alread had a look at C# Slicer and ffmpeg. Slicer isn't available for Windows Phone 7 and I wasn't able to port it and ffmpeg isn't allowed by Microsoft, because this solution would need to integrate an unmanaged library which isn't allowed.
I hope you can help me.
Would you consider doing this operation on a server? You could upload the images to your host, invoke ffmpeg to create the movie, then push the movie back to the phone. It might even be faster than having the phone do the encoding (assuming you don't have thousands of users hitting the host at the same time, of course!)

Categories