Click here to Skip to main content
15,921,884 members
Home / Discussions / C#
   

C#

 
AnswerRe: vb.net code to csharp Pin
Not Active21-May-07 8:53
mentorNot Active21-May-07 8:53 
GeneralRe: vb.net code to csharp Pin
Dave Kreskowiak21-May-07 9:32
mveDave Kreskowiak21-May-07 9:32 
GeneralRe: vb.net code to csharp Pin
raj51021-May-07 9:42
raj51021-May-07 9:42 
GeneralRe: vb.net code to csharp Pin
Dave Kreskowiak21-May-07 10:06
mveDave Kreskowiak21-May-07 10:06 
GeneralRe: vb.net code to csharp Pin
Not Active21-May-07 9:47
mentorNot Active21-May-07 9:47 
GeneralRe: vb.net code to csharp Pin
raj51021-May-07 9:36
raj51021-May-07 9:36 
GeneralRe: vb.net code to csharp Pin
Dave Kreskowiak21-May-07 9:42
mveDave Kreskowiak21-May-07 9:42 
QuestionCall to Graphics.DrawString thows invalid argument on call to System.Drawing.Graphics.CheckErrorStatus Pin
DoomedOne21-May-07 8:25
DoomedOne21-May-07 8:25 
Hi,

I’m having a problem whit a call to Graphics.DrawString (C# 2005 Express .Net Framework 2.0).
The program draws some images, gradients and text to a bitmap, that is copied to a PictureBox in a form, it is done this way because of the time to render de bitmap is relatively high, and I don’t want the user to see id been drawn on the screen.
This process iterates on a timer tick event changing the text and colors.
The first time it renders correctly.
The next timer tick event is fired it calls the DrawString to the bitmap and I get a “Invalid Argument Exception” in a call to “System.Drawing.Graphics.CheckErrorStatus(Int32 status)”

I verified the parameters to DrawString call, and all are apparently correct (no nulls, all types correct, and no missing data?).

Any Ideas what’s wrong? Confused | :confused: Frown | :(


Here is the stack Trace

in System.Drawing.Graphics.CheckErrorStatus(Int32 status)
in System.Drawing.Graphics.DrawString(String s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format)
in ArribosPartidas.Principal.Paginar() in Principal.cs:line 1259
in ArribosPartidas.Principal.timer_Tick(Object sender, EventArgs e) in Principal.cs:line 1106
in System.Windows.Forms.Timer.OnTick(EventArgs e)
in System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
in System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
in System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
in System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
in System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
in System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
in System.Windows.Forms.Application.Run(Form mainForm)
in ArribosPartidas.Program.Main() in Program.cs:line 17"






AnswerRe: Call to Graphics.DrawString thows invalid argument on call to System.Drawing.Graphics.CheckErrorStatus Pin
Dave Kreskowiak21-May-07 8:29
mveDave Kreskowiak21-May-07 8:29 
GeneralRe: Call to Graphics.DrawString thows invalid argument on call to System.Drawing.Graphics.CheckErrorStatus Pin
DoomedOne21-May-07 8:46
DoomedOne21-May-07 8:46 
GeneralRe: Call to Graphics.DrawString thows invalid argument on call to System.Drawing.Graphics.CheckErrorStatus Pin
Dave Kreskowiak21-May-07 9:17
mveDave Kreskowiak21-May-07 9:17 
GeneralRe: Call to Graphics.DrawString thows invalid argument on call to System.Drawing.Graphics.CheckErrorStatus Pin
DoomedOne21-May-07 9:40
DoomedOne21-May-07 9:40 
GeneralRe: Call to Graphics.DrawString thows invalid argument on call to System.Drawing.Graphics.CheckErrorStatus Pin
Dave Kreskowiak21-May-07 10:10
mveDave Kreskowiak21-May-07 10:10 
GeneralRe: Call to Graphics.DrawString thows invalid argument on call to System.Drawing.Graphics.CheckErrorStatus Pin
DoomedOne21-May-07 10:46
DoomedOne21-May-07 10:46 
GeneralRe: Call to Graphics.DrawString thows invalid argument on call to System.Drawing.Graphics.CheckErrorStatus Pin
Luc Pattyn21-May-07 12:40
sitebuilderLuc Pattyn21-May-07 12:40 
GeneralRe: Call to Graphics.DrawString thows invalid argument on call to System.Drawing.Graphics.CheckErrorStatus Pin
DoomedOne22-May-07 3:05
DoomedOne22-May-07 3:05 
AnswerRe: Call to Graphics.DrawString thows invalid argument on call to System.Drawing.Graphics.CheckErrorStatus Pin
DoomedOne22-May-07 7:22
DoomedOne22-May-07 7:22 
QuestionHow to validate decimal value Pin
indiaone21-May-07 7:21
indiaone21-May-07 7:21 
AnswerRe: How to validate decimal value Pin
Sven Cipido21-May-07 7:34
Sven Cipido21-May-07 7:34 
AnswerRe: How to validate decimal value Pin
Are Jay21-May-07 8:00
Are Jay21-May-07 8:00 
QuestionDerived class constructors Pin
~~~Johnny~~~21-May-07 7:08
~~~Johnny~~~21-May-07 7:08 
AnswerRe: Derived class constructors Pin
Not Active21-May-07 7:15
mentorNot Active21-May-07 7:15 
AnswerRe: Derived class constructors Pin
Dave Kreskowiak21-May-07 7:24
mveDave Kreskowiak21-May-07 7:24 
GeneralRe: Derived class constructors Pin
~~~Johnny~~~21-May-07 7:36
~~~Johnny~~~21-May-07 7:36 
GeneralRe: Derived class constructors Pin
Dave Kreskowiak21-May-07 8:24
mveDave Kreskowiak21-May-07 8:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.