Monthly Archives: May 2007

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
                Dim objActiveTTS As New TTSObj.CTextToSpeechClass
                Dim strCode As String
                objActiveTTS.SpeakToFile(“Hello world”, “d:tempxxxx.mp3″, TTSObj.TTSFLAG.TF_DEFAULT)
            Catch ex As Exception
            End Try

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:
    Html Snapshot:
    Html Snapshot Download: