Sign in to follow this  
Followers 0
DavidSykes

LiveView display of camera screen

2 posts in this topic

I am completely new to AutoIt and am having problems trying to display a LiveView of the camera screen.

via a PTP link, I can download a bitmap image of the screen into an AutoIt structure.

For use with gdi functions, I need a handle to the bitmap.

I have not been able to discover what the HBITMAP structure consists of but based on code in

BMP3.au3 I have :-

Local $BMPHandle[4]                             
         $BMPHandle[0]=0                                    
         $BMPHandle[1]=320                                  
         $BMPHandle[2]=240                                
         $BMPHandle[3]= DllStructCreate("ubyte[230454]")
                _WinAPI_ReadProcessMemory($sdmHandle,$sdmMem,DllStructGetPtr($BMPHandle[3]),230454,$actualSize)

If I save $BMPHandle[3] to a file it is indeed a bitmap.

Is $BMPHandle a genuine HBITMAP ?

If so, this attempt to copy a bitmap object (the above) to a graphic object (a window) does not work :

$hBitmap = _GDIPlus_BitmapCreateFromHBITMAP ($BMPHandle)
   _GDIPlus_GraphicsDrawImage ($hGraphic, $hBitmap, 0, 0)

where

$hGraphic = _GDIPlus_GraphicsCreateFromHWND ($hSDMWindow )

Any ideas ?

I have no idea if AutoIt (or gdi+) will be fast enough for an update-rate of say ten frames per second.

Share this post


Link to post
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0