($err, $imageSize, $imageBytes) = VMCaptureScreenImage($vmHandle, $captureType, $propertyListHandle);
This function captures the screen of the guest operating system.
$imageSize. The size of the image in bytes.
$imageBytes. The bytes making up the image.
For security reasons, this function requires a successful call to VMLoginInGuest must be made.
use VMware::Vix::Simple; use VMware::Vix::API::Constants;since VMware Workstation 6.5
my $err; my $imageSize; my $imageBytes; my $filename = "screendump.png"; ($err, $imageSize, $imageBytes) = VMCaptureScreenImage($vmHandle, VIX_CAPTURESCREENFORMAT_PNG, VIX_INVALID_HANDLE); die "CaptureScreenImage failed, $err ", GetErrorText($err), "\n" if $err != VIX_ OK; open IMAGE, ">", $filename or die "can't open screen capture file $filename"; print IMAGE $imagebytes; close IMAGE;