Juste3alfaz
Juste3alfaz

Reputation: 295

convert type 'System.Drawing.Bitmap' to 'Emgu.CV.IImage'

I try to convert from bitmap to Image (ImageBox) of EmguCV but it shows me the problem Cannot implicitly convert type 'System.Drawing.Bitmap' to 'Emgu.CV.IImage' with this.captureImageBox.Image = val; I am using EmguCV V3

void SetPic(Bitmap val)
        {
            if (val != null)
            {

                this.captureImageBox.Image = val;
            }
        }

Severity Code Description Project File Line Suppression State Error CS0029 Cannot implicitly convert type 'System.Drawing.Bitmap' to 'Emgu.CV.IImage'

Upvotes: 1

Views: 6345

Answers (1)

Magnus
Magnus

Reputation: 46929

The ctor takes in a Bitmap.

this.captureImageBox.Image = new Image<Bgr, Byte>(val); 

Upvotes: 4

Related Questions