[Opensim-dev] How to retreive pictures from the inventory ?

Frisby, Adam adam at deepthink.com.au
Wed Feb 17 23:36:21 UTC 2010


It's a JPEG2000 image, Bitmap doesn't support J2C. There's a Utility method for converting to a Bitmap however. (not sure what it is)

Regards,

Adam

From: opensim-dev-bounces at lists.berlios.de [mailto:opensim-dev-bounces at lists.berlios.de] On Behalf Of Valentin Castan
Sent: Wednesday, 17 February 2010 8:26 AM
To: opensim-dev at lists.berlios.de
Subject: Re: [Opensim-dev] How to retreive pictures from the inventory ?

Thanks for your help, but I still have a problem, and I don't really know whats wrong. This is my code :

            AssetBase asset = scene.AssetService.Get(item.AssetID.ToString());
            byte[] byteArray = asset.Data;
            using (MemoryStream ms = new MemoryStream(byteArray))
            {
                Bitmap img = (Bitmap)Image.FromStream(ms);   <---------   error, parameter is not valid
            }

It seems that my MemoryStream is not valid, and I think it's because the byte array is not correct to convert to Image. But the object I retreive is an image, so I don't understand what's wrong. OpenSim does modification of this array ?

Thank you a lot,
Valentin
On Wed, Feb 17, 2010 at 1:45 AM, Alan M Webb <alan_webb at us.ibm.com<mailto:alan_webb at us.ibm.com>> wrote:

Hi Valentin

If you look at the Rest application plug-in, it supports the retrieval and uploading of inventory data, both catalog data and the assets themselves.

Best regards
Alan
-------------------
T.J. Watson Research Center, Hawthorne, NY
1-914-784-7286
alan_webb at us.ibm.com<mailto:alan_webb at us.ibm.com>

From:

Valentin Castan <valentin.castan at gmail.com<mailto:valentin.castan at gmail.com>>

To:

opensim-dev at lists.berlios.de<mailto:opensim-dev at lists.berlios.de>

Date:

02/15/2010 02:16 AM

Subject:

[Opensim-dev] How to retreive pictures from the inventory ?


________________________________


Dear all,

I'm working on a project where I have to process images, using another application, and then display something in OpenSim. I would like to let users to upload their pictures on OpenSim, but I have to retreive these pictures, and copy them in a special directory.
My problem is in the code of OpenSim, I only can find how to retreive an InventoryItemBase from the inventory, but I didn't find any way to retreive a picture, to be able to copy it.
Does someone know how can I retreive pictures from the Inventory, but not as an InventoryItemBase, but as something I can use as a picture ?

Thank you a lot for your help,
Best regards,
Valentin Castan_______________________________________________

Opensim-dev mailing list
Opensim-dev at lists.berlios.de<mailto:Opensim-dev at lists.berlios.de>
https://lists.berlios.de/mailman/listinfo/opensim-dev


_______________________________________________
Opensim-dev mailing list
Opensim-dev at lists.berlios.de<mailto:Opensim-dev at lists.berlios.de>
https://lists.berlios.de/mailman/listinfo/opensim-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20100217/c84bd232/attachment-0001.html>


More information about the Opensim-dev mailing list