- Moderator
- #1
Hi all,
I'm currently writing a MP plugin and I am stuck on a problem that may be simple fix
My plugin creates an System.Drawing.Image and I would like to display and update this image on a GUIImage/GUIButton background texture, The problem is the GUIImage/GUIButton class only allows me to pass a filename for the texture not a Image or Bitmap.
Saving the image as a file first is not an option as it update at 30fps (too fast for create and show).
Option 1: rendering the image to the surface myself (not too keen as I would like to use focus/click and mouse events of the GUIControl)
Option 2: Is it possible to make a MP user GUIControl.
Any help/Ideas would be awesome
Edit: can I use the GUIImage.MemoryImage method to set the memoryimage?
Cheers Sa_ddam213
Can do it this way but Max fps = 6fps
If I pass this to a Windows.forms picturebox (as an Image not file) I can get 30-40 fps
so if I can get the GUIImage to do the same would be perfect
I'm currently writing a MP plugin and I am stuck on a problem that may be simple fix
My plugin creates an System.Drawing.Image and I would like to display and update this image on a GUIImage/GUIButton background texture, The problem is the GUIImage/GUIButton class only allows me to pass a filename for the texture not a Image or Bitmap.
Saving the image as a file first is not an option as it update at 30fps (too fast for create and show).
Option 1: rendering the image to the surface myself (not too keen as I would like to use focus/click and mouse events of the GUIControl)
Option 2: Is it possible to make a MP user GUIControl.
Any help/Ideas would be awesome
Edit: can I use the GUIImage.MemoryImage method to set the memoryimage?
Cheers Sa_ddam213
Code:
public static Image movingIMG;
public void DrawMovingImage(GUIImage image)
{
image.RemoveMemoryImageTexture();
Bitmap bmp = new Bitmap(movingIMG.Width, movingIMG.Height);
movingIMG.DrawToBitmap(bmp,movingIMG.ClientRectangle);
bmp.Save(@"c:\test.png");
image.FileName = @"c:\test.png";
bmp.dispose();
}
Can do it this way but Max fps = 6fps
If I pass this to a Windows.forms picturebox (as an Image not file) I can get 30-40 fps
so if I can get the GUIImage to do the same would be perfect