locked
Parameter is not valid. System.Drawing RRS feed

  • Question

  •  Mybrowser.DrawToBitmap  doesn't work for some files. I don't understand wats the problem sometime it works, most of the time it throws the 'Parameter is not valid' error.

    Bitmap myBitmap =new Bitmap(Width, Height);

    Rectangle DrawRect =new Rectangle(0, 0, Width, Height);

    MyBrowser.DrawToBitmap(myBitmap, DrawRect);


    The same thing works in the windows application but not in the web application.

    Please help.

    • Moved by jack 321 Friday, June 20, 2008 3:40 AM off topic
    Tuesday, June 17, 2008 1:22 PM

Answers

All replies

  • Hi

    Can you clarify what the Mybrowser is in your code above.

    By the way, if you have any problem concerns ASP.Net, please ask your question to http://forums.asp.net/



    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Thursday, June 19, 2008 8:11 AM
  • MyBrowser is an object of WebBrowser from the System.Windows.Forms.

    Sometime if the DrawToBitmap works then it will fail while drawing the image, says 'Out of memory.'


     

    Thursday, June 19, 2008 11:06 AM
  • Hi

    Since the WebBrowser class is in a Windows.Forms namespace, I believe Windows Forms General is the proper forum.

    Thanks & Regards,
    Xun

    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Thursday, June 19, 2008 11:25 AM
  • This thread was moved into the Off Topic forum. I can move it into a specific forum for you if you want.

    Thanks!


    Ed Price (a.k.a User Ed), SQL Server Experience Program Manager (Blog, Twitter, Wiki)

    Friday, May 11, 2012 2:39 AM