I am in collaboration with Kansas State University on a research
project this year exploring "Student Self Efficacy in STEM Subjects
using 3D Virtual Environments" .. the "3D virtual environments" are
Opensim and OpenCobalt ... I am REALLY wanting to be able to allow the
students to quickly take screen snapshots of their work and have
cobbled together something that appears to "almost" work, maybe. I
have been tinkering with writing out a scene screen shots to a server
for review .... below is what I have been using:
===========================
===== CODE BELOW ==========
===========================
publishSpaceNamed: spName description: desc
| url args result aContact contactXml form byteStream foo writer |
aContact := self getExternalContactInfo.
contactXml := aContact asJoinmeXmlString.
url := '
http://kindlelab.com/saved/publish.php'.
args := Dictionary new.
spName ifNotNil: [
args at: 'name' put: {spName}
].
desc ifNotNil:[
args at: 'description' put: {desc}
].
args at: 'postcard' put: {contactXml}.
args at: 'id' put: {aContact id asString}.
form := self ogl screenShot.
byteStream := RWBinaryOrTextStream on: (ByteArray new: 1000).
writer :=PNGReadWriter on: byteStream.
Cursor write showWhile: [
writer nextPutImage: form].
writer close.
foo := Base64MimeConverter mimeEncode: byteStream.
args at: 'screenshot' put: {foo contents}.
result := HTTPClient httpPostMultipart: url args: args.
Transcript show: result content.
===========================
====== END CODE ===========
===========================
Here are all the elements from the form that is being posted & written
to the server -
http://kindlelab.com/saved/worlds.txt
... the actual image contents follow the "JPEG ScreenShot:" (this
should actually read "PNG Screenshot") text .... (minus header info)
"publish.php" saves the result out to the web server is what I would
expect to be a .png file ( using PNGReadWriter ) ... but when a .png
extension is applied to the resulting saved file .. error city ....
not 100% sure what I am looking at here so any help would be hugely
appreciated !