How send and get an image with Network.dll?

sitajony

Active Member
Licensed User
Hi, My second question today...
How get an Image and Send with Network.dll library?
In fact my image is a screenshot with the dzImage.dll... There's a (Example) dzimg.Image but I think I've to save the image before send...
Is there a better way?
Thanks for your answers!
 

sitajony

Active Member
Licensed User
Thanks for your replies, I found how send/receive a file but there's still a problem...
The datas it's not correctly received or sended I don't know... Cause unable to send anymore data while the data it's not receive but all is correctly received :( I send you the SBP code in few minutes...
 

sitajony

Active Member
Licensed User
So apparently, the file opened it's not close so unable to open it again...:

B4X:
Sub affichage_Tick
ErrorLabel(erreuraffichage)
If client.DataAvailable Then
affichage.Enabled=False
   taille=bin.ReadString
      If FileExist("tmp.data") Then FileDel("tmp.data")
   FileOpen(c2,"tmp.data",cRandom)
   ecriveur.New1(c2,False)
      Do While taille>0
         If taille<4096 Then
            count = bin.ReadBytes(buffer(),taille)
         Else
            count = bin.ReadBytes(buffer(),4096)
         End If
            ecran.Text=count
            ecriveur.WriteBytes2(buffer(),0,count)
            taille=taille-count
      Loop
      FileClose(c2) 'J'ai l'impression que ça ferme rien du tout, le fichier est toujours en cours d'utilisation...
      
      ecran.Text=count&" Taille manque: "&taille&" Actif encore? "&client.DataAvailable
         ecran.Image="tmp.data"
         ecriveur.Dispose
         bin.Writestring("ok")
         affichage.Enabled=True
End If

Return
erreuraffichage:
FileClose(c2)
affichage.Enabled=True
ecran.Text="Erreur récup image"
End Sub

Anyone can tell me why?
The first time all is ok and perfectly but the second time it retrurn "Erreur récup image" and when I want delete manualy the tmp.data file it retrun that the file is already in use... The same thing when I remove the GOTO ErrorLabel...
 

sitajony

Active Member
Licensed User
ecran.Image="tmp.data" is keeping it in use.

Thanks very much since 24h I'm searching where's the problem and it was just the background who was in use...
Thanks again :) So I can create an ImageList control and put in? I try...

Edit: With imagelist control it's in use again... How overwrite without remove the background image?
 
Last edited:

sitajony

Active Member
Licensed User
My soft is nearly finish :)
It's a remote PPC :) From PPC/PC to PPC/PC We can just click and view the screen anywhere even from France to England lol :)
Anyone can tell me how do a MouseDown? With Hardware library we can only do a onclick...

And why the Keycode or the Asc() function it's not valid? Example: The "a" when I type
hw.KeyPress(Asc("a")) it return "1" and W it return Call... But when i lock MAJ key the letters are ok but nothing else...
hw is an Hardware.dll's class...
 
Last edited:

pallonivel

New Member
Licensed User
My code

Here is my VB6 code:

B4X:
Dim buffer() As Byte
...
' read image file
ReDim buffer(FileLen("c:\image.jpg") - 1)
  
Open "c:\image.jpg" For Binary As 1
   Get #1, 1, buffer
Close #1
...
' send image
Socket.SendData buffer

Is this correct way to send file to PDA?

When I try to read data with PDA it just jams.
 

pallonivel

New Member
Licensed User
I got it

I found FileTransfer example and my problem is now solved. No need for example anymore :sign0089:
 
Top