🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: microsoft.public.inetsdk.programming.mshtml_hosting
1 messages
1 total messages Started by Ken Netherland Sat, 05 Feb 2022 03:07
Re: Help! Rendering Behaviour - IHtmlPainter
#1
Author: 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));
            }
        }
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads