locked
share gif image without conversion

    Question

  • Hello,

    I have an application (universal app) that generates gif images. And I want user to share gif image.

    The problem is when I try to share by using next code:

                        DataTransferManager.GetForCurrentView().DataRequested += (DataTransferManager mgr, DataRequestedEventArgs ar) =>
                        {
                            //dataPackage.SetHtmlFormat(HtmlFormatHelper.CreateHtmlFormat(
                            ar.Request.Data.Properties.Title = (string)DefaultViewModel["title"];
                            ar.Request.Data.Properties.Description = (string)DefaultViewModel["description"];
                            ar.Request.Data.Properties.FileTypes.Add(".gif");
                            List<IStorageItem> l = new List<IStorageItem>();
                            l.Add(file);
    
                            ar.Request.Data.SetStorageItems(l, true);
                        };
                        DataTransferManager.ShowShareUI();
    

    The gif image is converted to jpg.

    Is there any way to avoid conversion?

    Thank you



    no where man
    http://www.nowhereman.eu

    Wednesday, March 11, 2015 7:19 AM

All replies

  • Exactly how is it converted to .jpg? Do you mean the file format has changed? If you can, please upload a project to OneDrive that shows this problem.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Wednesday, March 11, 2015 12:51 PM
    Moderator
  • Well behavior depends on destination:

    I uploaded a sample project here!

    It's a universal application, check mobile version.

    What I've seen so far is:

    Share using email, Facebook and OneNote converts image to jpg

    Share using onedrive keeps image as gif format.

    Now I cannot test but I think sharing to twitter also converts to jpg



    no where man
    http://www.nowhereman.eu

    Wednesday, March 11, 2015 4:56 PM