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

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>
            亚洲日本视频| 免费成人激情视频| 久久精品一区二区| 亚洲欧美日韩国产综合在线| 亚洲日韩欧美视频一区| 99精品欧美一区二区蜜桃免费| 日韩视频中文字幕| 午夜在线视频一区二区区别| 久久国产天堂福利天堂| 欧美xxxx在线观看| 亚洲精品中文字幕有码专区| 亚洲一区二区在线免费观看视频 | 亚洲国产免费| 亚洲国产欧美国产综合一区| 99av国产精品欲麻豆| 亚洲男女自偷自拍图片另类| 久久久久久69| 欧美日韩亚洲一区二区| 国产欧美一区二区三区在线老狼| 狠狠干成人综合网| 亚洲午夜精品网| 欧美freesex8一10精品| 亚洲无限av看| 欧美jizzhd精品欧美喷水| 国产精品美女视频网站| 亚洲国产精品999| 一区二区av| 亚洲高清资源| 亚洲欧美一区在线| 欧美二区不卡| 精品成人a区在线观看| 亚洲一区成人| 亚洲国产精品一区制服丝袜| 性做久久久久久久免费看| 欧美日韩国产高清视频| 亚洲福利视频专区| 欧美与黑人午夜性猛交久久久| 亚洲国产成人91精品| 欧美中文在线观看国产| 欧美视频在线观看免费网址| 亚洲精品日本| 欧美电影免费观看网站| 久久精品视频va| 国产亚洲永久域名| 欧美亚洲视频在线看网址| 日韩图片一区| 欧美日韩在线播| 一区二区三区免费网站| 亚洲人成小说网站色在线| 免费不卡在线视频| 亚洲国产女人aaa毛片在线| 卡一卡二国产精品| 久久精品伊人| 精品av久久707| 蜜桃av噜噜一区| 久久人人爽人人爽爽久久| 韩国三级电影久久久久久| 久久夜色精品国产噜噜av| 欧美一区永久视频免费观看| 国产亚洲欧美日韩在线一区 | 欧美制服丝袜第一页| 亚洲一区二区在| 国产女主播一区二区| 久久久久成人精品免费播放动漫| 亚洲欧美日韩精品在线| 国产一区二区视频在线观看 | 蜜乳av另类精品一区二区| 亚洲欧美日韩中文在线制服| 国产精品自拍一区| 久久精品91久久香蕉加勒比| 欧美一区三区二区在线观看| 激情成人综合网| 亚洲成人在线视频播放| 欧美日韩国产免费| 午夜精品视频一区| 久久国产精品久久久| 91久久国产精品91久久性色| 亚洲精品一区中文| 国产欧美一区二区三区视频| 美日韩丰满少妇在线观看| 欧美电影免费观看网站| 亚洲一线二线三线久久久| 欧美一区二区精品在线| 久久高清国产| 一本一本a久久| 国产一区二区在线观看免费播放| 久久影院亚洲| 欧美乱妇高清无乱码| 欧美一区亚洲二区| 免费欧美日韩| 欧美在线影院| 欧美极品影院| 久久乐国产精品| 欧美伦理a级免费电影| 久久精品国产亚洲a| 欧美理论电影在线播放| 久久久久国产精品麻豆ai换脸| 欧美大香线蕉线伊人久久国产精品| 午夜激情亚洲| 欧美精品在线一区二区| 久久午夜激情| 欧美三级电影精品| 亚洲第一在线综合在线| 国产精品系列在线播放| 最新中文字幕亚洲| 黄色精品一区| 亚洲欧美综合网| 亚洲一区二区高清| 男人天堂欧美日韩| 久久精品一区二区| 欧美亚洲第一页| 亚洲精品永久免费| 亚洲美女av黄| 欧美成人免费全部观看天天性色| 久久久精品久久久久| 国产精品视频久久久| 一本色道综合亚洲| 亚洲小说欧美另类社区| 欧美日韩国产精品| 亚洲九九精品| 一区二区三区国产精品| 欧美精品一区在线发布| 亚洲国产裸拍裸体视频在线观看乱了中文| 国产欧美综合在线| 亚洲永久精品国产| 亚洲欧美一区二区三区在线| 欧美日韩人人澡狠狠躁视频| 亚洲国产婷婷| 亚洲国产精品久久久久秋霞不卡 | 欧美日韩大陆在线| 亚洲激情中文1区| 91久久线看在观草草青青| 久久久国产一区二区三区| 久久精品夜色噜噜亚洲aⅴ| 国产精品日韩精品欧美在线| 在线视频欧美一区| 亚洲欧美日韩区| 国产精品视频在线观看| 亚洲一区精品视频| 欧美伊人久久久久久午夜久久久久 | 国产在线麻豆精品观看| 久久高清福利视频| 麻豆精品一区二区综合av| 美乳少妇欧美精品| 亚洲成色777777在线观看影院| 欧美自拍偷拍午夜视频| 久久久精品日韩| 亚洲国产高清一区| 欧美韩国一区| 日韩亚洲欧美精品| 午夜国产一区| 精品99一区二区三区| 欧美成人国产| 在线亚洲免费| 老妇喷水一区二区三区| 亚洲精品日韩综合观看成人91| 欧美激情区在线播放| 中日韩高清电影网| 久久精品国产99精品国产亚洲性色| 国产有码一区二区| 欧美99久久| 亚洲欧美另类中文字幕| 欧美a级一区| 亚洲专区一区| 亚洲国产高清在线| 国产精品免费一区豆花| 欧美在线观看视频| 亚洲国产欧美日韩| 欧美亚洲视频| 亚洲理伦在线| 国产亚洲精品久久久久久| 蜜臀久久99精品久久久画质超高清| 亚洲精品永久免费| 久久伊人亚洲| 亚洲与欧洲av电影| 亚洲激情一区| 国产日韩一区二区| 欧美日韩精品在线| 久久久www免费人成黑人精品| 亚洲乱码国产乱码精品精可以看 | 久久蜜臀精品av| 在线视频亚洲一区| 在线观看亚洲精品| 国产精品一区二区三区乱码 | 亚洲精品中文字幕在线| 久久综合福利| 欧美一区二区三区在| 亚洲精品女av网站| 在线观看国产一区二区| 国产精品日韩精品欧美精品| 欧美高清视频一区二区三区在线观看| 亚洲一区二区三区四区五区黄| 亚洲国产精品99久久久久久久久| 久久成人综合视频| 亚洲一区美女视频在线观看免费| 亚洲成人中文| 极品少妇一区二区三区| 国产婷婷色综合av蜜臀av| 国产精品激情偷乱一区二区∴| 欧美片在线播放|