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

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>
            久久偷看各类wc女厕嘘嘘偷窃| 久久婷婷国产麻豆91天堂| 欧美日韩精品三区| 正在播放亚洲| 亚洲自拍偷拍一区| 国产午夜精品理论片a级大结局| 欧美在线一二三四区| 亚洲欧美在线网| 国产在线视频不卡二| 免费成人性网站| 欧美福利视频网站| 午夜精品久久| 久久影院亚洲| 亚洲综合导航| 久久久夜夜夜| 日韩亚洲国产欧美| 午夜精彩国产免费不卡不顿大片| 国产揄拍国内精品对白| 欧美a级片网| 国产精品99一区二区| 久久久久九九视频| 欧美黄色免费网站| 久久精品国产综合| 欧美国产精品va在线观看| 亚洲欧美在线x视频| 久久久久久久久久久久久久一区| 亚洲精品免费一区二区三区| 亚洲一区三区电影在线观看| 亚洲高清一二三区| 中文欧美字幕免费| 亚洲国产影院| 亚洲免费影视第一页| 亚洲精品黄网在线观看| 午夜久久一区| 亚洲一区二区三区四区在线观看| 久久黄色网页| 欧美一级片一区| 欧美精品三级| 免费日韩一区二区| 国产精品热久久久久夜色精品三区| 欧美.日韩.国产.一区.二区| 国产精品一卡二| 亚洲三级影院| 亚洲国产另类久久久精品极度| 亚洲视频一区二区在线观看| 亚洲国语精品自产拍在线观看| 香蕉亚洲视频| 欧美在线视频在线播放完整版免费观看 | 最近中文字幕mv在线一区二区三区四区 | 午夜久久一区| 欧美日韩国产精品专区 | 午夜欧美视频| 欧美日韩精品免费看| 欧美黑人在线播放| 亚洲第一伊人| 久久久综合网站| 另类专区欧美制服同性| 国产欧美一区二区精品秋霞影院| 亚洲级视频在线观看免费1级| 曰韩精品一区二区| 久久精品亚洲一区| 久久久国产一区二区三区| 国产喷白浆一区二区三区| 亚洲视频碰碰| 香蕉亚洲视频| 国产免费成人av| 小黄鸭精品aⅴ导航网站入口| 久久xxxx| 国内精品亚洲| 久久性色av| 亚洲国产老妈| 一区二区三区欧美| 欧美少妇一区二区| 亚洲性夜色噜噜噜7777| 亚洲欧美另类国产| 国产视频一区欧美| 久久久久一区二区三区四区| 老牛嫩草一区二区三区日本| 在线观看一区视频| 农村妇女精品| 一本一本久久a久久精品综合麻豆| 亚洲欧美日韩综合一区| 国产精品视频一二三| 欧美亚洲三区| 欧美不卡一卡二卡免费版| 亚洲欧洲综合| 欧美视频精品一区| 欧美在线观看日本一区| 欧美~级网站不卡| 一区二区三区免费在线观看| 国产精品自在在线| 久久一二三四| 一本到12不卡视频在线dvd| 久久精品国产99国产精品澳门| 在线观看国产精品淫| 欧美黄色成人网| 亚洲无限av看| 欧美成人一区二区在线| 中文网丁香综合网| 国内视频一区| 欧美日韩在线播放一区| 久久精品久久99精品久久| 亚洲国产mv| 久久精品一区四区| 一区二区三区视频在线 | 欧美日韩三区| 欧美诱惑福利视频| 亚洲人成网站999久久久综合| 欧美在线观看一区二区| 亚洲精品在线三区| 国产亚洲精品久| 欧美日韩小视频| 免费观看不卡av| 亚洲欧美日韩一区在线| 亚洲人成7777| 狼人社综合社区| 亚洲尤物在线| 99国产精品久久| 亚洲福利视频三区| 国产精品实拍| 欧美日韩调教| 欧美久久99| 欧美成人官网二区| 久久精品视频网| 欧美亚洲在线播放| 亚洲小说欧美另类婷婷| 亚洲美女免费精品视频在线观看| 蜜桃久久av一区| 久久久久国产一区二区| 性欧美暴力猛交另类hd| 亚洲天堂男人| 亚洲图片你懂的| 日韩一级精品视频在线观看| 一区二区亚洲欧洲国产日韩| 国产色产综合色产在线视频| 国产精品乱子久久久久| 欧美深夜影院| 国产精品国码视频| 国产精品久久77777| 欧美午夜剧场| 国产精品久久久久高潮| 国产精品高精视频免费| 欧美午夜宅男影院| 国产精品久久97| 国产麻豆视频精品| 国产日韩精品在线| 国产一区二区成人久久免费影院| 国产日韩欧美麻豆| 好吊妞**欧美| 亚洲国产一区二区三区a毛片| 亚洲电影在线播放| 亚洲第一精品在线| 亚洲品质自拍| 一区二区激情小说| 亚洲男人天堂2024| 久久高清免费观看| 久久综合中文| 91久久精品一区二区三区| 亚洲卡通欧美制服中文| 99精品国产在热久久婷婷| 亚洲小说春色综合另类电影| 亚洲欧美精品| 老牛影视一区二区三区| 欧美日韩国产成人在线观看| 欧美性猛交xxxx乱大交退制版| 国产精品毛片大码女人| 韩日午夜在线资源一区二区| 亚洲国产日韩欧美在线动漫| 中日韩午夜理伦电影免费| 欧美在线国产| 欧美成人精品| 亚洲一区二区动漫| 老巨人导航500精品| 欧美视频一区二区三区…| 国产一区二区黄| 亚洲精品一区二区三区av| 亚洲综合丁香| 麻豆精品网站| 一区二区三区欧美亚洲| 久久久久久9| 欧美午夜电影在线| 亚洲大片免费看| 香港成人在线视频| 亚洲黄网站在线观看| 亚洲在线免费观看| 欧美大香线蕉线伊人久久国产精品| 欧美香蕉大胸在线视频观看| 在线观看日韩专区| 香蕉久久精品日日躁夜夜躁| 亚洲电影免费| 久久aⅴ乱码一区二区三区| 欧美精品福利| 在线观看亚洲专区| 久久国产加勒比精品无码| 亚洲激情在线观看| 麻豆91精品| 激情自拍一区| 久久久久免费观看| 亚洲欧美美女| 国产精品久久久久久五月尺|