Click here to Skip to main content
15,892,161 members
Home / Discussions / C#
   

C#

 
Questionwhat does this error mean Pin
benson.misi20-Apr-09 21:47
benson.misi20-Apr-09 21:47 
AnswerRe: what does this error mean Pin
Pete O'Hanlon20-Apr-09 21:51
mvePete O'Hanlon20-Apr-09 21:51 
GeneralRe: what does this error mean Pin
CPallini21-Apr-09 2:11
mveCPallini21-Apr-09 2:11 
GeneralRe: what does this error mean Pin
Pete O'Hanlon21-Apr-09 2:24
mvePete O'Hanlon21-Apr-09 2:24 
AnswerRe: what does this error mean Pin
N a v a n e e t h20-Apr-09 21:52
N a v a n e e t h20-Apr-09 21:52 
QuestionHow to import following C DLL function to C# ? [ I am still waiting .... :( ] [Wating no more :)] Pin
Roman Lerman20-Apr-09 20:53
Roman Lerman20-Apr-09 20:53 
AnswerRe: How to import following C DLL function to C# ? [ I am still waiting .... :( ] Pin
Henry Minute21-Apr-09 1:23
Henry Minute21-Apr-09 1:23 
QuestionHow to get color of pixel at mouse click in live video control Pin
sebogawa20-Apr-09 20:33
sebogawa20-Apr-09 20:33 
I have a program which has a control that gets live web cam video feed and plays it on a rectangle in the main form. I have the following code for the control "Mouse_Click" event:

private void videoSourcePlayer_MouseClick(object sender, MouseEventArgs e)
      {
          txtMouseX.Text = e.X.ToString();
          txtMouseY.Text = e.Y.ToString();
      }


i need to convert the e.X and e.Y to integer format, and use those values in the getPixel function of the bitmap image taken from the video source player in the following code:

private void videoSourcePlayer_NewFrame( object sender, ref Bitmap image )
       {


               bool showOnlyObjects = onlyObjectsCheck.Checked;

               Bitmap objectsImage = null;



                   objectsImage = image;
                   colorFilter.ApplyInPlace( image );


               // lock image for further processing
               BitmapData objectsData = objectsImage.LockBits( new Rectangle( 0, 0, image.Width, image.Height ),
                   ImageLockMode.ReadOnly, image.PixelFormat );

               // grayscaling
               UnmanagedImage grayImage = grayscaleFilter.Apply( new UnmanagedImage( objectsData ) );

               // unlock image
               objectsImage.UnlockBits( objectsData );

               // locate blobs
               blobCounter.ProcessImage( grayImage );
               Rectangle[] rects = blobCounter.GetObjectRectangles( );

               if ( rects.Length > 0 )
               {


                   Rectangle objectRect = rects[0];

                   Graphics g = Graphics.FromImage( image );

                   using ( Pen pen = new Pen( Color.FromArgb( 160, 255, 160 ), 3 ) )
                   {
                       //draw something here
                   }

                   g.Dispose( );


               }
            }


how do i get the mouse x and y coordinate values from the first function into the second function so i can use the "image.getPixel()" call?
AnswerRe: How to get color of pixel at mouse click in live video control Pin
Henry Minute21-Apr-09 1:42
Henry Minute21-Apr-09 1:42 
QuestionRe: How to get color of pixel at mouse click in live video control [modified] Pin
sebogawa21-Apr-09 8:46
sebogawa21-Apr-09 8:46 
QuestionConcurrency violation: the UpdateCommand affected 0 of the expected 1 records [Very Emergency] Pin
hdv21220-Apr-09 19:34
hdv21220-Apr-09 19:34 
AnswerRe: Concurrency violation: the UpdateCommand affected 0 of the expected 1 records [Very Emergency] Pin
Roman Lerman20-Apr-09 22:47
Roman Lerman20-Apr-09 22:47 
GeneralRe: Concurrency violation: the UpdateCommand affected 0 of the expected 1 records [Very Emergency] Pin
hdv21220-Apr-09 23:55
hdv21220-Apr-09 23:55 
GeneralRe: Concurrency violation: the UpdateCommand affected 0 of the expected 1 records [Very Emergency] Pin
Roman Lerman21-Apr-09 0:37
Roman Lerman21-Apr-09 0:37 
GeneralRe: Concurrency violation: the UpdateCommand affected 0 of the expected 1 records [Very Emergency] Pin
hdv21221-Apr-09 1:10
hdv21221-Apr-09 1:10 
AnswerRe: Concurrency violation: the UpdateCommand affected 0 of the expected 1 records [Very Emergency] Pin
Roman Lerman21-Apr-09 1:22
Roman Lerman21-Apr-09 1:22 
GeneralRe: Concurrency violation: the UpdateCommand affected 0 of the expected 1 records [Very Emergency] Pin
hdv21221-Apr-09 2:34
hdv21221-Apr-09 2:34 
GeneralRe: Concurrency violation: the UpdateCommand affected 0 of the expected 1 records [Very Emergency] Pin
Roman Lerman21-Apr-09 2:44
Roman Lerman21-Apr-09 2:44 
GeneralRe: Concurrency violation: the UpdateCommand affected 0 of the expected 1 records [Very Emergency] Pin
hdv21221-Apr-09 3:05
hdv21221-Apr-09 3:05 
QuestionHow to convert (string -> xml) with window mobile Pin
YochangSong20-Apr-09 18:34
YochangSong20-Apr-09 18:34 
AnswerRe: How to convert (string -> xml) with window mobile Pin
N a v a n e e t h20-Apr-09 19:55
N a v a n e e t h20-Apr-09 19:55 
Questionplugin error Pin
Ch.Gayatri Subudhi20-Apr-09 18:24
Ch.Gayatri Subudhi20-Apr-09 18:24 
QuestionTab Control Pin
Piyush Vaishnav20-Apr-09 17:36
Piyush Vaishnav20-Apr-09 17:36 
AnswerRe: Tab Control Pin
Christian Graus20-Apr-09 17:46
protectorChristian Graus20-Apr-09 17:46 
QuestionAccessing webcam.. Pin
Jacob Dixon20-Apr-09 17:16
Jacob Dixon20-Apr-09 17:16 

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.