siegmar Posted October 22, 2008 Share Posted October 22, 2008 Hallo I am new in Autoit and Windows programming and sorry for my stupid questions. I am at home in the microcontroller world. I have connected an black and white LCD Display to the USB Port. I can talk to the Display with a DLL routine, written in C. This is working well. I can create pointers with DllStructCreate,DllStructSetDate and then DllStructGetPtr. From the sample script _GDIPlus_BitmapCreateFromFile.au3 I make a Bitmapclone $myClone = _GDIPlus_BitmapCloneArea ($hImage, 0, 0,320,240,$GDIP_PXF01INDEXED ) $myclone is now an image handle to an image with 1 bit per pixel. How I can transform an handle from an image to an pointer for my DLL ?? It make me crazy !!!! Thanks in advance for your answer. Have a nice day cheers Siegmar Link to comment Share on other sites More sharing options...
LarryDalooza Posted October 22, 2008 Share Posted October 22, 2008 How is the DLLCall defined? What have you tried? Lar. AutoIt has helped make me wealthy Link to comment Share on other sites More sharing options...
siegmar Posted October 22, 2008 Author Share Posted October 22, 2008 Hi Lar Thanks for your reply This is the DLL Call in C ;LUI_Bitmap (int DevNum, unsigned char ScreenNr, int ScreenPosX, ;~ int ScreenPosY, int BMPoffsetX, int BMPoffsetY, ;~ int BMPWidth, int BMPHight, int BMPdataWidth, ;~ int BMPdataHight, unsigned char *Bitmap); When I load an stored image file, the following code fragment is working $result = DllCall($dll,"ubyte","LUI_Bitmap","int",$devNum,"byte",0,"int",0,"int" _ ,0,"int",0,"int",0,"int",320,"int",240,"int",320,"int",240, _ "ptr",DllStructGetPtr($image_struct)) now I want to send the image with the handle $myclone to the DLL $myClone = _GDIPlus_BitmapCloneArea ($hImage, 1250-320, 1024-240, 320, 240, $GDIP_PXF01INDEXED) So I need the pointer from the image. cheers Siegmar Link to comment Share on other sites More sharing options...
Malkey Posted October 23, 2008 Share Posted October 23, 2008 (edited) Hi Lar Thanks for your reply This is the DLL Call in C ;LUI_Bitmap (int DevNum, unsigned char ScreenNr, int ScreenPosX, ;~ int ScreenPosY, int BMPoffsetX, int BMPoffsetY, ;~ int BMPWidth, int BMPHight, int BMPdataWidth, ;~ int BMPdataHight, unsigned char *Bitmap); When I load an stored image file, the following code fragment is working $result = DllCall($dll,"ubyte","LUI_Bitmap","int",$devNum,"byte",0,"int",0,"int" _ ,0,"int",0,"int",0,"int",320,"int",240,"int",320,"int",240, _ "ptr",DllStructGetPtr($image_struct)) now I want to send the image with the handle $myclone to the DLL $myClone = _GDIPlus_BitmapCloneArea ($hImage, 1250-320, 1024-240, 320, 240, $GDIP_PXF01INDEXED) So I need the pointer from the image. cheers SiegmarYou could try this to see if it works. A handle is a pointer. $myClone = _GDIPlus_BitmapCloneArea($hImage, 1250 - 320, 1024 - 240, 320, 240, $GDIP_PXF01INDEXED) $result = DllCall($dll, "ubyte", "LUI_Bitmap", "int", $devNum, "byte", 0, "int", 0, "int" _ , 0, "int", 0, "int", 0, "int", 320, "int", 240, "int", 320, "int", 240, _ "hwnd", $myClone) Examples of DllCall() calls can be found in the include directory in GDIPlus.au3 and WinAPI.au3 files, just to mention two. Or instead of "hwnd", try "ptr". I am only guessing. Edited October 23, 2008 by Malkey Link to comment Share on other sites More sharing options...
LarryDalooza Posted October 23, 2008 Share Posted October 23, 2008 Thisunsigned char *Bitmapaccepts a handle?Lar. AutoIt has helped make me wealthy Link to comment Share on other sites More sharing options...
siegmar Posted October 23, 2008 Author Share Posted October 23, 2008 Thisaccepts a handle?Lar.Ok, I will check it laterThanks ..Have a nice day Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now