Jump to content
jvds

Help with [screenshot]->[stream]->[binary/String data]-[send]

Recommended Posts

jvds

this is basically what i need to do
[screen shot]->[convert image stream to binary/string data]->[tcp send binary/string ]  -->   [tcp recieve binary/string]->[convert binary/string back to image stream]->[Display image on gui]
*if the image touches the local or remote disk a nuke goes off.

i don't have problems with sending receiving the binary/string data over tcp, so i didn't even write that part, i just want to get this right before i continue

i got as far as getting it to a stream but its not a string i can send over tcp, i need to convert it to a binary/string and send that over tcp

#include <GUIConstantsEx.au3>
#include <ScreenCapture.au3>
#include <WindowsConstants.au3>

$hGUI = GUICreate("Server Screen", 845, 560, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_TABSTOP), 0)
$Pic1 = GUICtrlCreatePic('', 2, 2, 843, 558)

Opt("GUIOnEventMode", 1)
GUISetOnEvent($GUI_EVENT_CLOSE, "_GUI_EVENT_CLOSE")
GUISetState(@SW_SHOW)

While 1
    $stream = ScreenToStream()

    ;##### NEED HELP ON
;~  $stream = "";convert stream to binary string like the one you get with fileread?
    ;##### NEED HELP OFF


    ;LOCAL send $stream as string or binary string over tcp
    ;Remote recieve remote data and


    ;##### NEED HELP ON
;~  $stream="";convert binary string or string to stream so that _GDIPlus_BitmapCreateFromStream can read it
    ;##### NEED HELP OFF

    Drawstream($stream)

    sleep (10)
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            ExitLoop
    EndSwitch

WEnd

func ScreenToStream()
    _GDIPlus_Startup()

    Local $hHBmp = _ScreenCapture_Capture("", 0, 0, @DesktopWidth, @DesktopHeight) ;create a GDI bitmap by capturing 1/4 of desktop
    Local $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hHBmp) ;convert GDI bitmap to GDI+ bitmap
    $hBitmap = _GDIPlus_ImageResize($hBitmap, 843-2 , 558-2) ;resize image
    _WinAPI_DeleteObject($hHBmp) ;release GDI bitmap resource because not needed anymore

    Local $sImgCLSID = _GDIPlus_EncodersGetCLSID("jpg") ;create CLSID for a JPG image file type
    Local $tGUID = _WinAPI_GUIDFromString($sImgCLSID) ;convert CLSID GUID to binary form and returns $tagGUID structure
    Local $pEncoder = DllStructGetPtr($tGUID) ;get pointer of $tagGUID structure
    Local $tParams = _GDIPlus_ParamInit(1) ;initialize an encoder parameter list and return $tagGDIPENCODERPARAMS structure
    Local $tData = DllStructCreate("int Quality") ;create struct to set JPG quality setting
    DllStructSetData($tData, "Quality", 100) ;quality 0-100 (0: lowest, 100: highest)
    Local $pData = DllStructGetPtr($tData) ;get pointer from quality struct
    _GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, $pData) ;add a value to an encoder parameter list
    Local $pParams = DllStructGetPtr($tParams) ;get pointer of encoder parameter list
    Local $pStream = _WinAPI_CreateStreamOnHGlobal() ;create stream
    _GDIPlus_ImageSaveToStream($hBitmap, $pStream, $pEncoder, $pParams) ;save the bitmap in JPG format in memory
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_Shutdown()
    Return $pStream
EndFunc

func Drawstream($stream)
    _GDIPlus_Startup()
    Local $hBitmapFromStream = _GDIPlus_BitmapCreateFromStream($stream) ;create bitmap from a stream (here from the JPG in memory)

;~  Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI) ;create a graphics object from a window handle
    Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND(GUICtrlGetHandle($Pic1)) ;create a graphics object from a window handle

    _GDIPlus_GraphicsDrawImage($hGraphics, $hBitmapFromStream, 0,0) ;display streamed image

    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_BitmapDispose($hBitmapFromStream)
    _GDIPlus_Shutdown()
EndFunc

Func _GUI_EVENT_CLOSE()
    GUIDelete($hGUI)
    Exit
EndFunc

thanks

EDIT:

I probably don't need to create a stream, i only need to set the quality and format "jpg" after capture and then convert the image to a string/binary, any tips?

Edited by jvds
EDIT

Share this post


Link to post
Share on other sites
jvds

Got it working like intended, new code posted below, that UEZ guy is a guru with GDIPlus stuff, i'm glad we have a user like him here =D
now i need help with Disposing stuff or someting else, I just can't get it right, the memory of process grow very fast, any one knows what is my problem here?

#include <GUIConstantsEx.au3>
#include <ScreenCapture.au3>
#include <WindowsConstants.au3>
#include <memory.au3>


$hGUI = GUICreate("Server Screen", 845, 560, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_TABSTOP), 0)
$Pic1 = GUICtrlCreatePic('', 2, 2, 843, 558)

Opt("GUIOnEventMode", 1)
GUISetOnEvent($GUI_EVENT_CLOSE, "_GUI_EVENT_CLOSE")
GUISetState(@SW_SHOW)

$iQuality = 50

While 1
    _GDIPlus_Startup()

    Local $hHBmp = _ScreenCapture_Capture("", 0, 0, @DesktopWidth, @DesktopHeight) ;create a GDI bitmap by capturing 1/4 of desktop
    Local $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hHBmp) ;convert GDI bitmap to GDI+ bitmap
    _WinAPI_DeleteObject($hHBmp)
    $hBitmap = _GDIPlus_ImageResize($hBitmap, 843-2 , 558-2) ;resize image
    $stream = _GDIPlus_StreamImage2BinaryString($hBitmap,"JPG", $iQuality, False)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_Shutdown()

;~  $stream='0xFFD8FFE000104A46494600010101006000600000FFDB004300593D434E4338594E484E645E596985DE90857A7A85FFC2CDA1DEFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDB0043015E6464857585FF9090FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0001108022C034903012200021101031101FFC4001F0000010501010101010100000000000000000102030405060708090A0BFFC400B5100002010303020403050504040000017D01020300041105122131410613516107227114328191A1082342B1C11552D1F02433627282090A161718191A25262728292A3435363738393A434445464748494A535455565758595A636465666768696A737475767778797A838485868788898A92939495969798999AA2A3A4A5A6A7A8A9AAB2B3B4B5B6B7B8B9BAC2C3C4C5C6C7C8C9CAD2D3D4D5D6D7D8D9DAE1E2E3E4E5E6E7E8E9EAF1F2F3F4F5F6F7F8F9FAFFC4001F0100030101010101010101010000000000000102030405060708090A0BFFC400B51100020102040403040705040400010277000102031104052131061241510761711322328108144291A1B1C109233352F0156272D10A162434E125F11718191A262728292A35363738393A434445464748494A535455565758595A636465666768696A737475767778797A82838485868788898A92939495969798999AA2A3A4A5A6A7A8A9AAB2B3B4B5B6B7B8B9BAC2C3C4C5C6C7C8C9CAD2D3D4D5D6D7D8D9DAE2E3E4E5E6E7E8E9EAF2F3F4F5F6F7F8F9FAFFDA000C03010002110311003F0057232790315200368381CFB53991090580269D81EB4C08CE31D17F2A4F97FBA2A5C0A303D6811102BFDD140C13F7462A5C0F5A3028022E31CA8FCA8CAFA0FCAA5C0F5A300503221B7FBA2978E385A9303D68C0A0447F2F4DA28F97FBA2A4C2E7E94605004595FEEFE94BF2E3EE8A93028E31D68022CAFF00747E54A304E368A93028DA28022E3D17F2A38FEE8FCAA5C0F5A3028191704FDD1D7D297E5FEEFE952607AD1814088CED03951D28F97FBBFA54981D334719C668023F9703E51F950718FBA3F2A93028C0F5A064636E7181F9527CBE83F2A9703D68C0A008F031F7474F4A383D87E552607AD18140888639F947E54BC63381D71526051814011F181F28E7DA9428C741F953F028C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A0066D1E83F2A368F41F953F03D68C0F5A008F68F41400A7B0A9303D68C0F5A063368C741F9521551D854981EB46D1EB4011ED5C6401410A3B0A9368F5A368F5A008C0046703F2A0A803A0A9368F5A368F5A008C283D853303D054FB47AD458A0090807D6900C1EF4AC7E43CD0386233918CFD2900119F5A40A01CF3F9531E5C1C67BF6ED4E958AC6A4923919A2E0388CFAD26D1EF4D89F7B9C12570319A53D49DC41DD400A147BD29191DE97B9FA542646DC0F38F4CD0049B467BD28E077A77734C0DFBD2B9E2800233EB46D1EFF0095248CC186338A0B93116E8450038F23BD26DC9E73F9532276DC371C834E919838087271C8F41EBF5F6EF400BB47BD2818F5A51DB9CD212DB880381DFD680108CFAD057D334E24E38EB4809258118C77F5A004DBF5A1463D695BB64903BD08C083839C1A0042327BD1B47BD26F2D800F3C70BFD6A4A0060503D6948CF634EA28023DBF5A70E077A751400DFCE8FCE9D450037F3A3F3A751400DFCE8FCE9D450037F3A3F3A751400DFCE8FCE9D450037F3A3F3A751400DFCE8FCE9D450037F3A3F3A751400DFCE8FCE9D450037F3A3F3A751400DFCE8FCE9D450037F3A3F3A751400DFCE8FCE9D450037F3A3F3A751400DFCE8FCE9D450037F3A3F3A751400DFCE8FCE9D450037F3A3F3A751400DFCE8FCE9D450037F3A3F3A751400DFCE8FCE9D450037F3A3F3A751400DFCE8FCE9D450037F3A3F3A751400DFCE8FCE9D450037F3A3F3A751400DFCE8FCE9D450037F3A3F3A751400DFCE8FCE9D450037F3A3F3A751400DFCE8FCE9D450037F3A3F3A751400DFCE8FCE9D450037F3A3F3A751400DFCE8FCE9D450037F3A3F3A751400DFCE8FCE9D450037F3A3F3A751400DFCE8FCE9D450027E751'
;~  $stream&='54D5150049FC392463E9405C74C0FC297194C671914850139CD001B4673F2E7E94150C30D823DC521894F7A3CB03A1A0002AAF4DA33E82948F5229A2203BFD2944606307A74A005C807AFB74A68099C8C67AF4A76DE724F349E581D0FB5001B872770ED4EDB8F4FCA9BE5AFA9A0C6A4E73D68017A8EA08A5DBC638C7D29BE58C019C6334794B81CF4A0002AE7236FE54EE833914DF2C6319EF9A3CB5DB8CD002FA723F2A5C1F5A6F96339C9A3CB192771C9A005073D39A33C76C7D690FCB800D3464639191ED400F19ED8FCE8030490064F5A8B69FEF1C52ED38C06EF9CD0049DF3819A33C0E9CFBD4601C8CB6714A790067A5003F3EE3F3A5E7DAA3C1DD9C8FA629086C93BBAD00499E33C7E74B5181C73CF39A7E47AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D14991EB4647AD002D4552E47AD45400800C0E283818E075F4A55FBA28638C7B9A0045E41C81D69E8A33D05354E453D3AD000AABB4702976AFF00747E542FDD14B4031AC1401C0EBE949C7F7053E8A6031769C7CA067B6282003F747E54FA28023E3FBA3F2A518271B453E8A4026D19FBA2919401C01F953A8C0CE6801B81FDD149C7F7053E8A6219C75DA3E98A38FEE8A7D1400DE3FBA28C0DB9DA29D460673DE8019C7F7452F1FDD14EA2801A3048F9451B7D02FE54EA290C4DABE83F2A4500F503F2A751400D2006C6063E9430007007E54EA28019C67EE8FCA8E3FBA29F450030E3FBA2818CF2A3F2A7D1400CE3FBA3F2A700A7F8452D1400C2064F03F2A38FEE0EB4FA2801831FDD1F951C7F7453E8A0068C7F7452719FBA29F450034007F8450401FC229D4500338FEE0EB471FDD14FA2801BC6DCED141002E768FCA9D45003060E381D7D294E01C6D1D3D29D450030E07F083464671B453E8A0434800E368A3036E768A75140C664671B451C7F7475A7D1400CE31F74528C138DA29D45003703246075F4A000413B47E54EA2801A0027EE8FCA90E01FBA29F4500338CFDD1D7D28C8033B453E8A0040A08FBA28DABE82968A004DABE828DABE82968A004DABE828DABE82968A004DABE828DABE82968A004DABE828DABE82968A004DABE828DABE82968A004DABE828DABE82968A004DABE828DABE82968A004DABE828DABE82968A004DABE828DABE82968A004DABE828DABE82968A004DABE828DABE82968A004DABE828DABE82968A004DABE828DABE82968A004DABE828DABE82968A004DABE828DABE82968A004DABE828DABE82968A004DABE828DABE82968A004DABE828DABE82968A004DABE828DABE82968A004DABE828DABE82968A0068037636FE38A654B515000BF74504E31EF42FDD14138C719A0001C8A7A75A603914F4EB400ABF7452D22FDD14B4030A4DDCF6A1BB7D7D69370F4A602EEFA51B850181C6070682C01C62810138028DC290119E946E1E9400BBBDA80D9A0303D294632681851484E28DDED400B4526EA507340051481B3DA8DC3DE8B085A29377A51B87BD03168A4DC3DE8DDEC7145842D149B80F5A037B5160168A4DDED49BFDA8B05C751485B149BFDA90C7514DDE3D0D381CD00145216028DC3DE80168A4DE3DE941CE6800A29BBB9E9FAD2E7E5CE280168A4DD49BC7BD003A8A4CF19A507271400514DDDCF4A5DDCE0D002D1485B048A0B01D41A005A29378CF7A5A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A002A2A96A2A0017EE8A0E38C8CD0BF7450D8E32334002E3B0C53D3AD31718E29E9D680157EE8A5A45FBA29680623631C8CD26471F2F7F4A71C639A4F973EF400654738FD28DCBFE452653DA8C29E05002FCBE829703D051C523100F7A004040E42D2E79C62932B8FBA7A5195C74A621723DCFD68381DA81B4938EA3AD20653D73F88A005CAFF00914991DBF4A4263E7914BB97B0CF38A0050578C7F2A32BE9FA520643DC51B93B7271D28017E503A75A4C8F4EF40652718F4A3299EDD714862E47A7E94995F4FD28CA63FF00AD49942338C7E1400FC03D853432F1C52EE51F9D20DA7A63834C05046338FC294018E94DCAEDC638F4A5C8C50004818E3AD2020E3E5A5CA9A06DC640E94008719C629DD29A481CE3AD2EE07B13482C195CE3DFD28057B0FD29703D29BF2E3A76A04282A4E31FA51900FF00F5A805473D28C2E7A77A062657D3F4A51823A714802F14A4855CF61400B81E828DA3D0526E1FE7B51BD738CF34EC02E0631DA8C0F4A28A40181E828C63A514500181E828C0F414514006D19CE28A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028'
;~  $stream&='A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A002A2A96A2A0017EE8A0E38CD0BF7450D8E334002E31C53D3AD3063B53D3AD002AFDD14B48BF7452D00C0807AD27CBE94BF4A4DA29809F2FA1A51B473D28C0A368F7A0429207E34DC03CB1CD2E3D68DA2801309FA7AD0421EBDFDE9768F7FCE8DA2800DB8E871EB46D5F4A5C5148621453D451B17D3F5A5A2801BB17D28D8B8C6334EA2801362FA7EB46C5F4A5A2801368E3DA8DABE94B450026D07B7EB40502968A004DA3D28DA3D2968A004DA3D2940028A2800C03DA8C01451400526D18C52D14009B47A52E051450026D14A46460D1450026D19CE28DA076A5A29805145148028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A002A2A90923151D000BF7450D8E3271CD0BF74507B738A0045C01F2F4A913AD307B53D3AD002AFDD14B48BF7452D00C3A5148D8C72714051D7F1A005A3229BB00FCA8DA077C5003A8A6ED1D73D6940C03EF400B4647A8A4206D20F029360E80FA5003B228C8F5A6EC07BD023E304FE54C0751914D0801E0F6A52A0FE79A402E68A4DA3A1349B07AD003A8A00C514005145140051467146450043EE68041E943A964E3AF5A6A2B6ECB0C607E74C43A9714D08DFDEE3D052ED6CF2D40052E29369C9C1C526C6FEF5003B146280303939A5C5002628C52E28C5002628C52E28C5002628C52E28C5002628C52E28C5002628C52E28C5002628C52E28C5002628C52E28C5002628C52E28C5002628C52E28C5002628C52E28C5002628C52E28C5002628C52E28C5002628C52E28C5002628C52E28C5002628C52E28C5002628C52E28C5002628C52E28C5002628C52E28C500263DA8C1F4A5EF49FE7A50018F6A31ED4B49CFAD00183E9498F6A773EB49CE2800C7B527E1FA52F3EB4D60D938CFE540D0BF8500F714D3B8E3B63DA9CA0EDE7D690344D4514500145145001451450014514500145145001451450014514500145145001451450014514500145145001476A28ED400D6ED4CA7B76A65000BF74504671CE285FBA282338A00146053D3AD314629E9D680157EE8A5A45FBA29680604669BB39CE7F4A751400D11E3A1A431E7A934FA29DC0684C77EF9E940400839E94EA2800C534A673CF5A751482E26DA4D9C75A75140EEC6ECE319A0A7BD3A8A02EC40A051B7DFB62968A043767F9C51B3DFBD3A8A006ECE319E28D9C7069D450026DF7A31CF5A5A280191FDD1F4A7D363E9F853A800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A649D3F2FE74FA649D3F2FE7400FA28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A3B51476A006B76A653DBB5328005FBA28619A17EE8A186718A00146053D3AD300C0A7A75A0055FBA296917EE8A5A0188C3228DA739CF7A18645261B3D7F5A601B4FAD1B5BD734815B1C9CFE341563DE801769CF5A55070734815877EFEB4056C8E781EF400ACB95C7F3A6ED6C6334F233F4A6956E706900056CF2DDF3D6936B63AE0E3AD3B07D7F5A4C363AD171D80291DF3C51B7AF4EB461B1D7F1A086F5FD680B0BB4FAD26D6FEF52E3D4E4F6A4C37AF6A04380C75A29B86F5FD68C37AF7A007514DC37AF3EB461B1D7F5A007514D209A5C1C8FF1A0048FA0FA53A9B1FDD1F4A75001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014C93A7E5FCE9F4C93A7E5FCE801F4514500145145001451450014514500145145001451450014514500145145001451450014514500145145001476A28ED400C27271E94DA79ED4CA0017EE8A18138C50BF7450D9ED4002E71CFF3A7A75A62E79CFAD3877A0072FDD14B48BEDD296800A283D38A6FCDEFF9D003A8A6FCDEFF009D28CF7F4A005A29A7764E28F9BF5A0075148DBB3C527CF8F7A007514873C63F1A0671CF5A005A29BF363DF147CDDA801D452024839A06ECF3D280168A69DD93E947CD9F6CD003A8A68DD919FE54A77678E9400B4527CD4996C8CFAD0009F747D29D4D4FBA3E94EA0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0029B274FCBF9D3A9B27DDFCBF9D003A8A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028ED451DA801ADDA994F6ED4CA0017EE8A1B3DA85FBA286CF18A00173839F5A7A75A62E71CD3D3AD002AFDDA5A45FBA29680607A714DCB67A52B671C7F2A4DCD9E9FA50000B7A5196F4EDE9481988E463F0A0B3F65A2C21C73DA9016EE280CDDC77F4A03364023EA68B0C32DE9DA946ECF3D2824E323D3A5265'
;~  $stream&='B3D280B012DD877A016F4A32D9E9DE80CDFDDA02C282D9E7A629096CF02979C67F4A4CB73C77A005CB67A77A1B3DA8CB7A526E6FEED00196A32DE9DE824E3A629727F5F4A004CB771C53874E681D28A0028A28A006C7D07D29D4D8FA0FA53A800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A649D3F2FE74FA649D3F2FE74031F4514500145145001451450014514500145145001451450014514500145145001451450014514500145145001476A28ED400D6ED4CA7B76A65000BF7450C48C6285FBA28638A00149239A7A75A60CF7A7A75A0055FBA296917EE8A5A01851451400514514005145140051451400514514005145140051451400514514005145140051451400D8FA0FA53A9B1F41F4A75001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014C93A7E5FCE9F4C93A7E5FCE8063E8A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A004C0F7A8EA5A8A8005FBA28638A17EE8A09C5000A7229E9D698A739E314F4EB400ABF7452D22FDD14B4030A6EEE7B52B1007349BBA714C05DDF4A370A370F4A4DE3D2810A4E00A370A381CFAD29E94009BBDA80D9A377B0A33C9E280168A4DC28270718A062D149B80A370A2C2168A4DDEA28DC3DE8B00B4526EF4146EFAD002D14DDE3D0D2EE1EF4582E2D149B87BD1BB071486247D07D29D4C8FEE8FA53E800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A649D3F2FE74FA649D3F2FE74031F4514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450015154B515000BF74504818CFAD0BF745071C67D68000723A629CA719A68C63818A720C93400E5E98A5A45E9D726968003D291885C71D694E31CD21C0C679F4A00323D3F4A4C83FC3DB347CBE828CAFF77A8CD021C4E074A4C83CF341E073CD2654F4A00372FA71F4A370F4E28CAFE18F4A32BE9FA5002E57FC8A0633D09FAD2657BFAF7A51B72303F4A004C8E38A38FEED195F4ED46549231400B91E9FA52640C645195CF4FD28053B7F2A005DCBE9FA52061E94BB47A0A368F41400647A7E949B87A76A50A00C52E07A500271E94BC5181E94018A06323FBA3E94FA6C7D07D29D400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005324E9F97F3A7D324E9F97F3A018FA28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A8AA5A8A8005FBA2838E33EB42FDD14300719F5A00063B53D3AD31718E29E9D680157EE8A5A45FBA2968060718E69B9048CF3CF1C52B638CFAD185F5FD68013E4C51F263B52E14F1FD6908507AE280171EA41F4A303D28C8A091EA28013E5F4346173D2970BEBFAD1807BFEB4F4107CBEB47CA0D18141C7734009F2D1F2D2FCBEF4985A003E5EE3F3A30839CD2E07F9346168002C052E47AD27CBEBFAD181EBFAD001B851B87BD261697E5F5FD6800DC294106930A7FFD740DB400D8FA0FA53E991FDD1F4A7D218514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005324E9F97F3A7D324E9F97F3A018FA28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A8AA5A8A8005FBA28600E33EB42FDD14300719F5A000639C53D3AD314003834F4EB400ABF7452D22FDD14B4030233EBF85370BEA69DCF6A6E067AD31000A3182697009CD1C7AD1B41EF400600A4DA3D6948F538149B411D6801703D6800039A368F5A0A834000C76A0807927F2A368CF5A02814006011D68C0F5A0A0349B066801781C645185E99A0AE68DA3D690C368F5A303D690A0CE6976FBD300007634151DE8DA339F4A523231400D217D69703D68DA28DBEF400D8FA0FA53E9B1F41F4A75200A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A649D3F2FE74FA649D3F2FE74031F4514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450015154B515000BF7450C338E718342FDD1430CE39E87340028C77A7A75A628C0C6734F4EB400ABF7452D22FDD14B4030FA526DF7A5A29809B7DE82B9EF4B45171098CFB51B7DE968A004DBEFFA526C1EB4EA28B8583145145'
;~  $stream&='2185145140051451400514514005145140051451400D8FA0FA53A9B1F41F4A75001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014C93A7E5FCE9F4C93A7E5FCE8063E8A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A002A2A96A2A0017EE8A1867183DE85FBA28604E307BD0000629E9D698A3029C0673400E5FBA296917D714B4008C0B0C038A4DA73D71CE78A561918A401B3C9CD3011558119391F5A730C8A4DAD8C67F5A082571DE80028739E3AD2AAE29BB0FB75A02303D703DA801F45336375CF3F5A501B27273C5003A8A05148028A28A0028A28A0028A28A0028A28A0028A28A006C7D07D29D4D8FA0FA53A800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A649D3F2FE74FA649D3F2FE74031F4514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450015154B515000BF7450D9E31EB42FDD143678C7AD000A08073EB4E1DE9AB9C734F4EB400ABEC38FA52D22FDDA5A0028A28A0046073C7F3A6E24F5ED4FA29DC0439E31F8D2053FE4D27CE09C67AFE94BF37BF7A2C0073B71DE82A7FC9A3E7A17764E68B00007BFF003A53CF4FF0A5A2900D209FFF005D2A82339A5A2800A28A2800A28A2800A28A2800A28A2801B1F41F4A75363E83E94EA0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A00299274FCBF9D3E99274FCBF9D00C7D1451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140054552D454002FDD143678C7AD3947CA3E534B8FF0064D0030671CE7F1A7A75A31FEC9A51C74534002FDDA5A40481F74D193FDD34003E70319EBDA9B97F4EFE94EC9FEE9A327FBA69DC068DFF00FD7A5CB7A7E94B93FDD3464FF74D17005CF39A5A4C9FEE9A327FBA6900B45264FF0074D193FDD3400B45264FF74D193FDD3400B45264FF0074D193FDD3400B45264FF74D193FDD3400B45264FF0074D193FDD3400B45264FF74D193FDD3400B45264FF0074D193FDD340091F41F4A75363E83E94EA0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A00299274FCBF9D3E99274FCBF9D003E8A4C9FEE9A327FBA680168A4C9FEE9A327FBA680168A4C9FEE9A327FBA680168A4C9FEE9A327FBA680168A4C9FEE9A327FBA680168A4C9FEE9A327FBA680168A4C9FEE9A327FBA680168A4C9FEE9A327FBA680168A4C9FEE9A327FBA680168A4C9FEE9A327FBA680168A4C9FEE9A327FBA680168A4C9FEE9A327FBA6800079C60FD6A3A9327FBA6A3A007A8CAAFA6297663A63A7148A0945C1ED4156F5CF145C0565CF1DB346D6F5EFEB41048FF00EBD2E31D3D68B80D0AD8E4E3F1A55560724E6855C63341524920FEB4EE01B48248C727346D6E39C75E05186CF5E3346D6EC7D7BD2B80A01098CF3EB4DD84E79E3D29406DDC9E282AD92411CD17000A41FC734855B390471C52E1BD7BD0148FF0CD1700DADEBFA9A369CF6EB49B1BD6821F3D78A2E2142919E949B0818CF6A007E327F0A760EDC679A7718D29939C0A52A4918238A082571FD6948248F63EB45C04DADEB46D3EDD29707703460EECFB51701A50939C814156C707D7BD2ED6C939EF48509EBEFDE8BB00DAFCF38FC69429F5FA7340521319E682095C7EB45C040AC0F51D734BB4FAD2904E39E868C1DC0FF5A2E0323FBA3E94FA6C7D07D29D48028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A002992F231F4FE74FA649FE1FCE8063B6B67AF19F5A4D8FFDEA7D14EE022821402726968A29005145140051451400514514005145140051451400514514005145140051451400514514005145140054353543400F5CEC5C1ED4F19C73D698376C5DBE947CF8C53B00FA29BF3F714997C8FAFA51601F4D21B7123A50DBB7719C63D6930DEFF9D16014863D73D7D6902B0EB9FCE8F9C7E7DE97E7C8F4EF4AC205DD919F4A086CF0452B67B67A76A43BB6E39CD1618A41C8A421B1F8529CE4707AD20DDB7A1CD1600C30E86906FCF5A72E7BD0D938C67AF6A2C034799919C629581C9233D38E693E7C52FCF8E68B001DFCE38A55DDCEEFC28E7DE9B87CFE3458030FFCE8C30EF465F8FF000A0F99DA9D84290D9E3D73461E820903A8F5A3E6F439E69586261BF4F5A5C3673FD685DF919E98E686DD9F968B0000D9F6CD215623A9CFD68C367F1A5F9B6F7CE28B086C7F747D29F4C8FEE8FA53E81851451400514514005145140051451400514514005145140051'
;~  $stream&='4514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005325E9C75FFEBD3E9927F87F3A018EC37AF7A00208FC7BD3A8A00690D93CF1410D8C669D4500370DDE9155830C938FAD3E8A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A002A1A9AA1A007AE762E3D283BFF004ED402422E076A37363A73F4A2C029271C66979FD693737A7E949BDB2011DE9D8055DDC673412D938CE28C9E3FC28C9D9DF38F4A56013E6CF7C500BF1C53893C75EBCF14809C77CF6E28B00296DDCF4C504BE4F1C5009C7E1E9464E4FF0085160132F9E94A0B60E473412D9007AD26E6C67145805CB77FE54AB9C9CD377B6320678A552493918A7601D453416E33DF3DA93737A76A2C03E8A424ECCF7A6EE627A639F4A2C03E8A6A963D7AD26E6C9E0E3E945807D14DDCDE9FA500B7F3ED45807514DCB05E993F4A4DCDE9FA51601F453771CF4EFE9402DC67F1E28B0091F4FC29D4C8FA0FA53E900514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005324FF0FE74FA649FE1FCE8024A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A86A6A8680244FB8BF4A7679E9489F717E94B4009939A371F4A5A290C4C9DB9C51934B45021327D28C9A5A28189938E940CE79A5A2810993E941241E94B450026E3E9467DA968A0600F1480E4F4A5A29884C9A326968A40264FA51B8FA52D140C40739A013E94B45310849CF146EF6A5A290C28A28A62191F4FC29D4D8FA7E14EA0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0029927F87F3A7D324FF0FE74012514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400543535434012A7DC5FA52D227DC5FA52D00145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500323E9F853A9B1F4FC29D400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005324FF0FE74FA649FE1FCE8024A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A86A6A8680254FB8BF4A5A44FB8BF4A5A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A00647D3F0A75302B818F97F3A36BFF00B3F9FF00F5A9887D14CDAFFECFE7FF00D6A36BFF00B3F9FF00F5A900FA299B5FFD9FCFFF00AD46D7FF0067F3FF00EB5003E8A66D7FF67F3FFEB51B5FFD9FCFFF00AD400FA299B5FF00D9FCFF00FAD46D7FF67F3FFEB5003E8A66D7FF0067F3FF00EB51B5FF00D9FCFF00FAD400FA299B5FFD9FCFFF00AD46D7FF0067F3FF00EB5003E8A66D7FF67F3FFEB51B5FFD9FCFFF00AD400FA299B5FF00D9FCFF00FAD46D7FF67F3FFEB5003E8A66D7FF0067F3FF00EB51B5FF00D9FCFF00FAD400FA299B5FFD9FCFFF00AD46D7FF0067F3FF00EB5003E8A66D7FF67F3FFEB51B5FFD9FCFFF00AD400FA299B5FF00D9FCFF00FAD46D7FF67F3FFEB5003E8A66D7FF0067F3FF00EB51B5FF00D9FCFF00FAD400FA299B5FFD9FCFFF00AD46D7FF0067F3FF00EB5003E8A66D7FF67F3FFEB51B5FFD9FCFFF00AD400FA299B5FF00D9FCFF00FAD46D7FF67F3FFEB5003E8A66D7FF0067F3FF00EB51B5FF00D9FCFF00FAD400FA299B5FFD9FCFFF00AD46D7FF0067F3FF00EB5003E8A66D7FF67F3FFEB51B5FFD9FCFFF00AD400FA299B5FF00D9FCFF00FAD46D7FF67F3FFEB5003E8A66D7FF0067F3FF00EB51B5FF00D9FCFF00FAD400FA299B5FFD9FCFFF00AD46D7FF0067F3FF00EB5003E8A66D7FF67F3FFEB51B5FFD9FCFFF00AD400FA299B5FF00D9FCFF00FAD46D7FF67F3FFEB5003E8A66D7FF0067F3FF00EB51B5FF00D9FCFF00FAD400FA649FE1FCE8DAFF00ECFE7FFD6A0A39EBB7F3A6049451452185145140051451400514514005145140051451400514514005145140051451400514514005145140051451400543535434012A7DC5FA52D227DC5FA52D00145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500150D4D50D004A9F717E94B489F717E94B4005145140051451400514514005145140051451400514514005145140051451400514'
;~  $stream&='5140051451400514514005148A49CE71C1A5A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A0028A28A002A1A9AA1A00953EE2FD296913EE2FD296800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A280114119C9EB4B451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400543535434012A7DC5FA52D227DC5FA52D00145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500145145001451450014514500150D4D50D004A9F717E94B489F717E94B40051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140051451400514514005145140054353543400F5242A8F5A5CFA9340C0E076A4F949F7A005CFB9A33EE68DA3D2930A33EDD680173EE68CFB9A4F93D683B475A005CFB9A33EE6906D2323A51F2E71DE80173EE68CFB9A368F4A368F4A0033EE68CFB9A368F4A368F4A0033EE68CFB9A368F4A368F4A0033EE68CFB9A368F4A368F4A0033EE68CFB9A368F4A368F4A0033EE68CFB9A368F4A368F4A0033EE68CFB9A368F4A368F4A0033EE68CFB9A368F4A368F4A0033EE68CFB9A368F4A368F4A0033EE68CFB9A368F4A368F4A0033EE68CFB9A368F4A368F4A0033EE68CFB9A368F4A368F4A0033EE68CFB9A368F4A368F4A0033EE68CFB9A368F4A368F4A0033EE68CFB9A368F4A368F4A0033EE68CFB9A368F4A368F4A0033EE68CFB9A368F4A368F4A0033EE690B71C134BB47A51B4500206C8E722973EE68DA28DA3D2800CFB9A33EE68DA3D28DA3D2800CFB9A33EE68DA3D28DA3D2800CFB9A33EE68DA3D28DA3D2800CFB9A33EE68DA3D28DA3D2800CFB9A33EE68DA3D28DA3D2800CFB9A33EE68DA3D28DA3D2800CFB9A33EE68DA3D28DA3D2800CFB9A33EE68DA3D28DA3D2800CFB9A33EE68DA3D28DA3D2800CFB9A33EE68DA3D28DA3D2800CFB9A33EE68DA3D28DA3D2800CFB9A33EE68DA3D28DA3D2800CFB9A33EE68DA3D28DA3D2800CFB9A33EE68DA3D28DA3D2800CFB9A33EE68DA3D28DA3D2800CFB9A33EE68DA3D28DA3D2800CFB9A33EE68DA3D28DA3D2800CFB9A33EE68DA3D28DA3D2800CFB9A33EE68DA3D28DA3D2800CFB9A33EE68DA3D28DA3D2800CFB9A5A4DA296800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A2800A28A280004EE23D3BD4552D439A0071D99277500286DDBB9A88F14A0E7A28C5004985FEF7E947CBCFCDD463A545919C7434B4C571F85ECD4EF9724EEC66A13C52ED2549E723F21F5F7FE54864984031BBB6297E5CE77739E6A05E4734EA604DBD7D68DEBEB50D181B739E7D290136F5F5A37AFAD434A870C7E94C09B70F5FD28DC3D7F4A899CE4814472166C66903D09772FAFE946E5F5FD29B9A4DD400FDCBEBFA51B97D7F4A8F7519A009372FAFE949BD7D6A3C9C668CD0049BD7D68DEBEB51E6901F9C1F6A009B70F5FD28DC3D7F4A6EEF7A6EE27A1A02E49B97D7F4A372FAFE94C0D914B93400EDCBEBFA51B97D7F4A8F751927A50049B97D7F4A4DEBEB51E68CD0049BD7D68DEBEB519C8A46ED4012EF5F5A37AFAD414832470281A572C6F5F5A37AFAD43823A8C52A70E28DC44DB87AFE946E1EBFA5203F293E9413C6695C05DCBEBFA51B97D7F4A66EA375301FB97D7F4A372FAFE951EEA3750049B97D7F4A4DEBEB51E68CD0049BD7D68DEBEB51E6933F32FD68026DC3D7F4A370F5FD2A2763C00694965FE3048EA29D89E624DCBEBFA51B97D7F4A606C8CD05A9143F72FAFE946E5F5FD2999CF4A4DD40126E5F5FD2937AFAD479A3340126F5F5A37AFAD479A46E940136E1EBFA51B87AFE951BB9038EA6A33BF1BB27EB9A00B1B97D7F4A372FAFE95146E5873D453B3400FDCBEBFA51B97D7F4A616A4CD0049B97D7F4A4DEBEB4CC9C66939A00937AFAD1BD7D6A3CD231F94D004BBD7D68DEBEB513FF000FD29298136F5F5A37AFAD434516026DEBEB46F5F5A868A2C04DBD7D68DEBEB50D145809B7AFAD1BD7D6A1A28B0136F5F5A37AFAD4345160'
;~  $stream&='26DEBEB46F5F5A868A2C04DBD7D68DEBEB50D2516027DEBEB46F5F5A828A009F7AFAD1BD7D6A0A28027DEBEB46F5F5A828A42B93EF5F5A37AFAD4349405C9F7AFAD1BD7D6A1032683C1C6698C9B7AFAD1BD7D6AB960081D49EC2968B013EF5F5A37AFAD40181E94B838CE3814809B7AFAD1BD7D6A0A5FC298136F5F5A37AFAD4345004DBD7D68DEBEB50819CD2E0014012EF5F5A37AFAD45B463AD21E0F140136F5F5A8772FA8A6127351E69012B8CAE052C78C723A77A6EE3ED46E34C9618CC84F6A7D3371F4146E3ED40C713819EE3A52AB7C846EC01D7D4FD299BBD851BB9CE0526AE34C775393E98C7A0A5A66E3ED46E3ED4C43E8E36F0A734CDC68DC6A5A6CA4D21FF005A075A66E341723B0AA2456EBCF7A48FE56278C91800521727A81407C7402A6C55C941C52EE350F987D051E61F41544936E346E350F987D051E61F41401286C52962462A1F30FA0A3CC3E828025A4FE2FC2A3F30FA0A3CC3D70280260718A42481F7BF2A8BCC3E828F30FA0A1680D12A9C5296A87CC3E828F30FA0A009B77B51B8D43E61F4147987D05004DB8FA51BBA7B543E61F4147987D05004A4E7A8A43DAA3F30FA0A0393D85003CD0A01229BB8FB51BBD8527E4048C7269075A66E3ED41723B0A12B2B0C981F90D0C7E4A83CC3E828F30FA0A56D6E17250700D286F6A87CC3E828F30FA0AA112939A4A8FCC3E828F30FA0A00928A8FCC3E828F30FA0A00928EE2A3F30FA0A3CC27B0E280246E69CCE0A91BB77A6474A87CC3E828F30FA0A7713448A7029DBAA1F30FA0A3CC3E8290D131626901E6A2F30FA0A3CC3E828026DDED46FF6A87CC3E828F30FA0A00949CF6A43D2A3F30FA0A3CC27B0A007B93D7D293CDE49201EDD7B537CC3E82932339DAB400F8C9EB4F07DAA2F30FA0A3CC3E828026DD46E350F987D051E61F4140136E346EA87CC3E828F30FA0A0098B6474A69E86A3F30FA0A3CC278C0A0095BB7D29299E613D40E28DC7DA801F453371F6A371F6A007D14CDC7DA8DC7DA801F453371F6A371F6A007D14CDC7DA8DC7DA801F453371F6A371F6A007D14CDC7DA8DC7DA801F48C32314DDC7DA8DC7DA8014062467B507706C8A4DC7DA8DC7DA801CA30306949CE323914CDC7DA8DC7DA801E0E2929BB8FB51B8FB52B6B70242D9CFB9CD348E7AD3771F6A371F6A7601C72071D69B83BC1C7146E3ED46E3ED400EE9CAA8DDD3340181CF269BB8FB51B8FB5002818CD38123D71DC7AD3371F6A371F6A2C03A8C7B93F5A6EE3ED46E3ED400FCFCA47A9CD14CDC7DA8DC7DA8024038CD18A8F79A5DE6801FB6908C0A6EF349BCD0004734CC53B79F414CDC6803FFD9'
;~  $streamleng = stringlen($stream)
;~  ConsoleWrite ("$streamleng="&$streamleng&@lf)
;~  $Stream = Binary($Stream)



    ;LOCAL: send data as string or binary string over tcp ($stream)
    ;Remote: recieve remote data ($stream)
;~  ConsoleWrite('$stream='&$stream&@lf)


    _GDIPlus_Startup()
    $hBitmap = _GDIPlus_BitmapCreateFromMemory($stream, True)
    ;_WinAPI_DeleteObject(GUICtrlSendMsg($Pic1, 0x0172, 0x0173, $hBitmap))
    ;_WinAPI_DeleteObject($hBitmap)
    $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hBitmap)
    Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND(GUICtrlGetHandle($Pic1)) ;create a graphics object from a window handle
    _GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 0,0) ;display streamed image

    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_BitmapDispose($hBitmap)
    $stream=""
    _GDIPlus_Shutdown()

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            ExitLoop
    EndSwitch

WEnd

Func _GUI_EVENT_CLOSE()
    GUIDelete($hGUI)
    Exit
EndFunc

Func _GDIPlus_StreamImage2BinaryString($hBitmap, $sFormat = "JPG", $iQuality = 80, $bSave = False, $sFilename = @ScriptDir & "\Converted.jpg") ;coded by UEZ 2013 build 2014-01-25; based on the code by Andreik
    Local $sImgCLSID, $tGUID, $tParams, $tData
    Switch $sFormat
        Case "JPG"
            $sImgCLSID = _GDIPlus_EncodersGetCLSID($sFormat)
            $tGUID = _WinAPI_GUIDFromString($sImgCLSID)
            $tData = DllStructCreate("int Quality")
            DllStructSetData($tData, "Quality", $iQuality) ;quality 0-100
            Local $pData = DllStructGetPtr($tData)
            $tParams = _GDIPlus_ParamInit(1)
            _GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, $pData)
        Case "PNG", "BMP", "GIF", "TIF"
            $sImgCLSID = _GDIPlus_EncodersGetCLSID($sFormat)
            $tGUID = _WinAPI_GUIDFromString($sImgCLSID)
        Case Else
            Return SetError(1, 0, 0)
    EndSwitch
    Local $hStream = _WinAPI_CreateStreamOnHGlobal() ;http://msdn.microsoft.com/en-us/library/ms864401.aspx
    If @error Then Return SetError(2, 0, 0)
    _GDIPlus_ImageSaveToStream($hBitmap, $hStream, DllStructGetPtr($tGUID), DllStructGetPtr($tParams))
    If @error Then Return SetError(3, 0, 0)

    Local $hMemory = _WinAPI_GetHGlobalFromStream($hStream) ;http://msdn.microsoft.com/en-us/library/aa911736.aspx
    If @error Then Return SetError(4, 0, 0)
    Local $iMemSize = _MemGlobalSize($hMemory)
    If Not $iMemSize Then Return SetError(5, 0, 0)
    Local $pMem = _MemGlobalLock($hMemory)
    $tData = DllStructCreate("byte[" & $iMemSize & "]", $pMem)
    Local $bData = DllStructGetData($tData, 1)
    _WinAPI_ReleaseStream($hStream) ;http://msdn.microsoft.com/en-us/library/windows/desktop/ms221473(v=vs.85).aspx
    _MemGlobalFree($hMemory)
    If $bSave Then
        Local $hFile = FileOpen($sFilename, 18)
        If @error Then Return SetError(6, 0, $bData)
        FileWrite($hFile, $bData)
        FileClose($hFile)
    EndIf
    Return $bData
EndFunc   ;==>_GDIPlus_StreamImage2BinaryString

 

Edited by jvds
edit

Share this post


Link to post
Share on other sites
UEZ

This is an old topic regard sending something over TCP -> https://www.autoitscript.com/forum/topic/108145-screenshot-over-tcp

What are you trying in the code above? Capturing something, compress it and after display the compressed image in the GUI? You did several thing incorrectly. ;)

 


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites
jvds

 

This is an old topic regard sending something over TCP -> https://www.autoitscript.com/forum/topic/108145-screenshot-over-tcp

What are you trying in the code above? Capturing something, compress it and after display the compressed image in the GUI? You did several thing incorrectly. ;)

 

I did change the script with help of this topic and another topic of yours and the script does not grow in memory like before, can you look if it is done correctly?
i also have issues resizing GUI, the image gets lost and i tried to redraw on resizing but it flickers and disappear

#include <GUIConstantsEx.au3>
#include <ScreenCapture.au3>
#include <WindowsConstants.au3>
#include <memory.au3>
#include <array.au3>

$hGUI = GUICreate("Server Screen", 845, 560, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_MAXIMIZEBOX, $WS_SIZEBOX, $WS_THICKFRAME, $WS_TABSTOP), 0)
$Pic1 = GUICtrlCreatePic('', 2, 2, 843, 558)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKRIGHT + $GUI_DOCKTOP + $GUI_DOCKBOTTOM)

Opt("GUIOnEventMode", 1)
GUISetOnEvent($GUI_EVENT_CLOSE, "_GUI_EVENT_CLOSE")
GUISetState(@SW_SHOW)

;~ GUIRegisterMsg($WM_SIZE, "WM_SIZE");resize filter

$iQuality = 50
$stream=""
;~ $WM_SIZEstream=""

While 1
    _GDIPlus_Startup()
    Local $hHBmp = _ScreenCapture_Capture("", 0, 0, @DesktopWidth, @DesktopHeight) ;create a GDI bitmap by capturing 1/4 of desktop
    Local $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hHBmp) ;convert GDI bitmap to GDI+ bitmap
    _WinAPI_DeleteObject($hHBmp)
    $pos = ControlGetPos("","",GUICtrlGetHandle($Pic1))
    $hBitmap = _GDIPlus_ImageResize($hBitmap, $pos[2] , $pos[3]) ;resize image
    $stream = _GDIPlus_StreamImage2BinaryString($hBitmap,"JPG", $iQuality, False)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_Shutdown()

    ;LOCAL: send binary data ($Stream) over tcp to a remote conection


    ;Remote: recieve remote data ($stream), code below would run on remote side to display image
    ;$Stream = Binary($Stream)
    
    _GDIPlus_Startup() ;initialize GDI+
    Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND(GUICtrlGetHandle($Pic1)) ;create a graphics object from a window handle

    Local $hBitmap = _GDIPlus_BitmapCreateFromMemory($Stream) ;load binary saved GIF image and convert it to GDI+ bitmap format
    $pos = ControlGetPos("","",GUICtrlGetHandle($Pic1))
    $hBitmap = _GDIPlus_ImageResize($hBitmap, $pos[2] , $pos[3]) ;resize image\
    Local $iW = _GDIPlus_ImageGetWidth($hBitmap), $iH = _GDIPlus_ImageGetHeight($hBitmap)
    _GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 0, 0) ;display image in GUI

    ;cleanup GDI+ resources
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_GraphicsDispose($hGraphics)
    _GDIPlus_Shutdown()
;~  $WM_SIZEstream=$stream
    $stream=""

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            ExitLoop
    EndSwitch
    
    sleep(5000) ;to test resizing

WEnd

Func _GUI_EVENT_CLOSE()
    GUIDelete($hGUI)
    Exit
EndFunc
;~ Func WM_SIZE($hWnd, $Msg, $wParam, $lParam)
;~  ConsoleWrite('>WM_SIZE()' & @LF)
;~  _GDIPlus_Startup() ;initialize GDI+
;~  $hGraphics = _GDIPlus_GraphicsCreateFromHWND(GUICtrlGetHandle($Pic1)) ;create a graphics object from a window handle
;~  Local $hBitmap = _GDIPlus_BitmapCreateFromMemory($WM_SIZEstream) ;load binary saved GIF image and convert it to GDI+ bitmap format
;~  $pos = ControlGetPos("","",GUICtrlGetHandle($Pic1))
;~  $hBitmap = _GDIPlus_ImageResize($hBitmap, $pos[2] , $pos[3]) ;resize image\
;~  Local $iW = _GDIPlus_ImageGetWidth($hBitmap), $iH = _GDIPlus_ImageGetHeight($hBitmap)
;~  _GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 0, 0) ;display image in GUI
;~  ;cleanup GDI+ resources
;~  _GDIPlus_BitmapDispose($hBitmap)
;~  _GDIPlus_GraphicsDispose($hGraphics)
;~  _GDIPlus_Shutdown()
;~ EndFunc   ;==>WM_SIZE
Func _GDIPlus_StreamImage2BinaryString($hBitmap, $sFormat = "JPG", $iQuality = 80, $bSave = False, $sFilename = @ScriptDir & "\Converted.jpg") ;coded by UEZ 2013 build 2014-01-25; based on the code by Andreik
    Local $sImgCLSID, $tGUID, $tParams, $tData
    Switch $sFormat
        Case "JPG"
            $sImgCLSID = _GDIPlus_EncodersGetCLSID($sFormat)
            $tGUID = _WinAPI_GUIDFromString($sImgCLSID)
            $tData = DllStructCreate("int Quality")
            DllStructSetData($tData, "Quality", $iQuality) ;quality 0-100
            Local $pData = DllStructGetPtr($tData)
            $tParams = _GDIPlus_ParamInit(1)
            _GDIPlus_ParamAdd($tParams, $GDIP_EPGQUALITY, 1, $GDIP_EPTLONG, $pData)
        Case "PNG", "BMP", "GIF", "TIF"
            $sImgCLSID = _GDIPlus_EncodersGetCLSID($sFormat)
            $tGUID = _WinAPI_GUIDFromString($sImgCLSID)
        Case Else
            Return SetError(1, 0, 0)
    EndSwitch
    Local $hStream = _WinAPI_CreateStreamOnHGlobal() ;http://msdn.microsoft.com/en-us/library/ms864401.aspx
    If @error Then Return SetError(2, 0, 0)
    _GDIPlus_ImageSaveToStream($hBitmap, $hStream, DllStructGetPtr($tGUID), DllStructGetPtr($tParams))
    If @error Then Return SetError(3, 0, 0)

    Local $hMemory = _WinAPI_GetHGlobalFromStream($hStream) ;http://msdn.microsoft.com/en-us/library/aa911736.aspx
    If @error Then Return SetError(4, 0, 0)
    Local $iMemSize = _MemGlobalSize($hMemory)
    If Not $iMemSize Then Return SetError(5, 0, 0)
    Local $pMem = _MemGlobalLock($hMemory)
    $tData = DllStructCreate("byte[" & $iMemSize & "]", $pMem)
    Local $bData = DllStructGetData($tData, 1)
    _WinAPI_ReleaseStream($hStream) ;http://msdn.microsoft.com/en-us/library/windows/desktop/ms221473(v=vs.85).aspx
    _MemGlobalFree($hMemory)
    If $bSave Then
        Local $hFile = FileOpen($sFilename, 18)
        If @error Then Return SetError(6, 0, $bData)
        FileWrite($hFile, $bData)
        FileClose($hFile)
    EndIf
    Return $bData
EndFunc   ;==>_GDIPlus_StreamImage2BinaryString

 

Share this post


Link to post
Share on other sites
UEZ

That's ok but you don't need to start and shutdown GDI+ in a loop. When your script starts start GDI+ and when your script ends shutdown GDI+.

Here an old snippet regarding the windows resize:

#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <ScreenCapture.au3>

Opt("GUIOnEventMode", 1)
Global $iW = 500, $iH = 500
Global Const $hGUI = GUICreate("test", $iW, $iH, -1, -1, BitOR($WS_SIZEBOX, $WS_POPUP))
GUISetState()

GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit", $hGUI)

_GDIPlus_Startup()
Global Const $hHBitmap = _ScreenCapture_Capture("", 0, 0, $iW, $iH)
Global Const $hBitmap = _GDIPlus_BitmapCreateFromHBITMAP($hHBitmap)

GUIRegisterMsg($WM_SIZE, "WM_SIZE")
GUIRegisterMsg($WM_ERASEBKGND, "WM_ERASEBKGND")
_WinAPI_RedrawWindow($hGUI)


While Sleep(1000)
WEnd

Func WM_SIZE($hWnd, $Msg, $wParam, $lParam)
    #forceref $hWnd, $Msg, $wParam, $lParam
    Local Const $aWidth = WinGetClientSize($hGUI)
    $iW = $aWidth[0]
    $iH = $aWidth[1]
    Return "GUI_RUNDEFMSG"
EndFunc   ;==>WM_SIZE

Func WM_ERASEBKGND($hWnd, $Msg, $wParam, $lParam)
    #forceref $hWnd, $Msg, $lParam
    Local Const $hGfx = _GDIPlus_GraphicsCreateFromHDC($wParam)
    _GDIPlus_GraphicsSetInterpolationMode($hGfx, 1)
    _GDIPlus_GraphicsDrawImageRect($hGfx, $hBitmap, 0, 0, $iW, $iH)
    _GDIPlus_GraphicsDispose($hGfx)
    Return True
EndFunc   ;==>WM_ERASEBKGND

Func _Exit()
    GUIRegisterMsg($WM_ERASEBKGND, "")
    GUIRegisterMsg($WM_SIZE, "")
    _WinAPI_DeleteObject($hHBitmap)
    _GDIPlus_BitmapDispose($hBitmap)
    _GDIPlus_Shutdown()
    GUIDelete()
    Exit
EndFunc   ;==>_Exit

You can adjust it for your needs.


Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

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

×