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

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>
            亚洲视频免费在线| 亚洲黄色大片| 欧美一级淫片播放口| 一区二区三区 在线观看视频| 欧美日韩国产成人| 一本色道久久综合亚洲91| 夜夜嗨一区二区| 国产精品免费看片| 久久婷婷国产综合国色天香| 久久久久久一区二区三区| 亚洲第一在线| 亚洲九九九在线观看| 国产精品久久999| 久久综合导航| 欧美色网在线| 久久久久久亚洲精品中文字幕| 久久久久女教师免费一区| 亚洲激情电影在线| 在线亚洲+欧美+日本专区| 国产日韩欧美在线看| 久热这里只精品99re8久| 宅男66日本亚洲欧美视频| 亚洲网站在线看| 伊人精品成人久久综合软件| 亚洲欧洲久久| 国产精品入口福利| 欧美国产在线电影| 国产视频观看一区| 亚洲日本aⅴ片在线观看香蕉| 国产精品乱人伦一区二区| 欧美va亚洲va香蕉在线| 国产精品日韩二区| 亚洲电影免费| 国际精品欧美精品| 中国日韩欧美久久久久久久久| 黄色精品免费| 亚洲免费一在线| 99亚洲视频| 久久免费视频这里只有精品| 亚洲欧美在线看| 欧美人体xx| 亚洲国产乱码最新视频| 精品动漫av| 午夜精品久久久久久久99黑人| 亚洲免费观看在线视频| 久久久久久色| 老色批av在线精品| 国产亚洲精品高潮| 亚洲午夜在线| 亚洲一级一区| 欧美三级不卡| 91久久精品一区二区三区| 在线精品国精品国产尤物884a| 亚洲欧美大片| 午夜精品久久久久久久99樱桃 | 久久精品成人| 欧美在线免费看| 国产精品美女久久久久久免费| 亚洲精品美女免费| 亚洲日韩成人| 欧美激情一区二区三区在线视频观看| 久久野战av| 在线观看中文字幕亚洲| 久久精品成人一区二区三区蜜臀| 欧美一级视频一区二区| 国产精品综合不卡av| 亚洲深夜av| 午夜精品影院| 国产午夜亚洲精品不卡| 欧美一区二区三区的| 久久精品一区二区三区不卡牛牛| 国产婷婷色一区二区三区在线| 一本综合精品| 亚洲欧美日韩综合国产aⅴ| 欧美日韩综合网| 亚洲宅男天堂在线观看无病毒| 亚洲性视频h| 欧美三级欧美一级| 中文国产亚洲喷潮| 欧美一区二区三区另类| 国产乱子伦一区二区三区国色天香 | 亚洲精品一区中文| 日韩午夜免费视频| 欧美日产一区二区三区在线观看| 99热这里只有成人精品国产| 亚洲一区二区三区午夜| 国产视频精品免费播放| 久久精品女人的天堂av| 亚洲高清不卡在线| 日韩小视频在线观看专区| 欧美日韩亚洲综合一区| 午夜老司机精品| 美女国产一区| 一本到高清视频免费精品| 欧美四级在线| 亚洲欧美一区在线| 久久在线免费观看| 亚洲精品欧美日韩专区| 国产精品二区三区四区| 久久精品国产亚洲一区二区三区| 免费在线观看一区二区| 亚洲性线免费观看视频成熟| 国产三级欧美三级日产三级99| 老鸭窝亚洲一区二区三区| 亚洲美女在线一区| 老色鬼精品视频在线观看播放| 99re6热在线精品视频播放速度 | 欧美在线看片| 亚洲人成网站在线播| 性久久久久久| 91久久嫩草影院一区二区| 国产欧美日韩综合一区在线播放| 欧美成人官网二区| 先锋资源久久| 日韩一二三在线视频播| 你懂的国产精品| 久久精品国产久精国产一老狼| aa级大片欧美三级| 亚洲高清色综合| 国产日本欧美视频| 欧美视频观看一区| 蜜桃av噜噜一区| 久久久99国产精品免费| 亚洲欧美精品中文字幕在线| 亚洲精品一区二区三区婷婷月 | 久久在线免费观看视频| 亚洲伦理久久| 久久亚洲高清| 午夜亚洲性色福利视频| 宅男精品导航| 亚洲午夜一级| 中文高清一区| 亚洲午夜久久久| 夜夜嗨网站十八久久| 亚洲欧洲一区二区三区| 亚洲高清在线观看一区| 黄色成人av网站| 国内久久视频| 国产亚洲毛片在线| 国产欧美一区视频| 国产欧美高清| 国产一二精品视频| 国产偷国产偷精品高清尤物| 国产一区二区看久久| 国产亚洲福利一区| 国产专区欧美精品| 国产亚洲欧洲997久久综合| 国产日韩欧美日韩大片| 国产欧美三级| 黄色精品在线看| 亚洲电影免费观看高清| 亚洲精品乱码久久久久久蜜桃91 | 老色批av在线精品| 免费久久99精品国产自在现线| 裸体一区二区| 欧美日韩国产小视频在线观看| 欧美日韩在线播放三区| 国产精品视频1区| 国内精品免费午夜毛片| 伊人久久综合| 一本大道av伊人久久综合| 亚洲女性喷水在线观看一区| 欧美一区二区三区在| 久久久www| 亚洲国产裸拍裸体视频在线观看乱了中文| 亚洲二区三区四区| 99re热这里只有精品免费视频| 亚洲视屏在线播放| 欧美在线日韩精品| 欧美成人亚洲| 国产精品理论片| 伊人蜜桃色噜噜激情综合| 日韩午夜视频在线观看| 欧美一二三视频| 欧美不卡高清| 亚洲视频在线观看一区| 久久久久久欧美| 国产精品超碰97尤物18| 狠狠色丁香婷婷综合| 99精品视频免费观看视频| 欧美一级视频免费在线观看| 亚洲电影观看| 欧美一区国产二区| 欧美日韩岛国| 红桃视频成人| 亚洲欧美视频一区| 模特精品在线| 亚洲欧美激情一区| 欧美黄色片免费观看| 国产在线不卡精品| 亚洲视频www| 欧美黄色一级视频| 欧美在线视频一区二区| 欧美日韩在线直播| 亚洲黄色影片| 久久躁狠狠躁夜夜爽| 亚洲自拍16p| 欧美三级在线视频| 亚洲激情一区| 蜜桃av噜噜一区|