locked
Share Target : Bitmap different on Win 8 & Win 8.1 ? RRS feed

  • Question

  • Hello,

    I use metro IE as Share Source, which contain text and picture,

    On Win 8, my code can get the Bitmap, but on Win 8.1, the same code did not get a bitmap.

    So how can I get the Bitmap on Windows 8.1 ? Is a modification by Microsoft ?

    if (this._shareOperation.Data.Contains(StandardDataFormats.Bitmap))
                    {
                        try
                        {
                            this.sharedBitmapStreamRef = await this._shareOperation.Data.GetBitmapAsync();
                        }
                        catch (Exception ex)
                        {
                            Diag.DebugPrint("ShareTarget Activate Get Bitmap Exception :" + ex.ToString());
                        }
                    }


    Please check my following screenshot for more info.
    Wednesday, July 10, 2013 8:25 AM

Answers

  • Hello ideastore

    We've looked at this further. There is a change in behaviour here but it is deliberate.

    Internet Explorer 11 introduces a change in this behavior by providing a representation of the user selected content in the HTML data format. Bitmap data-format only supports single image and so the behavior you were seeing with Windows 8 is not scalable in that it does not provide multiple images if there is more than one in the user selection. You should be able to continue to retrieve the image from user selection by looking for <img> tags in the HTML data format that Internet Explorer 11 provides.

    Hope that clarifies things

    Doug

    Tuesday, July 23, 2013 9:08 PM
    Moderator

All replies

  • Hello,

    I use metro IE as Share Source, which contain text and picture,

    On Win 8, my code can get the Bitmap, but on Win 8.1, the same code did  not get a bitmap.

    So how can I get the Bitmap on Windows 8.1 ? Is a modification by Microsoft ?

    if (this._shareOperation.Data.Contains(StandardDataFormats.Bitmap))
                     {
                         try
                         {
                             this.sharedBitmapStreamRef = await this._shareOperation.Data.GetBitmapAsync();
                         }
                         catch (Exception ex)
                         {
                             Diag.DebugPrint("ShareTarget Activate Get Bitmap Exception :" + ex.ToString());
                         }
                     }

    Wednesday, July 10, 2013 8:28 AM
  • Hi ideastore,

    The shared formats are controlled by the share source not by your code, so the share source can change what formats it delivers. That said, I don't see a bitmap shared from IE in any page I looked at on either Windows 8 or 8.1. I get the equivalent data on each: URI/WebLink and HTML. You can use the Share Target sample to see which data formats are included in the Data Package.

    Can you give exact repro steps? What web page are you looking at?

    --Rob

    Wednesday, July 10, 2013 5:44 PM
    Moderator
  • Yes, On windows 8, if i select the picture on the metro IE, then share with my app, code "this._shareOperation.Data.Contains(StandardDataFormats.Bitmap))" will return true, so I can load picture to my GUI.

    i attach a picture show you how it works, the web linkage is :

    http://bj.house.163.com/13/0704/18/92V7DEPK00073V0K.html

    but if i try the same code to Win 8.1, the text can be loaded, but the "this._shareOperation.Data.Contains(StandardDataFormats.Bitmap))" will return False;

    so I can not load the picture. Please help to check .

    another example is on msdn page :(http://msdn.microsoft.com/en-us/windows/default.aspx)

    • Edited by ideastore Thursday, July 11, 2013 10:45 AM update some info.
    Thursday, July 11, 2013 10:40 AM
  • Hello Rob,

    Will you still watch on my case ? I update the exmaple for your reference.thanks.

    Thursday, July 18, 2013 12:58 AM
  • Hello ideastore

    Using the Windows SDK Share Target sample and the MSDN page http://msdn.microsoft.com/en-us/windows/default.aspx that you reference (which I browse to in the modern IE browser on Windows 8) what I see reported as the Data Package Content is just "Uri" and "HTML" as Rob said:

    If I use Fresh Paint as the share source I see the Data Package Content as "Text" and "StorageItems: FreshPaint.png"

    You can find the SDK sample app for 8.0 here:

    http://code.msdn.microsoft.com/windowsapps/Sharing-content-target-app-0fd514a2

    Can you try that on Windows 8 and post a screen shot of what you see when you share from the MSDN page in IE to the SDK sample as a share target?

    If you get the same as us (no image in data package content) then you might need provide a working sample that demonstrates what you have working in Windows 8 as a share target that gets bitmaps.

    Thanks

    Doug

    Friday, July 19, 2013 12:30 PM
    Moderator
  • Hello Doug Stewart,

    before you share with the sample, you need do one more operation, that is : First, select one picture on the page using your mouse, and then try to share using the sample. I show the attact as below, I select one picture and some text on the page, then share : (Bitmap will be shared, but on Win 8.1, won't; That's my question)

    Monday, July 22, 2013 5:43 AM
  • Hello ideastore

    Thank you for the clarification of the repro step.

    I can confirm that I see the same as you now with IE as the share source.

    I can also confirm that using the Windows 8 share source and target samples I do not get the same behaviour:

    Share content source sample for 8:

    http://code.msdn.microsoft.com/windowsapps/Sharing-content-source-app-12b47358

    Share content target sample for 8:

    http://code.msdn.microsoft.com/windowsapps/Sharing-content-target-app-0fd514a2

    So this would seem to be a specific change in behaviour between IE10 and IE11 with respect to its behaviour as a share source when a bitmap is selected.

    I will investigate further.

    Doug

    Monday, July 22, 2013 10:24 AM
    Moderator
  • Hello ideastore

    We've looked at this further. There is a change in behaviour here but it is deliberate.

    Internet Explorer 11 introduces a change in this behavior by providing a representation of the user selected content in the HTML data format. Bitmap data-format only supports single image and so the behavior you were seeing with Windows 8 is not scalable in that it does not provide multiple images if there is more than one in the user selection. You should be able to continue to retrieve the image from user selection by looking for <img> tags in the HTML data format that Internet Explorer 11 provides.

    Hope that clarifies things

    Doug

    Tuesday, July 23, 2013 9:08 PM
    Moderator
  • Great! Got you. Thanks so much for your efforts.
    Wednesday, July 24, 2013 12:32 AM