sending png through a socket

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
Da_Elf
Posts: 311
Joined: Sun Apr 27, 2014 2:45 am

sending png through a socket

Post by Da_Elf » Fri Dec 18, 2015 6:58 pm

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

Da_Elf
Posts: 311
Joined: Sun Apr 27, 2014 2:45 am

Re: sending png through a socket

Post by Da_Elf » Fri Dec 18, 2015 7:02 pm

ok never mind. i jumped the gun and just a little more research revealed "alphadata" strange that its separate.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: sending png through a socket

Post by FourthWorld » Fri Dec 18, 2015 7:24 pm

Do you want to send the uncompressed image data, or the compressed complete file contents?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Da_Elf
Posts: 311
Joined: Sun Apr 27, 2014 2:45 am

Re: sending png through a socket

Post by Da_Elf » Tue Dec 22, 2015 5:27 pm

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

Da_Elf
Posts: 311
Joined: Sun Apr 27, 2014 2:45 am

Re: sending png through a socket

Post by Da_Elf » Fri Jan 01, 2016 8:49 pm

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?

Klaus
Posts: 14199
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: sending png through a socket

Post by Klaus » Sat Jan 02, 2016 1:22 pm

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

Da_Elf
Posts: 311
Joined: Sun Apr 27, 2014 2:45 am

Re: sending png through a socket

Post by Da_Elf » Sun Jan 03, 2016 2:59 am

ah. didnt think binfile would have worked that easily. thanks a lot

Post Reply