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

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 閱讀(1270) 評論(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>
            性8sex亚洲区入口| 日韩视频在线免费| 欧美尤物巨大精品爽| 99热在这里有精品免费| 国产精品福利影院| 亚洲欧美成人网| 亚洲一区欧美| 激情成人综合| 亚洲国产成人精品视频| 欧美jizzhd精品欧美喷水 | 久久色在线播放| 在线精品国精品国产尤物884a| 欧美xxx成人| 欧美人妖另类| 久久久久9999亚洲精品| 久久伊人免费视频| 一区二区三区四区五区在线 | 久热精品在线| 欧美国产日本| 亚洲欧美日韩成人| 久久久精品国产免费观看同学| 一区二区三区在线观看欧美| 欧美激情精品久久久久久久变态 | 欧美在线观看一区| 亚洲国产美女| 亚洲午夜久久久久久久久电影院| 国产视频精品va久久久久久| 欧美国产专区| 国产精品一区免费在线观看| 免费人成网站在线观看欧美高清| 欧美成人午夜剧场免费观看| 午夜一区在线| 欧美激情一区二区三区在线视频 | 亚洲激情小视频| 亚洲中午字幕| 99这里有精品| 久久亚洲国产精品一区二区| 亚洲视频电影图片偷拍一区| 久久狠狠婷婷| 久久久久**毛片大全| 中文欧美在线视频| 久久综合久久久久88| 午夜精品久久久久久久久| 免费观看在线综合色| 香蕉久久夜色精品国产| 欧美成人午夜| 欧美成人午夜77777| 国产精品一区二区三区久久久| 欧美黄色aaaa| 在线免费观看日本欧美| 亚洲欧美在线aaa| 在线亚洲欧美| 欧美激情中文字幕乱码免费| 狂野欧美激情性xxxx欧美| 国产精品美腿一区在线看 | 亚洲高清一二三区| 伊人天天综合| 久久aⅴ国产欧美74aaa| 午夜欧美不卡精品aaaaa| 欧美黑人一区二区三区| 欧美承认网站| 亚洲国产成人tv| 久久精品亚洲热| 久久久一区二区| 国产一区深夜福利| 香蕉久久a毛片| 久久久www| 黄色日韩在线| 久久久久久夜精品精品免费| 久久久久综合网| 国产综合网站| 久久青青草综合| 免费欧美在线视频| 最新国产成人av网站网址麻豆| 久久蜜桃资源一区二区老牛| 美女黄毛**国产精品啪啪| 国产亚洲欧美一区二区| 久久精品成人| 欧美电影资源| 99视频精品在线| 欧美三日本三级少妇三2023| 夜夜嗨网站十八久久| 亚洲欧美成人一区二区在线电影 | 欧美成人综合在线| 亚洲国产美女| 中国日韩欧美久久久久久久久| 欧美理论片在线观看| 日韩网站在线看片你懂的| 亚洲欧美国产va在线影院| 国产精品天美传媒入口| 欧美一区二区视频在线| 免费视频一区| 在线一区二区视频| 国产农村妇女精品| 久久精品国产一区二区电影 | 亚洲视频免费在线| 国产欧美日韩伦理| 久久躁狠狠躁夜夜爽| 亚洲精品视频免费在线观看| 亚洲专区一区二区三区| 黄色成人片子| 欧美日韩国产高清| 午夜一区在线| 亚洲黄色大片| 欧美日韩一区二区三区四区五区| 亚洲视频一区二区| 久久亚洲视频| 亚洲校园激情| 亚洲高清一二三区| 国产精品国产成人国产三级| 久久国产精品一区二区| 亚洲精品欧洲精品| 久久伊人免费视频| 亚洲伊人久久综合| 亚洲人成人77777线观看| 国产精品日本| 欧美激情在线| 久久精品国产久精国产一老狼| 日韩系列欧美系列| 欧美高清视频一二三区| 欧美中日韩免费视频| 亚洲美女毛片| 在线观看的日韩av| 国产精品永久入口久久久| 欧美精品九九99久久| 久久在线免费观看| 欧美一级在线亚洲天堂| 99国产精品国产精品久久| 欧美黄色影院| 久久久噜久噜久久综合| 亚洲欧美色婷婷| 亚洲天堂免费观看| 一区二区三区产品免费精品久久75| 国自产拍偷拍福利精品免费一| 国产精品看片资源| 欧美日韩一区二区三区在线看| 欧美成人免费网站| 卡通动漫国产精品| 久久久亚洲高清| 久久久久久自在自线| 欧美一区二区三区免费看| 亚洲综合第一页| 亚洲少妇在线| 亚洲一区二区在线免费观看| 亚洲精选大片| 一区二区冒白浆视频| 99riav国产精品| 一二三区精品| 亚洲免费影视| 亚洲免费视频网站| 亚洲女同性videos| 亚洲女性喷水在线观看一区| 亚洲欧美日韩国产中文| 欧美一区2区三区4区公司二百| 亚洲免费伊人电影在线观看av| 亚洲男同1069视频| 欧美影院久久久| 久久只有精品| 欧美另类变人与禽xxxxx| 欧美日本韩国一区| 国产精品mm| 国产婷婷精品| 亚洲高清免费视频| 欧美亚洲一级片| 久久米奇亚洲| 欧美理论在线播放| 国产精品老牛| 在线成人国产| 一区二区三区三区在线| 午夜视频精品| 蜜桃av噜噜一区| 亚洲人体大胆视频| 亚洲一区二区三区涩| 久久久久久久97| 欧美日本在线| 国产在线欧美日韩| 亚洲精品久久| 欧美亚洲综合久久| 欧美国产高清| 亚洲一区二区精品视频| 久久久久久亚洲精品杨幂换脸 | 国产精品久久91| 国产综合亚洲精品一区二| 亚洲精品一区二区三区av| 亚洲综合成人婷婷小说| 久久偷看各类wc女厕嘘嘘偷窃| 亚洲国产欧美精品| 亚洲一区二区三区四区五区午夜| 久久九九99视频| 欧美三级网址| 91久久精品国产91性色tv| 午夜久久tv| 亚洲伦理精品| 久久久久久穴| 国产精品素人视频| 一区二区三区www| 欧美www在线| 午夜精品亚洲| 国产精品久久久999| 亚洲激情图片小说视频|