3 Replies - 527 Views - Last Post: 24 January 2014 - 09:03 AM Rate Topic: -----

#1 MBCUK  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 02-May 12

screen record to avi

Posted 23 January 2014 - 01:23 PM

Hi there,

Im trying to use a code I found to create a screen capture program. everything seems to work well untill the debugger picks up the following error:

Dim bmpData As BitmapData = bmp.LockBits(New Rectangle(0, 0, bmp.Width, bmp.Height), ImageLockMode.[ReadOnly], PixelFormat.Format24bppRgb)


An unhandled exception of type ‘System.InvalidOperationException’ occurred in System.Drawing.dll
Message=Bitmap region is already locked.
Source=System.Drawing

I have pasted the full code on pastie: http://pastie.org/pr...9xmpy5ejumtdwxw

many many thanks to anyone that wants to help!

thanks

Is This A Good Question/Topic? 0
  • +

Replies To: screen record to avi

#2 _HAWK_  Icon User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1046
  • View blog
  • Posts: 4,074
  • Joined: 02-July 08

Re: screen record to avi

Posted 23 January 2014 - 01:55 PM

Did you look up the method? The third parameter is the bitmap object's PixelFormat not an enumeration value of PixelFormat.
Was This Post Helpful? 0
  • +
  • -

#3 MBCUK  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 02-May 12

Re: screen record to avi

Posted 23 January 2014 - 02:43 PM

thanks, still trying to learn my way through much appreciated for the source of information
Was This Post Helpful? 0
  • +
  • -

#4 MBCUK  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 6
  • Joined: 02-May 12

Re: screen record to avi

Posted 24 January 2014 - 09:03 AM

hello again,

i have managed to determine that the error means the image i am trying to work with is already in use, so it can't be used again until I release it's previous usage.

any ideas on how I can apply this to the code?

many thanks
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1