Monday 15 February 2010

c# - How flip video capture from webcam in Silverlight -


I have noticed that when I am capturing video from webcam in Silverlight Video then "reverse" means when I right Running left on a screen Is there a way to flip video captures?

I could flip to the left and in the same way you can do this.

  Private writeable bitmap flip video (writeable bitmap not flip) {sortable bucketcap motionBmp = new writable bitmap (notFliped.PixelWidth, notFliped.PixelHeight); Int leftRight = -1; Int [] flipedArray = motionBmp.Pixels; Int [] currentArray = notFliped.Pixels; For (int H = 0; H & l; 480; H ++) {leftRight ++; For (int w = 0; w   

Note that 640 and 480 are camera resolution and adjust them in their values ​​I do not know that the webcam supports any other resolution by default. But if 640 * 480 then you can use this code as it is. Apart from this, you need to understand that even if a camera frame is seen in pixel (3x3) picture)

0,1,2 ............... .................................................. ..................... 3,4,5 ........................ .................................................. ............ 6,7,8 ................................. .................................................. ...

Bitmap Pixels return for [] = {0,1,2,3..8}, so you have to flip the rows in this row in this

2, 1.0 ... ............................................... ....... ................................ 5,4,3 ...... ....... ............................................... ....... ....................... 8,7,6 ............... ....... ............................................... ....... ..............

This is the same as the code above .. Cheers..and just ignoring the dots ...

No comments:

Post a Comment