I can do ref like
private void videoSource_New( object sender, ref Bitmap image )
but how to call this "ref Bitmap image" inside button click event?
I can do ref like
private void videoSource_New( object sender, ref Bitmap image )
but how to call this "ref Bitmap image" inside button click event?
From wherever you are trying to call the function videoSource_New
you simply need to use the ref
keyword at the call site. I've shown a code snippet on how to call it from the button click event handler method of a windows forms application in C#:
public partial class Form1 : Form
{
private void button1_Click(object sender, EventArgs e)
{
Bitmap myImage = LoadFromDisk();
videoSource_New(sender,ref myImage);
}
private void videoSource_New( object sender, ref Bitmap image )
{
//some logic to make changes in image object or use the image object.
}
}
Hope this helps!