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: [email protected] 
[mailto:[email protected]] On Behalf Of Valentin Castan
Sent: Wednesday, 17 February 2010 8:26 AM
To: [email protected]
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 
<[email protected]<mailto:[email protected]>> 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
[email protected]<mailto:[email protected]>

From:

Valentin Castan <[email protected]<mailto:[email protected]>>

To:

[email protected]<mailto:[email protected]>

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
[email protected]<mailto:[email protected]>
https://lists.berlios.de/mailman/listinfo/opensim-dev


_______________________________________________
Opensim-dev mailing list
[email protected]<mailto:[email protected]>
https://lists.berlios.de/mailman/listinfo/opensim-dev

_______________________________________________
Opensim-dev mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/opensim-dev

Reply via email to