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

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>
            欧美国产亚洲精品久久久8v| 1000部国产精品成人观看| 99视频超级精品| 亚洲国产成人tv| 牛牛影视久久网| 欧美a级在线| 亚洲国产精品va在线看黑人| 亚洲国产精品高清久久久| 亚洲二区在线观看| 亚洲精品中文字幕在线观看| 99热免费精品| 午夜精品区一区二区三| 久久精品一二三区| 欧美成人免费播放| 国产精品久久久久久久久果冻传媒| 国产精品一区久久| 亚洲成在人线av| 一本色道综合亚洲| 久久精品91久久香蕉加勒比 | 欧美看片网站| 国产精品久久久亚洲一区| 国产又爽又黄的激情精品视频| 欧美韩日一区二区| 最新精品在线| 亚洲一区二区三区涩| 久久久久久69| 亚洲精品极品| 久久精品国产精品亚洲| 欧美日韩福利| 国产自产2019最新不卡| 正在播放亚洲| 欧美激情影音先锋| 欧美亚洲在线播放| 欧美日韩在线播放三区四区| 狠狠狠色丁香婷婷综合久久五月| 日韩小视频在线观看| 久久久天天操| 亚洲在线观看视频网站| 欧美女同视频| 亚洲免费观看高清在线观看| 久久一本综合频道| 亚洲一区视频在线| 欧美激情综合色| 亚洲人成网站精品片在线观看| 久久国产日韩欧美| 一本色道久久88精品综合| 牛人盗摄一区二区三区视频| 黄色成人在线观看| 久久九九热re6这里有精品| 一区二区激情小说| 欧美日韩一级黄| 9色精品在线| 亚洲国产一区二区精品专区| 麻豆视频一区二区| 伊人激情综合| 美女日韩在线中文字幕| 久久精品国产99| 黑人一区二区| 乱人伦精品视频在线观看| 欧美在线一二三区| 国产在线精品二区| 久久亚洲影院| 老司机精品视频一区二区三区| 伊人色综合久久天天| 免费一级欧美在线大片| 久热精品视频在线观看一区| 在线不卡中文字幕播放| 欧美激情国产精品| 欧美77777| 一区二区欧美日韩| 亚洲亚洲精品在线观看| 国产免费亚洲高清| 久久久久久久久久久久久久一区| 午夜视频一区二区| 国产一区二区三区网站| 久久综合狠狠综合久久综青草 | 欧美国产精品劲爆| 欧美二区视频| 亚洲午夜激情在线| 亚洲欧美偷拍卡通变态| 洋洋av久久久久久久一区| 欧美在线视频一区二区| 经典三级久久| 亚洲国产清纯| 国产精品乱人伦一区二区| 欧美中文字幕在线| 看片网站欧美日韩| 亚洲最新视频在线| 亚洲一区综合| 亚洲黄色免费| 亚洲午夜精品17c| 曰本成人黄色| 日韩亚洲视频| 激情综合中文娱乐网| 亚洲精品国久久99热| 国产精品美女999| 麻豆国产精品va在线观看不卡| 欧美激情网站在线观看| 久久精品国产999大香线蕉| 欧美aⅴ99久久黑人专区| 亚洲欧美在线高清| 欧美福利视频在线观看| 久久激情一区| 欧美天堂亚洲电影院在线观看| 久久人91精品久久久久久不卡 | 国产一区二区精品丝袜| 亚洲国产成人久久综合| 国产日韩精品一区二区三区| 亚洲丰满在线| 国内精品久久久久久影视8| 99精品免费视频| 91久久精品国产91久久性色tv| 午夜精品免费在线| 亚洲欧美另类在线观看| 欧美福利一区二区| 男男成人高潮片免费网站| 国产日韩欧美另类| 亚洲视频在线一区观看| 99精品国产99久久久久久福利| 欧美伊久线香蕉线新在线| 亚洲午夜国产成人av电影男同| 开心色5月久久精品| 久久久久久色| 国产一区二区精品久久| 亚洲天堂成人在线视频| 亚洲天堂网在线观看| 欧美激情网友自拍| 亚洲高清久久| 亚洲美女91| 欧美激情一区二区在线 | 欧美激情一区二区三区全黄| 国产亚洲激情在线| 午夜精品理论片| 性欧美大战久久久久久久久| 欧美日韩中文字幕精品| 日韩视频在线观看| 亚洲视频欧洲视频| 欧美三级日本三级少妇99| 99国产精品99久久久久久粉嫩| 亚洲免费观看在线视频| 欧美日韩国产一区二区| 夜夜嗨一区二区| 午夜精品亚洲| 国产在线视频欧美一区二区三区| 亚洲欧美成人网| 亚洲综合日本| 久久精品国产综合精品| 韩国成人理伦片免费播放| 久久免费视频在线观看| 欧美国产日韩视频| 亚洲伦理在线免费看| 欧美视频在线观看一区| 亚洲一区成人| 久久国产66| 亚洲福利免费| 欧美日韩国产bt| 亚洲综合色噜噜狠狠| 久热爱精品视频线路一| 日韩视频不卡| 国产欧美午夜| 欧美大片免费看| 亚洲午夜精品久久久久久浪潮| 欧美在线精品一区| 亚洲福利国产| 国产精品国产一区二区| 久久国产88| 日韩西西人体444www| 欧美一区二区三区在线播放| 在线成人激情黄色| 欧美人与性动交a欧美精品| 亚洲一区二区三区视频| 欧美+亚洲+精品+三区| 亚洲小说欧美另类婷婷| 黄色av日韩| 欧美系列电影免费观看| 久久久久久久精| 亚洲视频在线视频| 欧美国产视频在线观看| 久久国产精品久久久久久| 亚洲人成欧美中文字幕| 国产欧美精品日韩区二区麻豆天美 | 亚洲一区二区三区四区五区午夜| 久久久久久久综合| 一本色道久久| 在线播放国产一区中文字幕剧情欧美| 欧美激情久久久久久| 欧美一区二区精品| 一本色道久久综合亚洲精品婷婷| 久久久久久亚洲精品杨幂换脸 | 亚洲黄色免费电影| 国产精品视频在线观看| 麻豆精品在线视频| 香蕉久久夜色精品| 亚洲视频一区| 亚洲欧洲美洲综合色网| 久久综合国产精品| 欧美一区二区三区在线播放| 一本色道久久加勒比88综合| 在线观看亚洲| 狠狠色综合色综合网络|