青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

brent's hut

render whole html page

Ask:
Hi,
I'm trying to render the contents of a HTML page hosted in a web
browser control so that I can save the result as an image.

There are a number of ways to do this. For example you can use any of
IHTMLElementRender,­ IViewObject or WM_PRINT. The problem with these
methods is that you only will receive the portion of the page's content
that is visible in the web browser. If the page's size is bigger than
the dimensions of the web browser these hidden or "scrollable" parts
will not get rendered in the above methods.

You could resize the browser to fit the entire page but that is not
feasible in a scenario when a user is using the browser. A second
approach is to load the page into a second hidden browser which, again,
is resized to fit the entire page. The problem with this approach is
that I can't load the document again since it's appearance could
change. I want to render exactly what's in the user's browser. AFAIK
there is know easy way to exactly clone a MSHTML document.

Does anyone (Igor?) have any clues how these "hidden" ares could be
rendered? Any help much appreciated.

Regards,
Christoffer
 
Answer:
    I took a couple of ideas from Code Project and pieced them together to
do just this. I render the client area into a small bitmap, blit it
into a final larger (page size) bitmap and scroll the control to get at
another area. This was simpler than trying to get it to render into
the correct area of the page size bitmap.

This was written for a browser control that was NOT seen by the user so
I didn't care where the final scroll position was.

1. From the IHTMLDocument interface call get_body to get the
IHTMLElement enterface.
2. Get the IHTMLElement2 interface (pBody2 in the code).
3. Call get_scrollHeight and get_scrollWidth, get_clientWidth,
get_clientHeight.
4. Get the IHTMLElementRender interface (pRenderer in the code).
5. Create a bitmap the size of the client area and select it into a
clientDC.
6. Create a bitmap the size of the scroll area and select it into a
pageDC.
7. Use some code like the following to scroll and render the page:

long x = scrollWidth;
long lastX = -1;
bool doneX = false;
while (!doneX)
{
    pBody2->put_scrollLeft(x);
    pBody2->get_scrollLeft(&x);
    if (-1 == lastX)
    lastX = x + clientWidth;
    long y = scrollHeight;
    long lastY = -1;
    bool doneY = false;
    while (!doneY)
    {
        pBody2->put_scrollTop(y);
        pBody2->get_scrollTop(&y);
        if (-1 == lastY)
        lastY = y + clientHeight;
        hr = pRenderer->DrawToDC­(clientDC);
        BitBlt(pageDC,x,y,lastX-x,lastY-y,clientDC,2,2,SRCCOPY);
        doneY = (y==0);
        lastY = y;
        y -= clientHeight-4;
    }
    doneX = (0==x);
    lastX = x;
    x -= clientWidth-4;
}

The pageDC bitmap now holds the full image of the page and you can save
it or do anything else you want. You'll note that what I'm doing is
trying to scroll too far and letting IE scroll appropriately. Also
note that I clip a 2 pixel edge when blitting. This is from actual
testing - needed to not clip the border of the control.

Hope this helps,

David Stidolph
Austin, TX

Ask:
    Thanks for the solution, but it will unfortunately not work in my case
because the control is used by a user and can therefor not be scrolled
programmatically.

My focus now is on trying to clone the MSHTML document and then load
the clone in another hidden browser contol which I can resize to fit
the entire page and then do the rendering. The way I'm currently
cloning the document is saving the HTML to disk and then replacing all
references (images, .js, .css., ...) in the HTML document with local
ones which I have downloaded from the originating server (will do this
as a last resort), the cache or (in the cases where it's possible)
copied directly from the MSHTML document. When that is done I have a
local copy which a can browse to. Does anyone know of a better way to
clone a MSHTML document?

Answer:
    How about using a LockWindowUpdate call before the snapshot and
then unlocking it after? That way, the user never knows the WB
scrolled.

posted on 2007-10-11 23:57 brent 閱讀(1263) 評論(0)  編輯 收藏 引用 所屬分類: C++Web

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            精品成人国产| 欧美大胆a视频| 欧美主播一区二区三区| 一本一本久久a久久精品牛牛影视| 欧美成人激情视频免费观看| 91久久综合| 亚洲欧洲综合| 欧美午夜一区| 欧美一区二区三区男人的天堂| 香蕉成人久久| 亚洲成色www8888| 亚洲精品久久久久久下一站| 国产精品盗摄久久久| 久久电影一区| 麻豆精品视频在线观看视频| 一本色道久久综合狠狠躁篇的优点| 亚洲免费高清视频| 国产精品揄拍500视频| 麻豆精品视频在线观看| 欧美高清自拍一区| 欧美一区激情| 欧美高清视频在线播放| 午夜精品久久久久久久男人的天堂 | 亚洲在线播放电影| 国产亚洲一区精品| 亚洲国产日韩欧美在线99 | 亚洲美女诱惑| 国产亚洲欧洲一区高清在线观看| 亚洲电影激情视频网站| 国产伦精品一区二区三区高清版 | 99天天综合性| 在线观看国产精品淫| 亚洲一二三级电影| 亚洲精品在线视频| 久久国产精品久久久久久| 亚洲视频网在线直播| 久久午夜激情| 香蕉视频成人在线观看| 欧美黄色片免费观看| 久久久精品性| 国产精品毛片a∨一区二区三区| 欧美多人爱爱视频网站| 国产日韩欧美亚洲| 一本色道久久综合亚洲精品高清 | 欧美三日本三级三级在线播放| 麻豆成人小视频| 国产麻豆精品theporn| 亚洲精品专区| 亚洲精品在线看| 久热国产精品| 久久网站免费| 国产免费成人av| 亚洲婷婷综合久久一本伊一区| 亚洲开发第一视频在线播放| 久久综合国产精品| 久久亚洲春色中文字幕| 国产午夜精品全部视频播放| 欧美激情中文字幕一区二区 | 久久久久久久久久久久久女国产乱 | 久久精品亚洲精品国产欧美kt∨| 亚洲精品日韩在线| 久久综合九九| 欧美成人精品一区二区三区| 国产精品一区2区| 亚洲一区二区在线免费观看| 亚洲一级黄色| 国产精品女主播| 亚洲一区二区三区精品视频| 亚洲欧美在线网| 国产精品成人免费| 亚洲网站在线播放| 亚洲欧美视频一区二区三区| 国产精品你懂的在线欣赏| 亚洲一区二区三区中文字幕| 欧美一区二区精品| 国产午夜精品一区二区三区视频| 欧美一区2区三区4区公司二百| 久久影院亚洲| 日韩一级免费观看| 欧美三日本三级三级在线播放| 亚洲一区二区免费在线| 久久国产毛片| 91久久精品国产| 欧美精品 国产精品| 日韩视频一区二区| 亚欧美中日韩视频| 海角社区69精品视频| 久久久国产91| 亚洲精品在线三区| 欧美专区亚洲专区| 亚洲大胆女人| 国产精品久久久久毛片大屁完整版 | 亚洲一级高清| 久久免费视频在线| 亚洲国产影院| 欧美性猛交xxxx乱大交退制版 | 欧美华人在线视频| 中文久久精品| 国产一区二区三区四区三区四 | 欧美成人精品激情在线观看| 在线亚洲一区| 免费一级欧美片在线播放| 99这里只有久久精品视频| 国产情人节一区| 欧美精品www在线观看| 性欧美精品高清| 亚洲伦伦在线| 久久亚洲一区二区| 亚洲一区久久| 日韩视频久久| 黄色精品一二区| 亚洲毛片在线观看.| 在线天堂一区av电影| 黄色一区二区在线| 国产精品九九久久久久久久| 久久午夜视频| 午夜欧美大片免费观看| 亚洲精品小视频在线观看| 久久综合九色| 性感少妇一区| 亚洲一区二区免费看| 亚洲国产精品va在线看黑人动漫 | 国产亚洲激情| 欧美视频一区在线观看| 欧美**字幕| 久久激情视频免费观看| 亚洲在线1234| 亚洲午夜在线视频| 99ri日韩精品视频| 欧美国产乱视频| 乱中年女人伦av一区二区| 欧美在线黄色| 欧美在线视频全部完| 亚洲免费在线播放| 亚洲日韩视频| 亚洲电影免费观看高清| 国语精品中文字幕| 国产亚洲一区二区在线观看| 国产精品一区二区三区乱码| 国产精品xxx在线观看www| 欧美日本高清视频| 欧美激情成人在线视频| 欧美成年人网站| 免费日韩av电影| 欧美成人免费小视频| 欧美成人视屏| 欧美日韩一区在线| 欧美无乱码久久久免费午夜一区| 欧美日韩精品在线| 欧美婷婷在线| 国产精品三级久久久久久电影| 国产精品a级| 国产精品系列在线播放| 国产日韩专区| 亚洲国产另类久久精品| 亚洲激情图片小说视频| 亚洲精品在线视频观看| 一区二区三区av| 午夜精品一区二区三区在线视 | 性欧美1819sex性高清| 欧美一区二区视频97| 久久久91精品国产| 欧美成人国产va精品日本一级| 亚洲国产成人高清精品| 日韩午夜电影av| 亚洲欧美日本另类| 久久亚洲综合色| 欧美日韩精品三区| 国产欧美一区二区三区国产幕精品| 国产一区二区三区免费观看 | 欧美视频免费看| 国产一二三精品| 亚洲精品久久嫩草网站秘色| 亚洲一区二区三区久久| 久久精精品视频| 亚洲高清激情| 亚洲综合色激情五月| 久久夜色精品国产亚洲aⅴ| 欧美猛交免费看| 国产综合色一区二区三区| 99精品欧美一区二区蜜桃免费| 小处雏高清一区二区三区| 亚洲成人中文| 亚洲免费视频中文字幕| 免费一级欧美片在线观看| 免费亚洲电影| 欧美在线视频a| 久久综合色播五月| 国产精品久线观看视频| 亚洲国产精品第一区二区 | 国产亚洲福利社区一区| 日韩视频在线免费| 久久久亚洲午夜电影| 夜久久久久久| 免费一区二区三区| 激情婷婷久久| 欧美一区视频| 亚洲美女av黄| 美女成人午夜| 好吊成人免视频|