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

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>
            亚洲激情在线观看| 欧美jjzz| 国产午夜精品麻豆| 久久综合给合| 另类激情亚洲| 夜夜狂射影院欧美极品| 亚洲国产日韩精品| 欧美亚一区二区| 久久av二区| 久久精品主播| 亚洲美女在线视频| 久久久久久伊人| 亚洲久久一区| 国产精品白丝jk黑袜喷水| 亚洲欧美成人网| 久久国产日韩欧美| 亚洲久色影视| 亚洲一区二区三区中文字幕| 国内一区二区三区| 亚洲人成网站777色婷婷| 国产精品久久久久免费a∨大胸| 久久久久久久久久久久久9999| 免费视频一区二区三区在线观看| 亚洲色图自拍| 久久精品首页| 99国产麻豆精品| 性欧美video另类hd性玩具| 亚洲国产专区| 一区二区三区国产盗摄| 国内成+人亚洲| 亚洲精品中文字幕女同| 国产视频观看一区| 欧美日韩一区在线观看视频| 亚洲欧美成人网| 久热国产精品| 性做久久久久久免费观看欧美| 久久亚洲精品中文字幕冲田杏梨| 一区二区国产精品| 欧美中文在线观看国产| 一区二区三区视频在线观看 | 国产日韩欧美中文在线播放| 欧美国产精品一区| 国产精品中文在线| 亚洲高清色综合| 国产亚洲成精品久久| 91久久精品网| 狠狠色综合播放一区二区| 夜夜嗨av色综合久久久综合网| 一区免费在线| 亚洲在线观看视频| 亚洲美女精品成人在线视频| 久久xxxx精品视频| 亚洲午夜精品一区二区三区他趣| 久久视频国产精品免费视频在线| 一区二区三区四区五区精品| 久久综合狠狠综合久久激情| 性久久久久久久久久久久| 欧美黄污视频| 毛片一区二区三区| 国产精品资源在线观看| 亚洲精品在线视频观看| 亚洲国产国产亚洲一二三| 亚洲欧美日韩精品久久久| 一区二区三区成人| 蜜臀a∨国产成人精品| 久久激情网站| 国产精品久久久久三级| 亚洲精品日韩久久| 91久久黄色| 香蕉精品999视频一区二区| 一区二区三区四区五区精品视频| 久久久噜噜噜久久中文字幕色伊伊 | 国产深夜精品福利| 亚洲午夜女主播在线直播| 艳女tv在线观看国产一区| 麻豆91精品| 美女久久一区| 韩国免费一区| 性做久久久久久久久| 午夜精品久久| 欧美深夜福利| 亚洲伦伦在线| 99视频日韩| 欧美国产91| 欧美xxx成人| 在线观看成人一级片| 久久国产高清| 亚洲一级黄色| 欧美粗暴jizz性欧美20| 久久久人成影片一区二区三区观看 | 一区二区三区精密机械公司| 亚洲第一狼人社区| 午夜视频在线观看一区| 日韩天堂av| 久久综合激情| 久久精品一区二区国产| 欧美性猛交xxxx乱大交蜜桃| 亚洲区欧美区| 亚洲精品在线视频| 欧美激情aⅴ一区二区三区| 亚洲人成精品久久久久| 国产日韩亚洲欧美综合| 亚洲男女自偷自拍图片另类| 亚洲综合精品四区| 欧美亚日韩国产aⅴ精品中极品| 宅男噜噜噜66国产日韩在线观看| 亚洲天堂成人在线视频| 欧美午夜不卡视频| 亚洲视频高清| 欧美一区在线视频| 国产一区二区三区久久久| 欧美在线免费| 鲁大师成人一区二区三区| 尤物yw午夜国产精品视频| 久久久久久久久久久成人| 欧美mv日韩mv国产网站app| 亚洲国产日韩精品| 欧美激情黄色片| 99精品视频一区| 亚洲欧美日韩中文在线制服| 国产精品一区二区在线观看不卡 | 亚洲精品自在久久| 999在线观看精品免费不卡网站| 欧美理论在线播放| av成人免费在线| 亚洲欧美日韩国产| 国产一级揄自揄精品视频| 久久久久看片| 亚洲国产高清aⅴ视频| 一区二区三区毛片| 国产精品福利在线观看| 欧美一进一出视频| 欧美aaaaaaaa牛牛影院| 99精品视频免费| 国产精品福利影院| 久久久国产精品一区| 亚洲第一精品夜夜躁人人爽| 一区二区三区日韩欧美精品| 国产精品亚洲аv天堂网| 久久九九电影| 亚洲欧洲日产国产综合网| 亚洲欧美日韩精品一区二区| 国产一区二区三区视频在线观看| 噜噜噜躁狠狠躁狠狠精品视频 | 亚洲一区二区免费看| 久久久国产午夜精品| 亚洲国产经典视频| 欧美日韩成人网| 亚洲欧美一区二区三区在线| 美女性感视频久久久| 日韩视频免费观看| 国产精品亚洲人在线观看| 久久人人精品| 一区二区三区毛片| 狼人社综合社区| 在线性视频日韩欧美| 国产亚洲成av人片在线观看桃 | 久久精品视频一| 亚洲欧洲视频在线| 国产精品久久影院| 美国十次了思思久久精品导航| 一区二区欧美在线观看| 麻豆精品视频在线观看| 亚洲图中文字幕| 伊人男人综合视频网| 国产精品扒开腿做爽爽爽视频| 久久久人人人| 在线亚洲一区| 欧美成人国产| 香蕉久久a毛片| 亚洲精品久久久久久久久久久久久 | 亚洲欧美日韩在线不卡| 亚洲高清免费| 国产精品一区二区在线观看不卡| 欧美sm视频| 欧美一区二视频| 99国产精品久久久久久久成人热| 老司机aⅴ在线精品导航| 亚洲综合日韩在线| 亚洲国产专区校园欧美| 国产欧美日韩视频| 欧美啪啪成人vr| 久久免费视频网站| 亚洲综合视频1区| 亚洲人成网站色ww在线| 免费观看在线综合| 欧美一区在线视频| 亚洲性感美女99在线| 91久久久久久| 激情av一区| 国产欧美日韩综合| 欧美色图天堂网| 欧美丰满少妇xxxbbb| 久久精品视频一| 小处雏高清一区二区三区| 日韩亚洲欧美高清| 亚洲高清一区二| 久久最新视频| 久久av红桃一区二区小说| 亚洲在线成人|