Вверх ↑
Ответов: 253
Рейтинг: 0
#1: 2018-09-30 13:59:13 ЛС | профиль | цитата
Есть ли возможность через TCP передать картинку.
Нужно с пк через TCP_Server в пакете Windows передать картинку на телефон. Желательно в сетку.
Вот код Андроид

Add(MainActivity,12276863,140,56)
{
Width=336
Height=435
DefaultLayout="def"
}
Add(EditText,4987294,224,147)
{
Left=5
Top=70
Width=295
Text="Test data 123"
}
Add(Menu,1266529,77,105)
{
ItemNames=#7:Connect|10:Disconnect|4:Send|
ItemCount=3
link(onClick1,15197338:doExec,[])
link(onClick2,12294448:doExec,[(127,118)(127,153)])
link(onClick3,10790498:doWrite,[(120,125)(120,202)])
}
Add(TCPClient,3311743,203,105)
{
IP="192.168.0.33"
Port=2828
link(onConnectResult,10382311:doSetText,[])
link(onError,5784175:doWork1,[(263,118)])
}
Add(SimpleStreamRW,10790498,203,196)
{
ListenerState=0
Point(WritingData)
Point(doListenerState)
link(onRead,3714020:doCreate,[(282,202)(282,300)])
link(onError,5784175:doWork2,[])
link(InputStream,3311743:InputStream,[])
link(OutputStream,3311743:OutputStream,[])
link(WritingData,4987294:Value,[(223,188)(230,188)])
}
Add(ToastNotification,7399129,329,203)
{
}
Add(CheckBox,5967125,140,203)
{
Left=5
Top=105
Width=295
Caption="Читать входящие данные"
link(onChange,10790498:doListenerState,[])
}
Add(HubEx,5784175,259,203)
{
link(onEvent,10323848:doCallEvent,[])
}
Add(AsyncTask,15197338,140,105)
{
link(onBackground,3311743:doConnect,[])
}
Add(AsyncTask,12294448,140,147)
{
link(onBackground,3311743:doDisconnect,[(188,153)(188,118)])
}
Add(LayoutLinear,3977741,77,56)
{
Name="def"
Order=1
HeightMode=1
WidthMode=1
pLeft="12dp"
pTop="12dp"
pRight="12dp"
pBottom="12dp"
}
Add(LayoutLinear,385300,77,147)
{
Name="hor"
Orientation=1
LayoutManager="def"
WidthMode=1
}
Add(TextView,5573739,77,203)
{
Left=5
Top=45
Width=155
Caption="Данные для отправки"
}
Add(UIThread,10323848,280,203)
{
link(onEvent,7399129:doShow,[])
}
Add(TextView,10382311,287,105)
{
Left=10
Top=10
Caption="Статус"
}
Add(ImageGridView,3185911,371,266)
{
Left=5
Top=145
Width=317
Height=202
}
Add(Bitmap,3714020,329,294)
{
link(onCreate,3185911:doAddBitmap,[(366,300)(366,272)])
}


а вот код Windows


Add(MainForm,4283780,133,147)
{
Width=476
Height=433
Caption=""
BorderStyle=1
Point(onDblClick)
link(onCreate,12873586:doEvent1,[(173,167)(173,153)])
}
Add(ChildScrollBox,12485141,231,273)
{
FirstUsage=0
link(onEvent2,3445578:doSend,[(289,286)(289,272)])
}
BEGIN_SDK
Add(EditMulti,7476510,21,21)
{
EventCount=2
WorkCount=1
link(doWork1,2629711:doSearch,[(70,27)(70,111)])
}
Add(ScrollBox,14718401,35,105)
{
Top=30
Width=468
Height=369
}
Add(ChildPanelEx,13513837,217,98)
{
Mode=1
link(onChange,3932331:doEvent1,[(251,104)(251,153)])
}
BEGIN_SDK
Add(EditMultiEx,9271718,21,21)
{
WorkCount=#5:##add|6:doLeft|
EventCount=#8:onChange|8:onEvent2|
VarCount=#7:##index|
DataCount=#3:Str|
Point(##add)
Point(##index)
link(##add,12559733:doEvent1,[(67,27)(67,55)])
link(doLeft,5208401:doLeft,[(28,34)(28,118)])
}
Add(Panel,5208401,35,105)
{
Left=5
Top=5
Width=213
Height=168
Layout="parent.grid"
Point(doLeft)
}
Add(Image,4977142,112,49)
{
Left=2
Top=2
Width=209
Height=164
Align=5
link(Bitmap,9271718:Str,[(118,35)(27,35)])
}
Add(Hub,12559733,77,49)
{
link(onEvent1,4977142:doLoad,[])
link(onEvent2,9271718:onChange,[(206,62)(206,27)])
}
END_SDK
Add(GridLayout,4496329,273,98)
{
Name="grid"
Rows=5
Cols=2
}
Add(Img_Loader,2181884,168,98)
{
link(onLoad,7476510:onEvent2,[(260,104)(260,34)])
}
Add(FileSearch,2629711,119,105)
{
Dir="C:\Users\Егор\Desktop\Mega Parser1\Photo1"
SubDir=1
link(onSearch,2181884:doLoad,[(159,111)(159,104)])
}
Add(Hub,3932331,252,147)
{
link(onEvent1,7476510:onEvent1,[(294,153)(294,27)])
link(onEvent2,4496329:doResize,[(270,160)(270,104)])
}
END_SDK
Add(TCP_Server,3445578,315,252)
{
Port=2828
link(onConnect,2989281:doOn,[(383,265)(383,279)])
}
Add(Hub,12873586,182,147)
{
link(onEvent1,3445578:doOpen,[(256,153)(256,258)])
}
Add(Button,13040911,168,273)
{
Left=5
Top=5
Width=320
link(onClick,12485141:doWork1,[])
}
Add(LED,2989281,420,259)
{
Left=350
Top=10
}

карма: 0

0