Page 1 of 1

sending png through a socket

Posted: Fri Dec 18, 2015 6:58 pm
by Da_Elf
i started my tests with a jpg and had two images the same size. one called "try" and the other called "returnit"
i setup two buttons. the first did this

Code: Select all

global myvar

on mouseUp
   answer file "Get your image"
   set the filename of img "try" to it
   put "image! "& the imageData of img "try" into myvar
end mouseUp
the second did this

Code: Select all

global myvar
on mouseUp
   if the first word of myvar is "image!" then
      delete the first word of myvar
      set the imageData of img "returnit" to myvar
   end if
end mouseUp
it worked great with the jpg. but then i tried with a png. it seems that its the alpha info thats getting messed up

Re: sending png through a socket

Posted: Fri Dec 18, 2015 7:02 pm
by Da_Elf
ok never mind. i jumped the gun and just a little more research revealed "alphadata" strange that its separate.

Re: sending png through a socket

Posted: Fri Dec 18, 2015 7:24 pm
by FourthWorld
Do you want to send the uncompressed image data, or the compressed complete file contents?

Re: sending png through a socket

Posted: Tue Dec 22, 2015 5:27 pm
by Da_Elf
uncompressed. i didnt want to send the file, just the image data so that one image matches another on the other end within the program

Re: sending png through a socket

Posted: Fri Jan 01, 2016 8:49 pm
by Da_Elf
if i did want a software to send a png file thats on my hard drive to another software on the other end of a socket to be saved to a location on that systems drive, how would i do that?

Re: sending png through a socket

Posted: Sat Jan 02, 2016 1:22 pm
by Klaus
HI Da_Elf (Legolas? :D )

maybe you mean something like:

Code: Select all

global myvar

on mouseUp
   answer file "Get your image"
   put url("binfile:" & it) into myvar
end mouseUp
Then put the content of "myvar" into another BINFILE on the target machine.


Best/namárië 8)

Klaus

Re: sending png through a socket

Posted: Sun Jan 03, 2016 2:59 am
by Da_Elf
ah. didnt think binfile would have worked that easily. thanks a lot