Advertisement
Guest User

Untitled

a guest
May 19th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. Bitmap image = cameraList.ElementAt(0).videoCapture.frames.getLatestFrame().Item1.Bitmap;
  2.  
  3. //using (image)
  4. //{
  5. using (Graphics g = Graphics.FromImage(image))
  6. {
  7. float px = 22;
  8. float py = 22;
  9. float w = 100;
  10. float h = 100;
  11. Rectangle rect = new Rectangle((int)px, (int)py, (int)w, (int)h);
  12. g.DrawRectangle(new Pen(Color.Yellow, 2), rect);
  13. Brush b = Brushes.Blue;
  14. Font f = new Font(FontFamily.GenericSerif, 10);
  15. g.DrawString("buu", f, b, new PointF(px, py));
  16. g.Flush();
  17. Rectangle recta = new Rectangle((int)px + 1, (int)py + 1, (int)w, (int)h);
  18. g.DrawRectangle(new Pen(Color.Green, 2), rect);
  19. g.Flush();
  20. image.Save(Directory.GetCurrentDirectory() + DateTime.Now.ToString("yyyy_MM_ddTHH.mm.ss.fff") + ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg);
  21.  
  22.  
  23. }
  24. // }
  25. Image<Emgu.CV.Structure.Bgr, Byte> imageCV = new Image<Emgu.CV.Structure.Bgr, byte>(image); //Image Class from Emgu.CV
  26. Mat mat = imageCV.Mat;
  27. Emgu.CV.CvInvoke.Imshow("String ", mat);
  28. Emgu.CV.CvInvoke.WaitKey(1);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement