Frage

I would like to create an App for WP8 using the Nokia Imaging SDK where I can take some photos using the phone camera and then apply a kind of predefined templates over the photo that was just taken. For example, I take the photo and then I would like to apply a christmas template to the photo and then save it. However, I'm starting with the Nokia Imaging SDK and I have no idea where to start :-(

I was looking for some good examples, code, etc but not luck. In the Nokia page there are documentation about the SDK but doesn't have any example for the App I would like to create.

Any suggestion, help, or a clue where to find something about this would be very helpful

Thanks in advance!

War es hilfreich?

Lösung

You should be able to achieve what you need using BlendFilter. It has several different options for blending one image (your Christmas theme) with another (what you capture with the camera). In pseudocode this is what you have to do:

  1. load both images into the most appropriate image sources, take a look at StorageFileImageSource, CameraPreviewImageSource, etc and decide what suits you the most.

  2. create a new FilterEffect, using the photo from the camera as the source.

  3. Create a new BlendFilter, passing your template picture and a blending mode. You will be looking at a lot of different modes, play around with them and choose one that you like. Add the filter to FilterEffect.Filters.

  4. Render the result, most conveniently with a JpegRenderer.

  5. Save or view the result.

Take a look at the Nokia's QuickStart. Step 5 demonstrates creating the chain, you can start with that code and modify it to get the effect you are hoping for.

In the sample app the author creates an app with a similar goal, except he only applies the Carton filter to the image. So most of your code will be the same, you only need to change what filters are applied in the FilterEffect.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top