Capture image in an existing webbrowser control

Htmlsnapshot can capture image of an existing webbrowser control and save it into jpg, bmp, gif, png etc.

You need to pass the object instance of the webbrowser control (IDispatch in C++).

In VB6, you can do it like below:

     Dim snap1 As HtmlSnap2.CHtmlSnap
     Set snap1 = CreateObject(“HTMLSNAP2.HtmlSnap.1″)
     snap1.SnapWebBrowser WebBrowser1.Object, “c:web.bmp”
     snap1.Clear

We also provide C# demo with our trial version.

Record streaming audio in Vista

To record the “Stereo Mix” or “Wave Mix” on Vista with Audio Record Expert, you will need to enable the device first.

  1. Select sound from the control panel.
  2. Select the recording tab.
  3. Right click on the background of the tab and choose “show disabled devices.”
  4. Right click on Wave Out Mix and click enable.
  5. Now it should work the same way as Wave Out Mix in Windows XP, allowing you to record any sound your computer makes.

Read more on

http://www.downloadsquad.com/2007/01/15/how-to-enable-wave-out-recording-in-vista/

Fail to install Ubuntu on Virtual PC

I tried it as well. But found it doesn’t work.

Virtual PC’s video card simulation is not supported by the default installation. I has to choose the “safe graphics” option to let it go. But when it comes to let me click the “install” icon on the desktop, I found the mouse doesn’t work…

So don’t waste time to try that. Use the free VMware server instead which I think it is much better than the free Virtual PC 2007

Install Ubuntu on Vmware

Today I tried to install Ubuntu Linux 7.04 onto VMware server which is free.

The installation process is easy and smooth. After that I met  a problem on how to share the data with my windows machine which is using Vista.

After doing some search, I found two ways:

  • Using the share folder feature of Ubuntu. It allows to share a folder with SMB.  After adding a folder as share, it is still not visible to Vista. (Pop up a dialog for password).

         It is necessary to add the user to SMB password list.

     Sudo smbpasswd -a username

  • Another way is to let Ubuntu to access an Vista share.  I tried several ways to make it work:

    tried

    Run secpol.msc

    Go to: Local Policies > Security Options

    Find “Network Security: LAN Manager authentication level”

    Change Setting from “Send NTLMv2 response only”

    to”Send LM & NTLM – use NTLMv2 session security if negotiated”

    Vista defaults to only send the more secure NTLMv2 protocol, which these NAS devices / Samba do not support.”

                          Finally tried a manual mount

                           sudo mount -t cifs -o username=user,password=pass  //VistaIP/share   /mnt/vista

                  It finally works.

By the way, Ubuntu has an easy way to update software on it.   The command below can automatically download and install new software onto the system.

               sudo apt-get install softwarename

Have fun with it. :)

Correct way to release a COM object

Our ActiveTTS component is a COM component. Using it in .Net needs some attention on how to release it.

.Net uses GC to release unused object. But for COM object, it is better to release it as soon as possible when it is not used.

The following example code shows how you release ActiveTTS object when it is done.

       Dim i
        For i = 0 To 1000
            Try
                Dim objActiveTTS As New TTSObj.CTextToSpeechClass
                Dim strCode As String
                objActiveTTS.SetCode(strCode)
                objActiveTTS.SpeakToFile(“Hello world”, “d:tempxxxx.mp3″, TTSObj.TTSFLAG.TF_DEFAULT)
                Marshal.ReleaseComObject(objActiveTTS)
            Catch ex As Exception
            End Try
        Next

Marshal.ReleaseComObject is the key method.

Convert html to image with Html Snapshot Component

Do you ever want to take a screen shot of a web page in your desktop or web application? HTML Snapshot ActiveX is a software component that can make html to image easier than ever before. It can download and parse web sites and save a screenshot of the page in GIF, JPG, JPEG, BMP, PNG, TIFF, WMF and EMF. You can choose to capture the entire page, or a thumbnail image of a specified size, and save it to a local folder.

The key benifits of using Html Snapshot are:

  • It is a flexiable componet to convert html (embeded flash movie support), mht, VML, SVG and text to image on the fly to file or in memory.
  • Convert html to image into various image formats like JPEG and TIFF etc. with custom saving options.
  • Html snapshot can be used in many programming or script languages to convert html to image, what’s more, it is easy to start using html snapshot with rich samples.
  • Html Snapshot has been used by thousands of enterprise customers since its first release in 2004. And it is being constantly improved by the company Guangming Software. Lot of new features and fixes are adding to the product.

    Here below lists the high light features of the component.

  • Directly save the web page at a given URL into image in bmp, jpeg, tiff, gif or png format. (i.e. html to image, html to jpg, html to image, html to tiff, html to png etc)
  • Directly convert html string to images.
  • Directly convert MHT web archive to image in bmp, jpeg, tiff, gif or png format
  • Support saving the whole html page to image without scrollbars.
  • Support http authentication and bypass authentication dialog automatically
  • Create thumbnail images from large images.
  • Get links, title, cookie or html source of a page
  • Get the html document DOM interface
  • Make gray or black and white images
  • Reduce color number in images while keeping better quality.
  • Support compressing images into jpg, tiff, gif or png in memory without temporary files created.
  • Support JPEG compression level and TIFF compression method selection
  • Convert vector graphics WMF, EMF, SVG and VML to bmp, jpg, jpeg, tiff, gif or png
  • Convert html to vector image format like EMF and WMF
  • Convert html to transparent GIF
  • Convert html to image with an existing webbrowser control
  • Automatically clip the image by removing white area in the html generated image
  • Examples in VC, Delphi, VB, VB.Net, C#, ASP, ASP.Net, PHP, Perl, Python, Cold Fusion, PowerBuilder, FoxPro, Windev, VB and Java script as well as Java and Ruby  are provided.
  • Support Windows Vista and IE7 now
  • Support Windows X64 edition (under x64 window)
  • Convert html to text
  • Draw watermark text on image after converting html to image
  • Html Snapshot is free to try. Just try it out for FREE in your applications to convert html to image before purchase.

    Related web links:

    Guangming Software: http://www.guangmingsoft.net
    Html Snapshot:  http://www.guangmingsoft.net/htmlsnapshot/help.htm
    Html Snapshot Download: http://www.guangmingsoft.net/htmlsnapshot/HtmlSnapSetup.exe

     

    Snap a URL with http authentication.

    Some times a URL is protected by autentication scheme such as http authentication or NTLM if you are in a windows domain network. It ususally asks user to input username and password so as to access the protected URLs by poping up a dialog.

    Our  Htmlsnapshot now supports authentication URLs with a method called SetAuthUserAndPasswd

    ‘demo how to capture a page with http authentication
    Dim snap

    ‘Create the Html Snapshot Object
    Set snap = CreateObject(“HTMLSNAP2.HtmlSnap.1″)

    ‘Set the time to wait for web page loading
    snap.SetTimeOut CLng(200000)

    ‘Begin to capture the web page
    ‘Note, change following to your url, user and password for test
    snap.SetAuthUserAndPasswd “username”, “password”

    snap.SnapUrl “http://www.example.com“, “auth.jpg”

    ‘Free object
    Set snap = Nothing