Jump to content

How to create modified _ScreenCapture_CaptureWnd() (help request for experts)


Recommended Posts

See my last reply.

How can I create modified version of _ScreenCapture_CaptureWnd(). I want modify that function so instead of saving image to file it would return image.I know how find the ScreenCapture.au3, but I don't know how and what I need to modify.In ScreenCapture.au3 function _ScreenCapture_CaptureWnd() call next functions, and those call next ones, and so on, also there are many commands, functions that I haven't used yet, so I have no experience with these commands.

I need to create _ScreenCapture_CaptureWnd() that returns binary string (it can also be hex code it doesn't matter) instead of saving image.Most important thing is that I need _ScreenCapture_CaptureWnd() that returns image, it must not save image to disk.

I also need function to display image in GUI.As we all know GUICtrlCreatePic() requires file,But I need special function that loads image from binary string.

Idea is that if I don't save image to hard disk, I don't have to waste time on writing image disk, and then reading it from disk.If I need to update image of window in my GUI about 10 times/sec, Hard disk must do lot's of work.That's the reason why I need CaptureScreen function that returns image as string,and _GuiCtrlCreateX function that loads image to GUI picture control with out saving it to hard disk.

If you know how to do that or if u can suggest me what to edit in original functions, please let me know.

Thanks.

Edited by E1M1

edited

Link to comment
Share on other sites

Look here for executefrommem using the binary form of the image file.

About _ScreenCapture_CaptureWnd(), if you'll specify a blank string in the first parameter you'll get a bitmap handle instead of saving it to a file. Read the function parameter explanations.

Edited by Authenticity
Link to comment
Share on other sites

How I get image from handle?

screenshot ends with code that I don't understand well.

$aResult = DllCall($ghGDIPDll, "int", "GdipSaveImageToFile", "hwnd", $hImage, "wstr", $sFileName, "ptr", $pGUID, "ptr", $pParams)

edited

Link to comment
Share on other sites

thanks Zenda, But I still need function to get string from image's handle, How I do that?

_ScreenCapture_CaptureWnd() returns handle, but handle is not enough, I need my string!

edited

Link to comment
Share on other sites

How can I create modified version of _ScreenCapture_CaptureWnd(). I want modify that function so instead of saving image to file it would return image.I know how find the ScreenCapture.au3, but I don't know how and what I need to modify.In ScreenCapture.au3 function _ScreenCapture_CaptureWnd() call next functions, and those call next ones, and so on, also there are many commands, functions that I haven't used yet, so I have no experience with these commands.

I need to create _ScreenCapture_CaptureWnd() that returns binary string (it can also be hex code it doesn't matter) instead of saving image.Most important thing is that I need _ScreenCapture_CaptureWnd() that returns image, it must not save image to disk.

I also need function to display image in GUI.As we all know GUICtrlCreatePic() requires file,But I need special function that loads image from binary string.

Idea is that if I don't save image to hard disk, I don't have to waste time on writing image disk, and then reading it from disk.If I need to update image of window in my GUI about 10 times/sec, Hard disk must do lot's of work.That's the reason why I need CaptureScreen function that returns image as string,and _GuiCtrlCreateX function that loads image to GUI picture control with out saving it to hard disk.

If you know how to do that or if u can suggest me what to edit in original functions, please let me know.

Thanks.

There may be a few commands in this script you have no used before.

Your requirement of 10 screen captures per second intrigued me. I didn't think it could be done with _ScreenCapture_Capture().

The bigger the screen capture, the less number of screen captures per second.

With a capture size of 600x500, this script displays to a GUI in less than 0.100 secs most of the time.

;
#include <gdiplus.au3>
#include <WindowsConstants.au3>
#include <ScreenCapture.au3>

; Example modified from
; http://www.autoitscript.com/forum/index.php?s=&showtopic=89879&view=findpost&p=647719
; http://www.autoitscript.com/forum/index.php?s=&showtopic=90230&view=findpost&p=648803

Opt("GUIOnEventMode", 1)

Global Const $Width = 600; @DesktopWidth
Global Const $Height = 500;@DesktopHeight-30
Global Const $PI = 3.14159265
Local $hImage, $hBitmap1
$hWnd = GUICreate("Screen Capture", $Width, $Height, -1, -1, -1, $WS_EX_TOPMOST)
WinSetTrans("Screen Capture", "", 254)
GUISetOnEvent(-3, "close")
GUISetOnEvent(0xF, "MY_PAINT")
_GDIPlus_Startup()

$hGraphics = _GDIPlus_GraphicsCreateFromHWND($hWnd)
$hBitmap = _GDIPlus_BitmapCreateFromGraphics($Width, $Height, $hGraphics)
$hBackbuffer = _GDIPlus_ImageGetGraphicsContext($hBitmap)
$ScreenDc = _WinAPI_GetDC($hWnd)

GUISetState()
;_GDIPlus_GraphicsClear($hBackbuffer, 0xFFFFFFFF)

$hBitmap1 = _ScreenCapture_Capture("", 0, 0, $Width, $Height, False)
$hImage1 = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap1)
_GDIPlus_GraphicsDrawImage($hBackbuffer, $hImage1, 0, 0)

$gdibitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
$dc = _WinAPI_CreateCompatibleDC($ScreenDc)
_WinAPI_SelectObject($dc, $gdibitmap)
_WinAPI_BitBlt($ScreenDc, 0, 0, $Width, $Height, $dc, 0, 0, $SRCCOPY)

GUIRegisterMsg(0xF, "MY_PAINT")

Do
    $Timer = TimerInit()
    _GDIPlus_ImageDispose($hImage1)
    _WinAPI_DeleteObject($hBitmap1)
;DllCall($ghGDIPDll, "int", "GdipGraphicsClear", "hwnd", $hBackbuffer, "int", 0xFFFFFFFF)
    DllCall("GDI32.dll", "int", "BitBlt", "hwnd", $ScreenDc, "int", 0, "int", 0, "int", $Width, "int", $Height, _
            "hwnd", $dc, "int", 0, "int", 0, "int", $SRCCOPY)
    $hBitmap1 = _ScreenCapture_Capture("", 0, 0, $Width, $Height, False)
    $hImage1 = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap1)
    _GDIPlus_GraphicsDrawImage($hBackbuffer, $hImage1, 0, 0)
    _WinAPI_DeleteDC($dc)
    _WinAPI_DeleteObject($gdibitmap)

    $gdibitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap)
    $dc = _WinAPI_CreateCompatibleDC($ScreenDc)
    _WinAPI_SelectObject($dc, $gdibitmap)
    _WinAPI_BitBlt($ScreenDc, 0, 0, $Width, $Height, $dc, 0, 0, $SRCCOPY)
    ConsoleWrite(TimerDiff($Timer) & @CRLF)

Until Not Sleep(250)

Func close()
    _GDIPlus_ImageDispose($hImage1)
    _WinAPI_DeleteObject($hBitmap1)
    _WinAPI_DeleteDC($dc)
    _WinAPI_DeleteObject($gdibitmap)
    _WinAPI_ReleaseDC($hWnd, $ScreenDc)
    _GDIPlus_GraphicsDispose($hBackbuffer)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
    Exit
EndFunc  ;==>close

Func MY_PAINT($hWnd1, $MSG, $wParam, $lParam)
; Check, if the GUI with the Graphic should be repainted
    If $hWnd1 = $hWnd Then
        $Timer = TimerInit()

    ;_GDIPlus_GraphicsClear($hBackbuffer, 0xFFFFFFFF)
        DllCall($ghGDIPDll, "int", "GdipGraphicsClear", "hwnd", $hBackbuffer, "int", 0xFFFFFFFF)

    ;_WinAPI_BitBlt($ScreenDc, 0, 0, $Width, $Height, $dc, 0, 0, $SRCCOPY)
        DllCall("GDI32.dll", "int", "BitBlt", "hwnd", $ScreenDc, "int", 0, "int", 0, "int", $Width, "int", $Height, _
                "hwnd", $dc, "int", 0, "int", 0, "int", $SRCCOPY)
        ConsoleWrite(TimerDiff($Timer) & @CRLF)
    EndIf
EndFunc  ;==>MY_PAINT
;

Good luck.

Link to comment
Share on other sites

another example i prefer:

you have to replace the "Editor" in WinGetHandle with your wintitle and this is just a test script, you have to release the resources of the gdi funcs too :)

#NoTrayIcon
#include <GUIConstantsEx.au3>
#include <ScreenCapture.au3>
#include <GDIPlus.au3>

$guiMain = GUICreate("Test Window", 402, 306, 810, 423)
$guiPic = GUICtrlCreatePic("", 8, 8, 385, 289)
GUISetState(@SW_SHOW)

_GDIPlus_Startup()

$hWnd = WinGetHandle("Editor") ; <- type the window title you want to capture here
$hBitmap = _ScreenCapture_CaptureWnd("",$hWnd)
$hImage = _GDIPlus_BitmapCreateFromHBITMAP ($hBitmap)
$iX = _GDIPlus_ImageGetWidth ($hImage)
$iY = _GDIPlus_ImageGetHeight ($hImage)
$hBitmap2 = _GDIPlus_BitmapCloneArea($hImage, 0, 0, $iX, $iY, $GDIP_PXF24RGB)
$hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap2)

_SetBitmapToCtrl($guiPic, $hHBitmap)

While 1
    If GUIGetMsg() = $GUI_EVENT_CLOSE Then Exit
    Sleep(10)
WEnd

Func _SetBitmapToCtrl($CtrlId, $hBitmap) ;function by Zedna
    Local Const $STM_SETIMAGE = 0x0172
    Local Const $IMAGE_BITMAP = 0
    Local Const $SS_BITMAP = 0xE
    Local Const $GWL_STYLE = -16

    Local $hWnd = GUICtrlGetHandle($CtrlId)
    If $hWnd = 0 Then Return SetError(1, 0, 0)
    
    ; set SS_BITMAP style to control
    Local $oldStyle = _WinAPI_GetWindowLong($hWnd, $GWL_STYLE)
    If @error Then Return SetError(2, 0, 0)
    _WinAPI_SetWindowLong($hWnd, $GWL_STYLE, BitOR($oldStyle, $SS_BITMAP))
    If @error Then Return SetError(3, 0, 0)
    
    Local $oldBmp = _SendMessage($hWnd, $STM_SETIMAGE, $IMAGE_BITMAP, $hBitmap)
    If @error Then Return SetError(4, 0, 0)
    If $oldBmp <> 0 Then _WinAPI_DeleteObject($oldBmp)
    Return 1
EndFunc
Edited by nuki
Link to comment
Share on other sites

Malkey your source is close to my needs but I want to change it's working method.

1)it must return binary string from picture, I should look like this:

Pic:

Posted Image

String:

0x89504E470D0A1A0A0000000D49484452000000A9000000FA080200000055ADF021000000017352474200AECE1CE9000000

0467414D410000B18F0BFC6105000000206348524D00007A26000080840000FA00000080E8000075300000EA6000003A9800

0017709CBA513C00000FBE49444154785EED5D697014C715263F53A9CA9FA42A65174E08544C551470810526DCB621215C26

184238630C658784C35C76380C24984348C24612200E6340DC1043C020EC7019CC21872BC6845B1C0664718ADB58C64A434B

ED56CFD13D3DC7CEEC7C5B53303BFB76A6FB7DFD5EBFF7BDEED5F7EE5D3D5D05AF786A80605F7AAF0447DC34707471EF2A14

7BF22F8E5869A012F62726D6D13DEA9E98F4F4C9C9A927D3EA9D9C52FF547A03721466342CCC6C5438B5F1E9B79B9C7EA7E9

9969CDCE643D7B26EBB9B3D9CF9FCD69716E7ACB73337E736E66AB2F66FEEE8BDCD6E767B5393FBBEDF939ED2ECC6D7FE1DD

0E17E6FDFEE2BC8E17DF7BB1687EA7A2059D8B1676F932EF8F5FE6752D5ED4AD7871F7E2253D2E2DED756959AFCBCB5FBABC

A2F7E5952F5F59D9E7CAAABE57FFF9CAD5F75FBDBAFACFD756F7BBB6E62FD7FEF5D7EB6B075C5F37A0E4834125EB5F2BD930

F846FE901BF9436F6E1C76F3C3D76F7EF4C6AD7FFFEDD6A611B7378DBCBD79D4ED2D6FDED93AE6CEB6B1773F1E7777FBDFEF

EEF8C7BD1DE3EF7D32E1DECE895FED9AF4D5EEC9F7F7A4DDDF33E57E41C6D79F667EFD9FA9A57BDF2EDDF74EE9FE69DF1CC8

26C78383D31FFC77C683CF667E7B28F7DBCF67951D9E13F2838C7225EC8FE7BC58B873D3EC37323E9FDCC2627000FB24C2BE

43DB453B46343EB5B0FFB90305470E152D9FB78F5C193D6C7DEE8495F963FA144CEC9CD7BF1B370E80BD09F68E0208126B3A

95A7AE45EF5B96767F30ADDD9B43372C9CBFEF72F1CD5B37EE5EBF76E78315879E6DF26EED7AD332DFDA347AC8FABEDD573C

5E3D7DEDE0A615F0037B73EC15038887EEF711F68EE419F61ADFB2C4FED89446051FED3C5B7885005F5AFA4DC9B5DB7BB69F

CACDD9B571CDA1DCA9DB09F6AFF65A553F75EABEB1A93CF665970E93839FEFE9153ADFD3F358CDF74EB164F26428581D1466

3A567CC1FED0B46EFB3F3D7DE2485171D18DEB576F155F2C39FEBF8B7B779F5A95B7777AC6C704FB577AAC6CD1F4BDB583DB

A8631FC358CF0FECE93DADB0A72405EF06F82BFCB72CED7E73EEB44FB61C3BB4FF1C81BFF078F1B1C3170EEE3DBBF5C3230B

7277678CDF3C62D0BA5E9D9735FDF5DCD75E1868C49E18378DF3A9A133BB07F6369E59F0F9E4ADE92C4EAFDBDB3D0FB63014

E4D81FCEEC9097B1744BFE911D9B8FEFDF5378A0A09058FCDAE507B3D2B611873F6678FEC0BEAB7BFE61F98CAC826183D62C

1DD0F111FC0FE77B06B629F6CCE733317AC2723CFE3ACBF1D8459AE3D1B724C7A32724C7A32734C7E3EFC0723CFE22CDF184

06B01C8FBF4E733C76452FC77363F7A6DF55C15E6069F90127C77EF7D6C25143368E19B6313B7DFBFB4BF693397ED19C827D

3BCFF4EDB5EA4F3D57BE3E605DEF2ECB3BB659347270FEE0E13B6AFE32CB88BDA05C61BE679F92FCBE1CFEDCD6F484E6F7F4

9CE4F7F484E4F7F4C41E7B2A43F37B7A4EF27B7A42F37B7ACEB0A7F93DBD48F27B7A42F37B7ACEB0D7CEEF13853D835FF034

72ECBBB79A58BBCEF4D4BAB92FB4CB23864E8ECCB7B674EBBC2CA57676B52733FB745DD1B6E582C6CFCC7E2675D6E3D5D2DB

35EAA7873DE57604ECF94143B99D72F82BB81D6154B1B7C4EE8D1F31ECF98FECB1E725A38B3D5F9A7066F704CBB17DA6A4A4

64D5AA9543C23A7A746ABFA866CD69E468D6706E9306736AFF2AFBA7D5D35B3518621AEB510D125E8F9E98DABD29F6A6BC5E

85D17FE7F38D3033EC055E8FB77BC6EBD18B3676CF783D2A192DBB7735DF1338970CEAD1FAF9F9BF6D3E9FB8777A90E08E04

F624BE2316FF54AD9C9FD5C878AC5ADAB8CE9DFCC09E6ADCD4E7134E977E4A395D7A4E395D7A1E5A9F6F2C131A2D92CFF1F4

E67B0FE27C8268D736590469023F3918EAF5EACC24A6FF44F587C0D7F8C5887D63EBABE778141B92DFD313C1EE099FCF5BB3

55AC6783BD7FB19E2776EF147BABFC5E1AE74BB309CA0A58E6789FA5B77FB9E7CA9494ECBA4FCDA0C7A8A11B9A359C53AD46

46D59FA7FFA8EAA4EFFF64FC933527EC1A15495E8FF7F9BED672B4633DFBAABABFDCCEDE71CD7FF8C4C88ECD7BB569388C80

5D2735675ECE2EC2E9FEB8EAE41F3C36BEC9D30347F79B512D25337FE87351E47483C4DE86A1133EA29CAE2379C6EB697C4B

A98E47009ED27F24C1BE65F3795D9AF759D2AF25C1FB685AA383E319F0E5F93D6AB8420DD7EFA540147BA74F91F87C63A176

4FFA4BF9C3DB5957F751CB49A21AAEC3451CC03EE2D82B960221961C1AC07ABDF8AE5204F6C05E79C54872B83BF442CCF1A0

91586940C9E75BD5857CD59471FD89D5E304495F5B954C379763AF8E81B77A517F2EB0D7D3BC63ECF51EA3F12D60AFA13447

5F71853D9B0BE823F9B7423151905469A20DF6C6E7DA2C545279563C651C606F831FC589A1259CF028AAFB67ABA2A7F16EC2

D3F996C41354C55E3BC09E1937BBB51003DA60AF112D5AD9BD302618D27A234C514D4929A68FBD95FD191D80BAADF32AB6C1

5E400276AF37349D61CFCFE27AD8AB8F0315EC79D461F74E47801C7B6310E7D4E70B77506C22623D4545698B2961AF7DF720

BFA8EE51826C55989F25C1DE186C0BC99B4F7DD3782EB0778A45F2D8BDD39E431ED8A3868B1A6EFC7E6A0A760FBB7F64F765

78C5460304EE4A761F9B8EA3A365C03EBE83C012FB6D7825BB06807DB2236CDD3F600FEC2B7E4B99CD7EF155496C7A0EBB8F

0DD4868E027B60AFE0F3C7E115650D18C7B803BB8F72C7E3DE76023C89E404F81D631F5F1719E59ED3101ED8471943DDB603

7B5DCD45FF7BC03EFA18EAF6C017EC131544395282878D547CAE874F74742BABE6F985BDD5A24A5FAF1B23171B5488FA3CA9

D69147905BA9C04FC47CEDBED5CDADD4E22FF665E4EF77581C4243A9568CFFF262D2BB058F3D05DE29F6D28ED05E7B259600

EC49D3AD3A40AFD317B30553E09998CADDF4B05731592B19E67B556E42ED5EA523DE8A25067BD37EB201C16CDA147E418C1A

817130F16251C15EDA914A9DAAEC003C548B8F3E9FB92CDE6FF3E0F176CFE067C2C2D755EEE62DF642B34D2D5BCFEED938E6

1FA1D15FA3324DB59730BB674EDB0A54DEEDBBD48557D8D3669495553AE8456104007B31CA65139BCA00A7161F1EBB37A2CE

0F02017E60EF0AFB50D9BD3DF07410F0F0037B57D887C7EE558017E007F676D80B1153F954CAE5785676CF0219D3AF182383

47C8895529156E87C9F0D80B53BEF12DFD9636F652B5984E974655A8882526D6A36DE52D9BCDEB7AF9BDFDDDDC602F18BD3D

F6CCF3EB61AFA216413F827714680F3DB5F898E359F590C1CF8F7DE3F8D010F3107B21C837BEA5B3BE06F6E1518B8FD82B8E

5C86B1BD7B50B95B24B057E9089DEFBC720F89F1F9C6E4DE3863317F659C02F9C9CCCDC46645CBF0035FF0F9FED9BD4A4728

F62ADA53114B18F6526E4798C9D808D0E0B9BCB27BAB71C05FD7F6F92A0425C35EAA3D95BB85177B2BBB0F187BE21B04688D

BC1EBB4281D79BEF55D08A0BF621B17B017B1AC9F32F53764F23D603F6952633D3903E78BB37C26F3AEB33A387DD9BAC5C00

9F6F155D7AEBCC15EF96B0F99E6F1F0B4A85E894D9BDE0FF4DE37CE60F8C777313EBF1689527237ED6F1A46A117AC77B41AF

D4E27B7E2F40C57789CF5F59C46784BF1C8947FFD9DFCD2BECE93810E67B0FEBF7D28E5001AFC41260F7564D374D4979C8A5

D19F71045458AA2B3EDF86FCB7FA4823D653578BE940376A4F2A9618EC05D3F1FBAD86DDF3F19AA385CF82B0CAB889C53A5D

A2084F963F6BDC440503969A7B05BCE23ADDB0A9C597F95E1D80C44ABA31740DBB4F6C678D4F8F35F6610323E0F600FB8015

1EA2C701FB10811170533CC03E81218C463088AF081A10069C83DFDD00F0511F4CAEB00FD853E171BE6AC099DDFBDA14DC3C

600D00FB80151EA2C701FB1081117053807DC00A0FD1E3807D88C008B8290EB0F79012C7AD82D780716001FBE05148C01329

37A39FDF27A0C978A4171A60A49C07D83BA2B79CB28190B757AF1BFD048A3D791819B8EA6305F252E0DDE8D333EC558252EA

B14C8B48A65F87BCBD56DDE8C79BF91E585A21E4061BBF6D09D8C7D70F017B60FF9D7FD1C9EFE1F3E1F3E5335498E73F79EB

2B7E672539C63A7C3E7C3E7CBEDA4FB42593DF82DDC3EE61F7B0FB6DDB10E7DBC57CF0F9E5DA6125A5E4887B11E76BDA3D2D

BA28BE6894A1284CF97FC8DBA84B433F1EECCBA10D72040CE4A583DE6F7DB2DAA067753CC5CAAC9B7AB3CA23707F69D93731

D8A31E2F05C64D3D5E6A1B82FE3DB3FBB8C54A51EF2FB81D703BE076C0ED80DBF16F8D54D8E608F87CF87CF87CF87CF87CF8

FC2A84DA2DBD5742FEB5E20178EE097C3ED66CC9A39964AA83C97B1BEE355E88F510EB21D643AC87580FB19EE358CF51D951

A3DE8CFBA37E2FAD7D633D815C4589A9E1528B97961A7901C84BCBBEDAFAF4AC86ABD202D4EFA540A27E5F3E22C107F8177B

22BF477E8FFC1EF93DF27BFF7C6CD83860F87CF87CF87CF87CF87CF87CC79CAE71F230552272B6F08C2DCCF798EF31DF63BE

C77C1F1E9FEC774E089F0F9FEFDAE7A3BEEE6D7DDD6F7D62FF7D395E8E149D04BF1F80FA7DB906E2BC3E00F5FBF8FE9EBF67

D8FB1D97E2FE460DB8E1CA10E723CE771DE783D38D1C870DBB87DDC3EEC1E982D305A78B1AAEF918701357872D4FC17C8FF9

1EF33DE67BCCF798EF31DF63BEC7EFED541E0388F52A6D96A37B071D9541216FBF4F3A00FDA07E8FFA7D25B7A6F977335436

60B3B1A62E8CFDFA525DB9597FE0590D57DA4AE6CA5424D94009723FBAB461746A938AF10B63C22CEF19F661E3ADD01EFB7A

3F783DF07AE0F5C0EB81D703AF075E0FBC1E783DF07AA6CBF11839654A12456EFD5ADCF202C4F988F311E723CE479C8F381F

713EE27CC4F988F3A5713EEAF7D87F2FFFF1F624D8BFEE68A087B0BFD87F8FFDF70F575BF12F7FD76E2459FD5B5AC80F797F

3DC33E6EBC58D4FB0B5E0FBC1E783DF07AE0F5C0EB81D703AF075E0FBC9E94D7C3EFED446EBD02E27CC4F988F311E723CE47

9C8F381F713EE27CC4F9D238DF51593380FDE5688FFD7A02ECBFC7FEFB006BB8D84FAF52F695CAF002043D6D79CF6AB82A2D

08793D5BDA85246BBF67D847BD9E1DB7F683D703AF075E0FBC1E783DF07AE0F5C0EB81D703AF27E5F550BF47FD5E922825D3

EFD1463D27448E871C0F391E723CE478C8F190E321C753CEF1502FC7FE7BECBF37D18023C30860BF3EF6DF63FF3DF6DF27D1

EFE13B5D7F80FA7DF9DF42883A57E3B4FDE076C0ED80DB01B7036E07DC0EB81D703BCADC0E6AB8A8E1A2865B490361AE5923

CE479C8F381F713EE27CC4F988F311E723CEC73A5DE93A5D47654AECBFB72F7507A01FECBFC7FEFB4A6ECDDFDF50C7FE7B95

32AB5406FBEF4D549464FBE3A583C0657F51BF47FDBE7C0CE8FB7CA76B07206FD440901C30385D70BAE074C1E982D305A70B

4E179C2E385D70BA524E17EB76B06E07EB76B06EC7620C0499BF823FB0E70F90DF23BF477E8FFC5E3BBF47FD1EFBEFB1FF3E

4EFBEF89C54B4B8D1008A7065CD570017C3841556C953EF6005E51C5A1157385BD4A0E0D99A868C0C1DA8DA87409ED54D400

B0575454128A01FB240455B14BC05E5151492826624FDEE3888F068E2EEEFD70DD0EF90F470C35F07F9D8795DCB9570EDF00

00000049454E44AE426082

2)when function get string like above and PicControl ID as arguments , it must draw pic from string.

Edited by E1M1

edited

Link to comment
Share on other sites

Malkey your source is close to my needs but I want to change it's working method.

1)it must return binary string from picture, I should look like this:

Pic:

.....

String:

.........

2)when function get string like above and PicControl ID as arguments , it must draw pic from string.

A possible direction for you is at

http://www.autoitscript.com/forum/index.ph...st&p=681193

or

http://www.autoitscript.com/forum/index.ph...st&p=663576

_GDIPlus_BitmapLockBits() lets you access all the pixels in a continuous BBGGRRAA hex colour format with DllStructGetData(Data Structure, 1)

If you change or replace the returned "0x89504EFF470D0AFF1A0A00FF44..." type string, DllStructSetData(Data Structure, 1, Different String Data) will replace the original string data.

Then call _GDIPlus_BitmapUnlockBits() which allows access to the modified bitmap.

There may be other better ways.

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...