Сделал из примера SendPicture.sha программку, имитирующую передачу данных. Оказалось, не работает цепочка преобразования картинки в поток с последующим кодированием, декодированием и обратным преобразованием потока в картинку. Прошу помощи.
HiAsm v.3.63 b161, компилятор Delphi.
Программка для проверки указанной цепочки.
Add(MainForm,68161,21,98)
{
Left=21
Top=106
Width=395
Height=299
}
Add(ZLIB,43492,238,245)
{
link(onStream,27261:doDeCompress,[])
link(Stream,4325848:Var3,[(244,219)])
}
Add(Hub,56102,91,238)
{
OutCount=5
link(onEvent1,8560105:doRead,[(156,244)(156,237)])
link(onEvent2,43492:doCompress,[(180,251)(180,251)])
link(onEvent3,93822:doClear,[(169,258)(169,181)])
}
Add(BitmapStream,30541,364,238)
{
link(onRead,10971577:doLoad,[])
}
Add(ZLIB,27261,301,238)
{
link(onStream,30541:doRead,[])
}
Add(MemoryStream,93822,189,168)
{
}
Add(ClipboardHook,85182,28,231)
{
link(onBitmap,56102:doEvent1,[])
}
Add(Image,10971577,427,238)
{
Left=1
Top=1
Width=1024
Height=768
}
Add(GetDataEx,4325848,182,210)
{
link(Data,93822:Stream,[])
}
Add(BitmapStream,8560105,189,231)
{
link(Stream,4325848:Var2,[])
}
Учительский модуль
Add(MainForm,55395,42,140)
{
Left=21
Top=105
Width=353
Height=170
Caption="Демонстрация экрана учителя"
TaskBar=1
Position=1
Point(Close)
link(onCreate,14936586:doEvent1,[])
}
Add(FindWindow,768051,154,231)
{
}
Add(ScreenShort,9763786,126,308)
{
link(Handle,768051:Handle,[(132,282)(160,282)])
link(onCapture,56102:doEvent1,[(168,314)(168,394)(67,394)(67,454)])
}
Add(BitmapStream,23496,189,441)
{
link(Stream,81152:Data1,[])
}
Add(Timer,2968689,70,308)
{
Interval=100
Enable=1
link(onTimer,9763786:doCapture,[])
}
Add(ZLIB,9221362,252,455)
{
link(onStream,1976480:doSend,[(294,461)(294,383)(249,383)(249,195)])
link(Stream,81152:Data2,[(258,436)(202,436)])
}
Add(TCP_Server,37674,154,175)
{
Port=3796
DataType=3
link(onConnect,1976480:doOpen,[])
}
Add(MultiElementEx,1976480,259,182)
{
link(on1,3858864:doOn,[])
link(of1,3858864:doOff,[])
link(on2,8156071:doOn,[])
link(of2,8156071:doOff,[])
link(on3,3740541:doOn,[])
link(of3,3740541:doOff,[])
link(on4,13398032:doOn,[])
link(of4,13398032:doOff,[])
link(on5,15335908:doOn,[])
link(of5,15335908:doOff,[])
link(on6,13859274:doOn,[])
link(of6,13859274:doOff,[])
link(on7,785179:doOn,[])
link(of7,785179:doOff,[])
link(on8,10855125:doOn,[])
link(of8,10855125:doOff,[])
link(on9,5775146:doOn,[])
link(of9,5775146:doOff,[])
}
BEGIN_SDK
Add(EditMultiEx,9258404,3,3)
{
WorkCount=#6:doOpen|6:doSend|
EventCount=#3:on1|3:of1|3:on2|3:of2|3:on3|3:of3|3:on4|3:of4|3:on5|3:of5|3:on6|3:of6|3:on7|3:of7|3:on8|3:of8|3:on9|3:of9|
Width=426
Height=431
link(doOpen,706740:doCopy,[(22,9)(22,34)])
link(doSend,7205989:doEvent1,[(12,16)(12,139)])
}
Add(TCP_Client,52372,266,35)
{
Port=3795
IP="12.76.19.121"
DataType=3
link(onConnect,9258404:on1,[(363,48)(363,9)])
link(onDisconnect,9258404:of1,[(363,55)(363,16)])
}
Add(IndexToChanel,4070362,140,28)
{
Count=10
link(onEvent2,52372:doOpen,[])
link(onEvent3,2064813:doOpen,[(219,48)(219,83)])
link(onEvent4,14770594:doOpen,[(219,55)(219,125)])
link(onEvent5,14106352:doOpen,[(219,62)(219,167)])
link(onEvent6,5969164:doOpen,[(219,69)(219,209)])
link(onEvent7,16196984:doOpen,[(219,76)(219,251)])
link(onEvent8,13201676:doOpen,[(219,83)(219,293)])
link(onEvent9,170547:doOpen,[(219,90)(219,335)])
link(onEvent10,3400775:doOpen,[(219,97)(219,377)])
}
Add(Copy,706740,42,28)
{
Position=12
Count=1
link(onCopy,4083991:doConvert,[])
}
Add(Convertor,4083991,91,28)
{
Mode=1
link(onResult,4070362:doEvent,[])
}
Add(TCP_Client,2064813,266,77)
{
Port=3795
IP="12.76.19.122"
DataType=3
link(onConnect,9258404:on2,[(363,90)(363,23)])
link(onDisconnect,9258404:of2,[(363,97)(363,30)])
}
Add(TCP_Client,14770594,266,119)
{
Port=3795
IP="12.76.19.123"
DataType=3
link(onConnect,9258404:on3,[(363,132)(363,37)])
link(onDisconnect,9258404:of3,[(363,139)(363,44)])
}
Add(TCP_Client,14106352,266,161)
{
Port=3795
IP="12.76.19.124"
DataType=3
link(onConnect,9258404:on4,[(363,174)(363,51)])
link(onDisconnect,9258404:of4,[(363,181)(363,58)])
}
Add(TCP_Client,5969164,266,203)
{
Port=3795
IP="12.76.19.125"
DataType=3
link(onConnect,9258404:on5,[(363,216)(363,65)])
link(onDisconnect,9258404:of5,[(363,223)(363,72)])
}
Add(TCP_Client,16196984,266,245)
{
Port=3795
IP="12.76.19.126"
DataType=3
link(onConnect,9258404:on6,[(363,258)(363,79)])
link(onDisconnect,9258404:of6,[(363,265)(363,86)])
}
Add(TCP_Client,13201676,266,287)
{
Port=3795
IP="12.76.19.127"
DataType=3
link(onConnect,9258404:on7,[(363,300)(363,93)])
link(onDisconnect,9258404:of7,[(363,307)(363,100)])
}
Add(TCP_Client,170547,266,329)
{
Port=3795
IP="12.76.19.128"
DataType=3
link(onConnect,9258404:on8,[(363,342)(363,107)])
link(onDisconnect,9258404:of8,[(363,349)(363,114)])
}
Add(TCP_Client,3400775,266,371)
{
Port=3795
IP="12.76.19.129"
DataType=3
link(onConnect,9258404:on9,[(363,384)(363,121)])
link(onDisconnect,9258404:of9,[(363,391)(363,128)])
}
Add(Hub,7205989,21,133)
{
OutCount=9
link(onEvent1,6854854:doCompare,[])
link(onEvent2,10534440:doCompare,[])
link(onEvent3,15100741:doCompare,[])
link(onEvent4,5613386:doCompare,[])
link(onEvent5,2353062:doCompare,[])
link(onEvent6,15245002:doCompare,[])
link(onEvent7,9620768:doCompare,[])
link(onEvent8,14633472:doCompare,[])
link(onEvent9,13399142:doCompare,[])
}
Add(If_else,6854854,77,133)
{
Op2=Integer(1)
link(onTrue,52372:doSend,[(187,139)(187,55)])
link(Op1,52372:Active,[(83,104)(272,104)])
}
Add(If_else,10534440,84,140)
{
Op2=Integer(1)
link(onTrue,2064813:doSend,[(191,146)(191,97)])
link(Op1,2064813:Active,[(90,125)(272,125)])
}
Add(If_else,15100741,91,147)
{
Op2=Integer(1)
link(onTrue,14770594:doSend,[(194,153)(194,139)])
link(Op1,14770594:Active,[(97,137)(194,137)(194,161)(272,161)])
}
Add(If_else,5613386,98,154)
{
Op2=Integer(1)
link(onTrue,14106352:doSend,[(198,160)(198,181)])
link(Op1,14106352:Active,[(104,144)(198,144)(198,203)(272,203)])
}
Add(If_else,2353062,105,161)
{
Op2=Integer(1)
link(onTrue,5969164:doSend,[(201,167)(201,223)])
link(Op1,5969164:Active,[(111,151)(201,151)(201,245)(272,245)])
}
Add(If_else,15245002,112,168)
{
Op2=Integer(1)
link(onTrue,16196984:doSend,[(205,174)(205,265)])
link(Op1,16196984:Active,[(118,158)(205,158)(205,287)(272,287)])
}
Add(If_else,9620768,119,175)
{
Op2=Integer(1)
link(onTrue,13201676:doSend,[(208,181)(208,307)])
link(Op1,13201676:Active,[(125,165)(208,165)(208,329)(272,329)])
}
Add(If_else,14633472,126,182)
{
Op2=Integer(1)
link(onTrue,170547:doSend,[(212,188)(212,349)])
link(Op1,170547:Active,[(132,172)(212,172)(212,371)(272,371)])
}
Add(If_else,13399142,133,189)
{
Op2=Integer(1)
link(onTrue,3400775:doSend,[(215,195)(215,391)])
link(Op1,3400775:Active,[(139,179)(215,179)(215,413)(272,413)])
}
END_SDK
Add(LED,3858864,315,175)
{
Left=20
Top=40
}
Add(Label,5500938,112,21)
{
Left=30
Top=20
Width=289
Height=17
Caption="1 2 3 4 5 6 7 8 9"
}
Add(Hub,14936586,91,175)
{
link(onEvent1,768051:doFind,[(138,181)(138,237)])
link(onEvent2,37674:doOpen,[(138,188)(138,181)])
}
Add(LED,8156071,329,189)
{
Left=55
Top=40
}
Add(LED,3740541,336,203)
{
Left=90
Top=40
}
Add(LED,13398032,343,217)
{
Left=125
Top=40
}
Add(LED,15335908,350,231)
{
Left=160
Top=40
}
Add(LED,13859274,357,245)
{
Left=195
Top=40
}
Add(LED,785179,364,259)
{
Left=230
Top=40
}
Add(LED,10855125,371,273)
{
Left=265
Top=40
}
Add(LED,5775146,378,287)
{
Left=300
Top=40
}
Add(Button,10512727,14,308)
{
Left=120
Top=85
Width=105
Caption="Начать посылку"
link(onClick,2968689:doTimer,[])
}
Add(TrayIcon,16657583,46,93)
{
link(onClick,16657583:doShow,[(88,91)(88,75)(36,75)(36,91)])
}
Add(GetData,81152,189,385)
{
link(Data,15106105:Stream,[])
}
Add(Hub,56102,77,448)
{
OutCount=3
link(onEvent1,23496:doWrite,[])
link(onEvent2,9221362:doCompress,[])
link(onEvent3,15106105:doClear,[(149,468)(149,356)])
}
Add(MemoryStream,15106105,189,343)
{
}
Ученичкский модуль
Add(MainForm,55395,84,91)
{
Width=1024
Height=768
Caption="DemoScr"
BorderStyle=0
TaskBar=1
Cursor=6
MouseCapture=0
Position=1
Point(Close)
link(onCreate,1672626:doEvent1,[(180,132)(180,251)])
}
Add(Image,29259,553,175)
{
Width=1024
Height=768
Align=5
Color=-16777201
Point(doRefresh)
Point(onMouseMove)
}
Add(DoData,9304555,497,294)
{
Data=String(Сервер)
link(onEventData,14715083:doWork3,[(557,300)])
}
Add(DoData,16741353,35,231)
{
Data=Integer(1)
link(onEventData,8225147:doPopup,[])
}
Add(Hub,1672626,245,245)
{
link(onEvent1,16741353:doData,[(287,251)(287,221)(25,221)(25,237)])
link(onEvent2,46308:doEvent1,[(299,258)(299,188)])
}
Add(WinTools,8225147,84,224)
{
Point(doMaximize)
link(Handle,55395:Handle,[(90,183)(90,183)])
}
Add(HubEx,14715083,553,245)
{
link(onEvent,16520521:doText,[])
}
Add(HubEx,10719596,427,189)
{
link(onEvent,55395:doClose,[(446,202)(446,163)(74,163)(74,118)])
}
Add(ZLIB,27261,462,175)
{
link(onStream,30541:doRead,[])
}
Add(TCP_Client,52372,392,231)
{
Port=3796
IP="12.76.19.120"
DataType=3
link(onConnect,15285810:doData,[(460,244)(460,258)])
link(onDisconnect,10719596:doWork3,[(431,251)])
}
Add(TCP_Server,37674,392,182)
{
Port=3795
DataType=3
link(onRead,27261:doDeCompress,[])
link(onConnect,9304555:doData,[(460,195)(460,300)])
link(onDisconnect,10719596:doWork2,[(427,202)])
}
Add(Hub,46308,322,182)
{
link(onEvent1,52372:doOpen,[(373,188)(373,237)])
link(onEvent2,37674:doOpen,[(373,195)(373,188)])
}
Add(Label,16520521,574,252)
{
Left=350
Top=300
Width=400
Height=50
Font=[Times New Roman,36,1,0,204]
Caption="Демонстрация"
}
Add(BitmapStream,30541,511,175)
{
link(onRead,29259:doLoad,[])
}
Add(DoData,15285810,497,252)
{
Data=String(Клиент)
link(onEventData,14715083:doWork2,[(553,258)])
}