Solved

Capture invisible webpage client area to off-screen Bitmap

Posted on 2001-08-21
3
235 Views
Last Modified: 2010-05-18
Hi

I am trying to capture a full webpage area without displaying the webpage.  

e.g. Type a URL into a single line edit box and hit a capture button, this would somehow create an offscreen browser that downloads the remote webpage and then when downloaded captures it to a bitmap file.

1. IE can be a requirement
2. Must not show a webpage anywhere
3. Must not require a WebBrowser visible prior to capture.
4. Must work on Win98 / Win2k

I know this is possible as I have seen it in another application.  Something about creating an off screen renderer and using print to capture the form area to a file.

So far I can capture the Web client area to a bitmap but must have a TWebBrowse / IE open to do it, which is not what I want.

I wouldn't say this question is easy but as a new user I only have 75 points.

Thanks
Geoff Coope
0
Comment
Question by:GeoffCoope
3 Comments
 
LVL 6

Accepted Solution

by:
edey earned 75 total points
ID: 6410685
have you tried just printing?  I'm pretty sure IE re-renders it's content anytime it prints.  I grabbe the following printing hints from http://members.home.com/hfournier :

Q: How do I Print?

A: There are a couple of ways to print. The first example works in IE 4.x and up, but you'll have to use the second example in IE 3.x:

var
  vaIn, vaOut: OleVariant;

...

WebBrowser.ControlInterface.ExecWB(OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, vaIn, vaOut);

or

procedure TForm1.PrintIE;
var
  CmdTarget : IOleCommandTarget;
  vaIn, vaOut: OleVariant;
begin
  if WebBrowser1.Document <> nil then
    try
      WebBrowser1.Document.QueryInterface(IOleCommandTarget, CmdTarget);
      if CmdTarget <> nil then
        try
          CmdTarget.Exec( PGuid(nil), OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER, vaIn, vaOut);
        finally
          CmdTarget._Release;
        end;
    except
      // Nothing
    end;
end;

Note: If you're not using Delphi 3.02 or higher, you'll have to change

PGuid(nil)
to
PGuid(nil)^
. And you really should upgrade to 3.02, if you're using 3.0 or 3.01.

 

GL
Mike
0
 
LVL 27

Expert Comment

by:Asta Cu
ID: 6907105
Please update the experts here who have so willingly stepped in to help you, since much time has passed since your last comments, and Email notifications may not have been generated to the participating experts here due to some problems at that time.  If you've been helped, accept the respective question by that expert to grade and close it.

Somewhat off-topic, but important.

****************************** ALERT********************************
WindowsUpdate - Critical Update alert March 28, 2002 from Microsoft
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/security/bulletin/ms02-015.asp
Synopsis:
Microsoft Security Bulletin MS02-015  
28 March 2002 Cumulative Patch for Internet Explorer
Originally posted: March 28, 2002
Summary
Who should read this bulletin: Customers using Microsoft® Internet Explorer
Impact of vulnerability: Two vulnerabilities, the most serious of which would allow script to run in the Local Computer Zone.
Maximum Severity Rating: Critical
Recommendation: Consumers using the affected version of IE should install the patch immediately.
Affected Software:
Microsoft Internet Explorer 5.01
Microsoft Internet Explorer 5.5
Microsoft Internet Explorer 6.0

Thought you'd appreciate knowing this.
":0)
Asta
0
 
LVL 17

Expert Comment

by:geobul
ID: 9287669
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

accept edey's comment as answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Thanks,

geobul
EE Cleanup Volunteer
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Memory leak using records in a TVirtualStringTree 11 109
Delphi cmd execution 6 56
Reconfigure Delphi Install? 2 46
LAN or WAN ? 11 82
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…

896 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now