4 Replies - 1009 Views - Last Post: 20 November 2014 - 02:23 AM Rate Topic: -----

#1 MBCUK  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • 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 online

  • Master(Of Foo)
  • member icon

Reputation: 1066
  • View blog
  • Posts: 4,174
  • 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: 10
  • 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: 10
  • 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
  • +
  • -

#5 P.Kirollos  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 20-November 14

Re: screen record to avi

Posted 20 November 2014 - 02:23 AM

If you want to capture the screen activities (desktop) and save the result to AVI format, you might be able to do this using a programming toolkit that wraps standard DirectShow functions so that you can save the result to AVI media format.
I am currently using leadtools programming sdk that has screen capture multimedia filter. Also, they have the ability to save media files to different formats including AVI. You can find more information here:
http://support.leadt...0/ShowPost.aspx
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1