简体   繁体   中英

How to output a Rectangle[] to a ImageBox or PictureBox?

I have an array of rectangle that consists of images, now I need to display it in a pop up form. How can I output the Rectangles to a ImageBox or PictureBox? Thanks!

 results = FindPeople.Find(frameImage, tryUseCuda, tryuseOpenCL, out processingTime, out peopleCount);

if (captureFrame)
      {
       popUpForm popUp = new popUpForm(results);
       popUp.Show();
       captureFrame = false;
      }

Pop up form

public popUpForm(Rectangle[] images)
    {


        foreach (Rectangle rect in images)
       {



       }

    }
public popUpForm(Rectangle[] images)
{
   Pen pen = new Pen(Color.Red, 2);
   using (var g = pictureBox.CreateGraphics())
     foreach (Rectangle rect in images)
       g.DrawRectangle(pen, rect);
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM