Manipulate image for ListView

SirAnnSirAnn Member ✭✭

Hello
I've got a problem. I want to have some kind of dynamic icon for my ListView items. Means: I want to create that icon programatically at runtime.

Therefore I need the following:
1. Load an ong from file
2. place text on that file
3. place another png-symbol in a specific area of that image
4. save that image to disk
5. path to imagesource

Sounds easy, but seems to be not as easy at Xamarin, is it?

Answers

  • jezhjezh Member, Xamarin Team Xamurai

    If you try it step by step, you will find that it is far less difficult than you think.
    If you have any problem, you can tell us,we will do our best to help you.

  • SirAnnSirAnn Member ✭✭

    I tried it step by step...

    First of all it failes opening the image file that are distribtued with the "Content file" flag in the cs project file.
    And then it fails opening the image file with win2d because I cannot call this function asnyc in real, because I have to wait for it... and then I run into a deadlock within UWP:

    Uri imageuri = new Uri("ms-appx:///Assets/add.png"); StorageFile inputFile = await StorageFile.GetFileFromApplicationUriAsync(imageuri); BitmapDecoder imagedecoder; using(var imagestream = await inputFile.OpenAsync(FileAccessMode.Read)) { imagedecoder = await BitmapDecoder.CreateAsync(imagestream).ConfigureAwait(false); }

Sign In or Register to comment.