Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Bitmap image = cameraList.ElementAt(0).videoCapture.frames.getLatestFrame().Item1.Bitmap;
- //using (image)
- //{
- using (Graphics g = Graphics.FromImage(image))
- {
- float px = 22;
- float py = 22;
- float w = 100;
- float h = 100;
- Rectangle rect = new Rectangle((int)px, (int)py, (int)w, (int)h);
- g.DrawRectangle(new Pen(Color.Yellow, 2), rect);
- Brush b = Brushes.Blue;
- Font f = new Font(FontFamily.GenericSerif, 10);
- g.DrawString("buu", f, b, new PointF(px, py));
- g.Flush();
- Rectangle recta = new Rectangle((int)px + 1, (int)py + 1, (int)w, (int)h);
- g.DrawRectangle(new Pen(Color.Green, 2), rect);
- g.Flush();
- image.Save(Directory.GetCurrentDirectory() + DateTime.Now.ToString("yyyy_MM_ddTHH.mm.ss.fff") + ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
- }
- // }
- Image<Emgu.CV.Structure.Bgr, Byte> imageCV = new Image<Emgu.CV.Structure.Bgr, byte>(image); //Image Class from Emgu.CV
- Mat mat = imageCV.Mat;
- Emgu.CV.CvInvoke.Imshow("String ", mat);
- Emgu.CV.CvInvoke.WaitKey(1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement