[Opensim-dev] creating some Asset
Daniel Herzog
dhe at mms-dresden.de
Tue Sep 8 17:13:33 UTC 2009
Hi all,
I'm trying to map a picture stored in an image file to a texture situated on
a prim in Opensim via code. For that reason I have looked to the
osMakeNotecard() function in OSSL_Api.cs to get an overview which steps are
needed to upload an object to an inventory.
The first thing they do is to create an AssetBase followed by a
TaskInventoryItem that could be added to the inventory of the specified
prim. For me it seems that the AssetBase object has the data of the object
that should be added (for me: the data of the image) and is connected with
the TaskInventoryItem in the next step.
To get started, I have created an AssetBase object as well as an
TaskInventoryItem as shown in the osMakeNotecard function. To fill my
AssetBase object with some data, I have used the LoadAsset function found in
AssetLoadeFileSystem.cs (in addition I have also tried to get the data of an
image file with the function shown below). As a result I see the new
TaskItem in the inventory list of my prim as an image but unfortunately with
no content. What might be the reason for that empty image?
Furthermore, is this the right way by creating an AssetBase and a
TaskInventoryItem to get an image on a prim via code? Are there any other
possibilities?
Thanks in advance,
Daniel
-----------------------------------------------
private byte[] BildToByteArray(Image Bild,
System.Drawing.Imaging.ImageFormat Bildformat)
{
MemoryStream IS = new MemoryStream();
Bild.Save(IS, Bildformat);
IS.Flush();
return IS.ToArray();
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20090908/90389ce0/attachment-0001.html>
More information about the Opensim-dev
mailing list