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.
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