Game Development Reference
In-Depth Information
_name = name;
_image = image;
_type = TextureHandleType.Bitmap;
}
public TextureHandle(string name, MemoryStream stream)
{
_name = name;
_data = new MemoryStream(stream.ToArray());
_type = TextureHandleType.RawData;
}
public TextureHandle(string name, byte[] data)
{
_name = name;
_data = new MemoryStream(data);
_type = TextureHandleType.RawData;
}
public void Dispose()
{
if (_data != null)
{
_data.Close();
_data = null;
}
}
}
Note
You will need to reference System.IO for the MemoryStream and FileInfo objects, as well as
System.Drawing for the Bitmap object.
Building the Thumbnail Control
With the loaders built, it is time to build the user interface controls. We will start
with the thumbnail control, which will show the image to the user, along with a
summarized amount of information. This control will operate as an independent
and modular unit of code, and it will be used by the texture browser.
The processing of the image data is performed by the loaders, but the original tex-
ture size will generally be too big for the thumbnail display. The thumbnail control
 
Search Nedrilad ::




Custom Search