Normal
You'll have to use the Texturemanager to convert the bitmap to a texture and then load that texture to the control. But you need to make sure they get unloaded too when you don't need them anymore or the memory usage will go through the roof.Something like:[CODE]System.Drawing.Image img = whatever.LoadImage();string name = "whatever"; // unique per thumbnail, perhaps use the pathSize s = new Size(100,100);item.ThumbnailImage = buildMemoryImage(img, name, s);public static string buildMemoryImage(System.Drawing.Bitmap image, string identifier, System.Drawing.Size size){ string name = String.Format("[Thumbnail:{0}]", identifier); try { if (GUITextureManager.LoadFromMemory(null, name, 0, 0, 0) == 0) { GUITextureManager.LoadFromMemory(image, name, 0, size.Width, size.Height); } } catch (Exception ex) { // error } return name;}[/CODE]Because it doesnt search recursivly, its just a test app
You'll have to use the Texturemanager to convert the bitmap to a texture and then load that texture to the control. But you need to make sure they get unloaded too when you don't need them anymore or the memory usage will go through the roof.
Something like:
[CODE]System.Drawing.Image img = whatever.LoadImage();
string name = "whatever"; // unique per thumbnail, perhaps use the path
Size s = new Size(100,100);
item.ThumbnailImage = buildMemoryImage(img, name, s);
public static string buildMemoryImage(System.Drawing.Bitmap image, string identifier, System.Drawing.Size size)
{
string name = String.Format("[Thumbnail:{0}]", identifier);
try
if (GUITextureManager.LoadFromMemory(null, name, 0, 0, 0) == 0)
GUITextureManager.LoadFromMemory(image, name, 0, size.Width, size.Height);
}
catch (Exception ex)
// error
return name;
}[/CODE]
Because it doesnt search recursivly, its just a test app