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

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>
            欧美暴力喷水在线| 亚洲福利专区| 开心色5月久久精品| 在线亚洲观看| 亚洲黄色成人久久久| 欧美资源在线| 在线中文字幕一区| 亚洲精品久久久久久久久| 怡红院精品视频| 国产日韩精品视频一区| 国产精品久久国产三级国电话系列| 欧美女同视频| 欧美激情女人20p| 欧美成人一区二区在线| 玖玖国产精品视频| 久久偷窥视频| 久久亚洲综合色| 久久美女性网| 久久免费国产精品| 久久久久久一区二区三区| 欧美影片第一页| 久久精品国产一区二区三| 久久se精品一区二区| 午夜精品一区二区三区四区 | 久久精品成人一区二区三区 | 久久一区视频| 久久久五月婷婷| 久久精品欧洲| 久久色在线观看| 久久人人97超碰国产公开结果| 久久精品国产视频| 久久久国产91| 久久综合中文色婷婷| 美女视频黄免费的久久| 欧美大片在线观看| 91久久久在线| 一区二区三区www| 亚洲一区二区三区乱码aⅴ蜜桃女 亚洲一区二区三区乱码aⅴ | 91久久精品国产91性色tv| 亚洲高清av在线| 亚洲精品乱码久久久久久日本蜜臀 | 免费欧美电影| 欧美激情亚洲国产| 91久久精品一区二区别| 亚洲美女在线国产| 亚洲一区欧美一区| 欧美一区二区私人影院日本 | 欧美日韩在线综合| 国产精品久久久久久av福利软件| 国产精品区一区| 国产一区二区三区在线免费观看| 精品1区2区| 亚洲伦伦在线| 亚洲欧美日韩直播| 久热re这里精品视频在线6| 亚洲福利视频一区| 亚洲视频 欧洲视频| 欧美一区二区视频在线观看| 久久综合中文字幕| 欧美日韩免费在线观看| 国产欧美日韩在线| 亚洲高清在线精品| 亚洲一级在线| 久久青草久久| 99re热精品| 久久av一区二区三区漫画| 蜜臀99久久精品久久久久久软件| 欧美日韩国产精品专区| 国产视频久久久久久久| 亚洲精品欧美一区二区三区| 欧美亚洲免费高清在线观看| 母乳一区在线观看| 99亚洲一区二区| 久久精品国产欧美亚洲人人爽| 欧美激情综合色| 国产亚洲精品bv在线观看| 亚洲欧洲午夜| 久久国内精品视频| 亚洲精品人人| 久久久久久网站| 国产精品久久久久久福利一牛影视| 一区二区视频欧美| 亚洲欧美国产毛片在线| 欧美成人高清| 午夜精品久久久久久久99热浪潮| 欧美ed2k| 国产自产2019最新不卡| 宅男在线国产精品| 蜜桃久久av一区| 亚洲欧美日韩精品久久| 欧美精品高清视频| 在线播放中文字幕一区| 香蕉久久国产| 亚洲精品影视| 美女主播精品视频一二三四| 国产欧美日韩精品一区| 国产精品99久久99久久久二8| 老司机久久99久久精品播放免费| 一区二区三区偷拍| 欧美激情乱人伦| 激情小说另类小说亚洲欧美| 亚洲欧美激情一区二区| 亚洲国内精品| 可以免费看不卡的av网站| 国产伦精品一区二区三区高清版| 99在线精品视频在线观看| 六月婷婷久久| 欧美一区二区三区电影在线观看| 欧美视频一区二区三区…| 亚洲人成毛片在线播放| 久久综合给合久久狠狠色| 亚洲免费在线观看| 国产精品www| 亚洲视频电影图片偷拍一区| 亚洲国产精品福利| 麻豆精品在线视频| 136国产福利精品导航| 久久久久久色| 欧美在线观看视频一区二区三区| 国产精品羞羞答答xxdd| 亚洲综合三区| 一区二区日本视频| 欧美午夜精品电影| 亚洲午夜精品网| 99re66热这里只有精品3直播| 欧美片第1页综合| 夜夜狂射影院欧美极品| 欧美激情影院| 欧美成人免费网站| 亚洲欧洲一二三| 91久久亚洲| 欧美日本久久| 中文精品99久久国产香蕉| 日韩视频免费观看高清在线视频| 欧美精品一区二区三| 日韩亚洲欧美在线观看| 最新精品在线| 欧美日韩伊人| 亚洲欧美视频在线观看| 亚洲一级黄色片| 国产乱码精品一区二区三区不卡| 欧美伊人精品成人久久综合97 | 国产精品呻吟| 欧美一区二区三区四区在线| 亚洲欧美日韩久久精品| 国产亚洲一区二区在线观看| 久久日韩粉嫩一区二区三区| 久久美女性网| 日韩写真视频在线观看| 99视频+国产日韩欧美| 国产精品久久夜| 久久九九有精品国产23| 久久久久9999亚洲精品| 最新高清无码专区| 日韩午夜剧场| 国产伦精品一区二区三区高清版 | 欧美专区福利在线| 在线日本欧美| 最新热久久免费视频| 国产精品久久久久av| 久久久精品一区| 久久婷婷一区| 国产精品99久久99久久久二8| 亚洲——在线| 影音先锋亚洲一区| 亚洲精品免费在线| 国产精品尤物福利片在线观看| 久久免费视频这里只有精品| 免费在线亚洲| 亚洲免费在线观看| 久久久久久久综合| 一区二区三区色| 欧美在线亚洲综合一区| 亚洲激情在线激情| 中国女人久久久| 狠狠色综合色区| 亚洲免费观看高清完整版在线观看熊 | 久久久久久久久久码影片| 亚洲伦理在线免费看| 午夜精品视频网站| 亚洲精品乱码久久久久久黑人| 亚洲网站啪啪| 亚洲激情六月丁香| 亚洲性夜色噜噜噜7777| 在线免费精品视频| 国产精品99久久久久久久久久久久 | 欧美人体xx| 久久久精品性| 欧美日韩亚洲一区二区三区在线| 久久九九久精品国产免费直播| 欧美精品国产精品| 久久嫩草精品久久久精品| 欧美日韩亚洲成人| 免播放器亚洲一区| 国产精品久久久久久久久免费| 免费久久久一本精品久久区| 国产精品看片资源| 亚洲国产精品成人综合色在线婷婷| 国产日韩一区二区三区在线播放| 亚洲欧洲另类国产综合|