use Win32::API; use Win32::GUI::DIBitmap; use GD; $GetDC = new Win32::API('user32','GetDC',['N'],'N'); my $dc = $GetDC->Call(0); my $dib = newFromDC Win32::GUI::DIBitmap ($dc); my $width = $dib->GetWidth() ; my $height = $dib->GetHeight() ; my $GDimage = new GD::Image($w,$h); $dib->CopyToGD($GDimage,$dib) ; #do something with the gd object #.... open (DISPLAY, ">test.png"); binmode DISPLAY; print DISPLAY $GDimage->png; close (DISPLAY);