Provide state-of-the-art image capture, screen capture, video capture and audio capture software
Home     Download     Purchase     Support     Contact     View my shopping cart
You are here: ACASystems » ACA WebThumb ActiveX Control » FAQ » Set thumbnail size

FAQ: How to set the size of the thumbnail image?

The default thumbnail width and height is set to zero, the image will be saved with full size. You can call SetThumbSize() to set the thumbnail image size.

Example

An example for VC++:

void SnapExample()
{
  HRESULT hr;
  IThumbMaker * t_xpMaker = NULL;
  // Initializes the COM library on the current thread
  CoInitialize(NULL); 

  hr = CoCreateInstance(
    __uuidof(ThumbMaker), NULL, CLSCTX_INPROC_SERVER, 
    __uuidof(IThumbMaker), (void**)&t_xpMaker
    );

  if ( SUCCEEDED(hr)  )
  {
    long t_lRet = 0;
    t_xpMaker->SetURL( _T("http://www.acasystems.com") );
    t_lRet = t_xpMaker->StartSnap();
    if ( 0 == t_lRet )
    {
      // save image with full size
      t_xpMaker->SetThumbSize (0,0,0);
      t_xpMaker->SaveImage( _T("c:/acasystems_full.png") );
      // set image size to 320x240, keep ratio by width
      t_xpMaker->SetThumbSize (320,240,0);
      t_xpMaker->SaveImage( _T("c:/acasystems_320x240.png") );
      // set image width to 320, auto calculate the image height.
      t_xpMaker->SetThumbSize (320,0,0);
      t_xpMaker->SaveImage( _T("c:/acasystems_320xauto.png") );
      // set image height 240, auto calculate the image width.
      t_xpMaker->SetThumbSize (0,240,0);
      t_xpMaker->SaveImage( _T("c:/acasystems_autox240.png") );
    }
    t_xpMaker->Release();
  }
}

An example for PHP:

<?php
  $t_xMaker = new COM('ACAWebThumb.ThumbMaker')
    or die("Start ACAWebThumb.ThumbMaker failed");

  $t_xMaker->SetURL("http://www.acasystems.com"); 
  if ( 0 == $t_xMaker->StartSnap() )
  {
    // save image with full size
    $t_xMaker->SetThumbSize (0,0,0);
    $t_xMaker->SaveImage( "c:/acasystems_full.png") ;
    // set image size to 320x240, keep ratio by width
    $t_xMaker->SetThumbSize (320,240,0);
    $t_xMaker->SaveImage( "c:/acasystems_320x240.png");
    // set image width to 320, auto calculate the image height.
    $t_xMaker->SetThumbSize (320,0,0);
    $t_xMaker->SaveImage( "c:/acasystems_320xauto.png");
    // set image height 240, auto calculate the image width.
    $t_xMaker->SetThumbSize (0,240,0);
    $t_xMaker->SaveImage( "c:/acasystems_autox240.png");
    echo "Take screenshot successful. "; 
  }
?>

Free Trial ACA WebThumb ActiveX Now

See Also:

  • C# Sample Code(1): How to convert HTML to image in C#(C-sharp)?
  • C# Sample Code(2): How to capture web page to image with C#(C-sharp)?
  • C# Sample Code(3): How to generate image from HTML with C#(C-Sharp)?
  • C# Sample Code (4): How to take screenshot of web page in C#(C-sharp)?
  • Java Sample Code: How to convert HTML to image in Java?
  • PHP Sample Code(1): How to convert HTML to image with PHP?
  • PHP Sample Code(2): How to convert webpage to image with PHP?
  • FAQ of ACA WebThumb ActiveX Control
  • Function Documentation: SetThumbSize()
  • Download ACA WebThumb ActiveX Control
  • Purchase a license of ACA WebThumb ActiveX Control

  • Get discount alerts, new product information and technical articles:
    Name:
    Email:
    * Get 10% off your first order by joining our mailing list!
    * You may safely unsubscribe at any time!