473,321 Members | 1,877 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

HELP! Need to convert HTML Page To image

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
Nov 16 '05 #1
5 4061
Chad,

If you have C++ code, thats enough to use it in C#. Couple of ways to try
that

1. Use Dll import and try to get the access to function
2. Or register it as COM and add a reference to c# project
3. Or you can code as Unsafe c#

--
Shak
(Houston)
"Chad A. Beckner" <Ch*********@ProspectiveLink.com> wrote in message
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

Nov 16 '05 #2
The problem is that I can't use the C++ implementation of it, I *must* have
a C# or VB .NET version of it (sorry).

Chad

"Shakir Hussain" <sh**@fakedomain.com> wrote in message
news:e1**************@TK2MSFTNGP11.phx.gbl...
Chad,

If you have C++ code, thats enough to use it in C#. Couple of ways to try
that

1. Use Dll import and try to get the access to function
2. Or register it as COM and add a reference to c# project
3. Or you can code as Unsafe c#

--
Shak
(Houston)
"Chad A. Beckner" <Ch*********@ProspectiveLink.com> wrote in message
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


Nov 16 '05 #3
P.S. The file is an exe file, I at least need it to be a .dll file.

Thanks!

"Chad A. Beckner" <Ch*********@ProspectiveLink.com> wrote in message
news:Ot**************@TK2MSFTNGP11.phx.gbl...
The problem is that I can't use the C++ implementation of it, I *must* have a C# or VB .NET version of it (sorry).

Chad

"Shakir Hussain" <sh**@fakedomain.com> wrote in message
news:e1**************@TK2MSFTNGP11.phx.gbl...
Chad,

If you have C++ code, thats enough to use it in C#. Couple of ways to try
that

1. Use Dll import and try to get the access to function
2. Or register it as COM and add a reference to c# project
3. Or you can code as Unsafe c#

--
Shak
(Houston)
"Chad A. Beckner" <Ch*********@ProspectiveLink.com> wrote in message
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#
onverter? - 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



Nov 16 '05 #4
Chad,

If you have source code available in C++, its better you convert exe to dll.

If you just have exe, and if it accepts command line arguments, you can
still launch it in hidden mode using Process class.

--
Shak
(Houston)


"Chad A. Beckner" <Ch*********@ProspectiveLink.com> wrote in message
news:Ot**************@TK2MSFTNGP11.phx.gbl...
The problem is that I can't use the C++ implementation of it, I *must* have a C# or VB .NET version of it (sorry).

Chad

"Shakir Hussain" <sh**@fakedomain.com> wrote in message
news:e1**************@TK2MSFTNGP11.phx.gbl...
Chad,

If you have C++ code, thats enough to use it in C#. Couple of ways to try
that

1. Use Dll import and try to get the access to function
2. Or register it as COM and add a reference to c# project
3. Or you can code as Unsafe c#

--
Shak
(Houston)
"Chad A. Beckner" <Ch*********@ProspectiveLink.com> wrote in message
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#
onverter? - 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



Nov 16 '05 #5
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

Nov 16 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Dave | last post by:
After following Microsofts admonition to reformat my system before doing a final compilation of my app I got many warnings/errors upon compiling an rtf file created in word. I used the Help...
2
by: Sudheer Kareem | last post by:
Dear All Please tell me how to assosiate help files with my Vb.net Project. Regards Sudheer
3
by: Colin J. Williams | last post by:
Python advertises some basic service: C:\Python24>python Python 2.4.1 (#65, Mar 30 2005, 09:13:57) on win32 Type "help", "copyright", "credits" or "license" for more information. >>> With...
2
by: John Baker | last post by:
I find it highly annoying that MS Access tries to go online when I want to look at the help files. Is there a way to configure it so it just looks at my local helpfiles when I hit F1?
27
by: Bruce Dodds | last post by:
I recently started using Access 2003 for the first time. I wanted to pass on some comments about the Help system to Access MVPs who frequent this board. I'm doing this in the hope that some of...
3
by: stuart_white_ | last post by:
I've just upgraded from Python 2.3.3 to Python 2.4.2, and, although the new version of Python seems to be running correctly, I can't seem access the help from the interpreter. On Python 2.3.3...
4
by: jerry.ranch | last post by:
Say, on a data entry form a "HELP" cmbBUTTON that bounces the user off to word file that has help, or is there some other way to do it (like a label object with help on another form) Thanks...
8
by: Mark | last post by:
I have loaded Visual Studio .net on my home computer and my laptop, but my home computer has an abbreviated help screen not 2% of the help on my laptop. All the settings look the same on both...
0
by: hitencontractor | last post by:
I am working on .NET Version 2003 making an SDI application that calls MS Excel 2003. I added a menu item called "MyApp Help" in the end of the menu bar to show Help-> About. The application...
6
by: priyajohal | last post by:
#include<fstream.h> #include<process.h> #include<stdlib.h> #include<conio.h> #include<string.h> #include<dos.h> #include<ctype.h> #include<stdio.h> void setup() void help();
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.