Hi Chad,
the only solution I have is to capture the Control of eg Internet Explorer
that display the web page and save it.. Here's a snibbit:
[DllImport("User32.DLL")]
public static extern IntPtr GetActiveWindow ( );
[DllImport("gdi32.dll")]
private static extern bool BitBlt(IntPtr hdcDest,int nXDest,int nYDest,int
nWidth,int nHeight,IntPtr hdcSrc,int nXSrc,int nYSrc,System.Int32 dwRop);
[DllImport("User32.dll")]
public extern static System.IntPtr GetDC(System.IntPtr hWnd);
[DllImport("User32.dll")]
public extern static int ReleaseDC(System.IntPtr hWnd, System.IntPtr hDC);
//modified to include hWnd
private void Capture()
{
IntPtr hWnd = GetActiveWindow();
Form frm = (Form)Form.FromHandle(hWnd);
if(frm != null)
{
Control c = frm.ActiveControl;
if(c != null)
{
System.IntPtr srcDC = GetDC(c.Handle);
Bitmap bm = new Bitmap(c.Width,c.Height);
Graphics g = Graphics.FromImage(bm);
System.IntPtr bmDC = g.GetHdc();
BitBlt(bmDC,0,0,bm.Width,bm.Height,srcDC,0,0,0x00C C0020 /*SRCCOPY*/);
ReleaseDC(c.Handle, srcDC);
g.ReleaseHdc(bmDC);
g.Dispose();
bm.Save([FILENAME]);
}
}
}
Regards,
Munir Husseini
iCOMcept GmbH
www.icomcept.com
"Chad A. Beckner" <Ch*********@ProspectiveLink.com> schrieb im Newsbeitrag
news:uu*************@TK2MSFTNGP10.phx.gbl...
Hey all,
I know this has been done using C++ (I have one with source code), but I
don't know C++ that well. Does anyone know of a C++ to C# converter? -
OR - does anyone know to to retrieve a web page as an image (not get an
image from a web page)? I need to do this for an application I am working
on (non-comercial) and can't seem to find any code or hints on how to do
this.
Thanks for any help!
Chad