🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: microsoft.public.inetsdk.programming.mshtml_hosting
Article #1

Re: Help! Rendering Behaviour - IHtmlPainter

#1
From: Ken Netherland
Date: Sat, 05 Feb 2022 03:07
94 lines
5110 bytes
On Tuesday, October 24, 2000 at 12:00:00 AM UTC-7, Thomas Goetz wrote:
> Hi,
> i have the same problem: I want to render a html-page to a D3D-surface or at
> least to a bitmap. The IHtmlPainter-interface sounds interresting. But wait
> a minute - it seems only to work in the wrong direction: i am not interested
> in drawing to a webpage using a bitmap or a D3D-surface! I want to draw the
> whole webpage to a D3D-surface or a bitmap! Do you see a way to do that?
> Currently i use MSHTML to render to a bitmap using IViewObject::Draw ( just
> like printing ), but that is complicated and slow - but it works. I don't
> know if it works with a D3D-surface instead of a bitmap - can you tell me?
> About your compiling problem: Have you included the header and libs of
> ie5.5? And have you changed the order of the include- and lib-directories?
> It is described at
> http://msdn.microsoft.com/downloads/samples/internet/libraries/ie55_lib/samp
> le.asp.
> If you find a solution to our common problem, please let me know!
> Thomas
> "Sophia Liu" <sl...@oncable.com> wrote in message
> news:u5B5xDf...@cppssbbsa02.microsoft.com...
> >
> > To be more exact, I am looking into how I can get the html page render
> onto
> > a supplied DirectDraw surface or bitmp instead of onto a browser.
> >
> > Am I looking into the right direction by investigating into MSHTML?
> >
> > Sophia
> >
> > "Sophia Liu" <sl...@oncable.com> wrote in message
> > news:OMGp4reOAHA.244@cppssbbsa04...
> > > Hi,
> > >
> > > Has anybody ever used IHtmlPainter to change the render behavior? I am
> > > hoping to get the MSHTML to draw itself using DirectDraw, onto a
> > > directdrawsurface.
> > >
> > > I have downloaded the sample from
> > >
> >
> http://msdn.microsoft.com/Downloads/samples/Internet/ie55/RenderBehave/sampl
> > > e.asp but could not get it compiled. Mshtml.h and mshtmlid.h are
> included
> > > in the precompiled header as instructed. But I still got the following
> > > errors...
> > >
> > >
> >
> d:\samplecodes\renderingbehaviors\downloads\samples\internet\browser\renderb
> > > ehave\renderproject\behavior.h(20) : error C2504: 'IElementBehavior' :
> > base
> > > class undefined
> > > error C2504: 'IHTMLPainter' : base class undefined
> > > error C2065: 'IElementBehaviorSite' : undeclared identifier
> > > error C2955: 'CComPtr' : use of class template requires template
> argument
> > > list
> > > e:\microsoft visual studio\vc98\atl\include\atlbase.h(563) : see
> > > declaration of 'CComPtr'
> > > fatal error C1903: unable to recover from previous error(s); stopping
> > > compilation
> > > Render.cpp
> > > error C2504: 'IElementBehavior' : base class undefined
> > > error C2504: 'IHTMLPainter' : base class undefined
> > > error C2065: 'IElementBehaviorSite' : undeclared identifier
> > > error C2955: 'CComPtr' : use of class template requires template
> argument
> > > list
> > > e:\microsoft visual studio\vc98\atl\include\atlbase.h(563) : see
> > > declaration of 'CComPtr'
> > > fatal error C1903: unable to recover from previous error(s); stopping
> > > compilation
> > > Generating Code...
> > > Error executing cl.exe.
> > >
> > > Render.dll - 20 error(s), 0 warning(s)
> > >
> > > Thanks in advance for any help
> > > Sophia
> > >
> > >
> > >
> >
> >

        public unsafe void Draw(tagRECT rcBounds, tagRECT rcUpdate, int lDrawFlags, ref _RemotableHandle hdc, IntPtr pvDrawObject)
        {
            fixed (_RemotableHandle* phdc = &hdc)
            {
                IntPtr hdcDraw = (IntPtr) phdc;
                var graphics = Graphics.FromHdc(hdcDraw);

                graphics.FillRectangle(Brushes.Red, new RectangleF(rcBounds.left, rcBounds.top, rcBounds.right - rcBounds.left, rcBounds.bottom - rcBounds.top));
            }
        }
Technical Details
Message-ID: <3cc2bad7-a8a4-49b4-8f4c-5e5bb360906en@googlegroups.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!archive!apf1.newsdeef.eu!not-for-mail
References: <OMGp4reOAHA.244@cppssbbsa04> <u5B5xDfOAHA.216@cppssbbsa02.microsoft.com> <8t3rrv$vq2$02$1@news.t-online.com>#1/1>

Show Full Headers
Complete Article Headers
Message-ID: <3cc2bad7-a8a4-49b4-8f4c-5e5bb360906en@googlegroups.com>
Subject: Re: Help! Rendering Behaviour - IHtmlPainter
Date: Sat, 05 Feb 2022 03:07:10 +0000
From: Ken Netherland <ken.l.netherland@gmail.com>
References: <OMGp4reOAHA.244@cppssbbsa04> <u5B5xDfOAHA.216@cppssbbsa02.microsoft.com> <8t3rrv$vq2$02$1@news.t-online.com>#1/1>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!i2pn2.pugleaf.net!archive.newsdeef.eu!archive!apf1.newsdeef.eu!not-for-mail
X-Received: by 2002:ac8:5711:: with SMTP id 17mr1429084qtw.287.1644030431248; Fri, 04 Feb 2022 19:07:11 -0800 (PST)
X-Received: by 2002:a81:d06:: with SMTP id 6mr2072962ywn.147.1644030430909; Fri, 04 Feb 2022 19:07:10 -0800 (PST)
Newsgroups: microsoft.public.inetsdk.programming.mshtml_hosting
In-Reply-To: <8t3rrv$vq2$02$1@news.t-online.com>#1/1>
Injection-Info: google-groups.googlegroups.com; posting-host=68.98.211.245; posting-account=XcMwvQoAAADIQomSfhYDA00SRkdrZh3N
Nntp-Posting-Host: 68.98.211.245
User-Agent: G2/1.0
Mime-Version: 1.0
Injection-Date: Sat, 05 Feb 2022 03:07:11 +0000
Content-Type: text/plain; charset="UTF-8"
Lines: 93