M
mrabie
Hi All,
I am writing a custom control and that i create a graphics buffer for
when it's initializing. the code is as follows
private void CreateBackBuffer()
{
CleanupBackBuffer();
m_backBufferBitmap = new Bitmap(Bounds.Width,
Bounds.Height);
m_backBuffer = Graphics.FromImage(m_backBufferBitmap);
}
when i try to run the application i get the following error @
m_backBufferBitmap = new Bitmap(Bounds.Width, Bounds.Height);
System.ArgumentException was unhandled
Message="Value does not fall within the expected range."
StackTrace:
at Microsoft.AGL.Common.MISC.HandleAr()
at System.Drawing.Bitmap._Init()
at System.Drawing.Bitmap..ctor()
at testklist.KListControl.CreateBackBuffer()
at testklist.KListControl..ctor()
at testklist.Form1.InitializeComponent()
at testklist.Form1..ctor()
at testklist.Program.Main()
InnerException:
The values for bounds are
Location: 0,0
Width = 150
Height = 150
i am using VS 2008 .Net 3.5 platoform WM6
Any ideas why this is happening or how can i fix it would be really
appreciated.
Thanks for your help in advance
I am writing a custom control and that i create a graphics buffer for
when it's initializing. the code is as follows
private void CreateBackBuffer()
{
CleanupBackBuffer();
m_backBufferBitmap = new Bitmap(Bounds.Width,
Bounds.Height);
m_backBuffer = Graphics.FromImage(m_backBufferBitmap);
}
when i try to run the application i get the following error @
m_backBufferBitmap = new Bitmap(Bounds.Width, Bounds.Height);
System.ArgumentException was unhandled
Message="Value does not fall within the expected range."
StackTrace:
at Microsoft.AGL.Common.MISC.HandleAr()
at System.Drawing.Bitmap._Init()
at System.Drawing.Bitmap..ctor()
at testklist.KListControl.CreateBackBuffer()
at testklist.KListControl..ctor()
at testklist.Form1.InitializeComponent()
at testklist.Form1..ctor()
at testklist.Program.Main()
InnerException:
The values for bounds are
Location: 0,0
Width = 150
Height = 150
i am using VS 2008 .Net 3.5 platoform WM6
Any ideas why this is happening or how can i fix it would be really
appreciated.
Thanks for your help in advance