Home Dashboard Directory Help
Search

IViewObject::Draw does not work properly for Web browser control with IE11, IE10 and IE8. IE9 works fine! by C Pei


Status: 

Closed
 as External Help for as External


4
0
Sign in
to vote
Type: Bug
ID: 788312
Opened: 5/21/2013 7:16:53 AM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description




It did work as expected for a web browser control with IE9 installed. But It did not work with IE11 (come with Windows 8.1 preview), IE10, and IE8.

I added a web browser control to my project and use that to capture the hidden IE 11 windows and save it to a bitmap. If the bitmap size is specified as the same as the original IE 11 windows, everything is fine. But if I use a larger size than the IE 11 windows, it did not draw a stretched image instead it just draw the original size with zoomed image in it. The rest area is totally blank.

The code is like this

    // m_myBrowser is the IE control

    CRect curRect;
    m_myBrowser.GetWindowRect(&curRect);

    int actualPixelX = curRect.Width() * 2;
    int actualPixelY = curRect.Height() * 2;

    CImage imgOutput;
    if (FALSE == imgOutput.Create(actualPixelX, actualPixelY, 32))
    {
        return;
    }

    HDC imgDC = imgOutput.GetDC();
    RECTL rectBounds = {0, 0, actualPixelX, actualPixelY};
    hr = pViewObject->Draw(DVASPECT_CONTENT, -1, NULL, NULL, imgDC, imgDC, &rectBounds, &rectBounds, NULL, 0);



In summary, what I want is shown in bug_report2.png (in attachment), but I got only what is shown in bug_report1.png. bug_report0.png is the original contents of the IE window.
Details
Sign in to post a comment.
Posted by Microsoft on 8/12/2013 at 10:49 AM
Thank you for submitting this bug. This site is focused on accepting bugs for Visual Studio and .NET Framework, however, this issue appears to be related to the Windows operating system so we have transferred it over to the Windows team for review. further support. Should more information be needed, someone from the Windows team will follow up with you. We’ve created some online forums where you can ask questions, post issues and get answers from other preview testers and Microsoft support professionals. We encourage active participation in these forums as the best way to provide feedback to Microsoft.

•Visit the Windows 8.1 Preview forum (http://aka.ms/WinPreviewForum)
•Visit the Internet Explorer 11 Preview forum (http://aka.ms/IEPreviewForum)
•Visit the developer forums for building apps (http://aka.ms/DevBuildApps)
•Visit the IT pro forums for Windows 8.1 business features (http://aka.ms/ITProForum)
Posted by Microsoft on 8/8/2013 at 7:09 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by C Pei on 7/1/2013 at 7:16 AM
I just tested this with IE11 (installed with Windows 8.1 preview) and found that this bug remains the same as with IE8 and IE10.
Posted by C Pei on 6/26/2013 at 8:30 AM
I created the sample project I promised. It is a dialog based MFC application by Visual studio 12 (Windows 7 professional 64 bit). If you run it, you first click the button "Load". A page will load after a few seconds (which should be a msdn page and you can change it by modifying line 163 of "flatten_with_ieDlg.cpp".). Then you click "flatten" button, a bmp image will be save at "C:\test_ie8_ie10_flatten.bmp". you can also change that by modifying line 221 of the same file.

One more thing the member variable m_dZoomFactor is set to be 2. you can set any value greater than 1 if you want.
If you run it on a machine with IE8 or IE10 installed you will see a black area in the bmp image. If you are using IE9 it will be fine.
Posted by Microsoft on 6/24/2013 at 2:31 AM
Hi C Pei, we have not received your response yet. We'll close this feedback. Please reopen it recently and reply to us. Thanks.
Posted by C Pei on 5/23/2013 at 11:53 AM
I will provide the sample project after my vacation which is about 4 weeks.
Posted by Microsoft on 5/22/2013 at 8:13 PM
"Thank you for submitting feedback on Visual Studio and .NET Framework. In order to efficiently investigate and reproduce this issue, we are requesting a demo project. We look forward to hearing from you with this information.
Posted by Microsoft on 5/22/2013 at 12:51 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.
File Name Submitted By Submitted On File Size  
bug_report2.png (restricted) 5/21/2013 -
bug_report1.png (restricted) 5/21/2013 -
bug_report0.png (restricted) 5/21/2013 -
flatten_with_ie.rar (restricted) 6/26/2013 -