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

Valentin Castan valentin.castan at gmail.com
Wed Feb 17 16:25:54 UTC 2010


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> 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
>
>
>  From: Valentin Castan <valentin.castan at gmail.com> To:
> 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
> https://lists.berlios.de/mailman/listinfo/opensim-dev
>
>
>
> _______________________________________________
> Opensim-dev mailing list
> 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/20100218/b2331937/attachment-0001.html>


More information about the Opensim-dev mailing list