달력

52024  이전 다음

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
반응형

OpenCvSharp nuget에서 설치



PictureBoxIpl 적당히 배치하고


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using OpenCvSharp;
using OpenCvSharp.Extensions;
 
 
namespace WindowsFormsApp3
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
 
        private void btnOpenPic_Click(object sender, EventArgs e)
        {
            OpenFileDialog fileDialog = new OpenFileDialog();
            fileDialog.DefaultExt = "jpg";
 
            //fileDialog.Filter = "JPG|*.jpg|JPEG|*.jpeg|BMP|*.bmp|PNG|*.png";
            fileDialog.Filter = "Images Files(*.jpg; *.jpeg; *.gif; *.bmp; *.png)|*.jpg;*.jpeg;*.gif;*.bmp;*.png";
            
            fileDialog.Multiselect = false;
            
            if (fileDialog.ShowDialog() == DialogResult.OK)
            {                
                foreach (string filePath in fileDialog.FileNames)
                {                    
                    using (Mat mat = new Mat(filePath, ImreadModes.AnyColor))
                    {
                        pictureBoxIpl1.ImageIpl = mat;
                    }
                }
            }
        }
    }
}
 
cs

'프로그래밍 > C#' 카테고리의 다른 글

[C#]이미지 크기 변경  (0) 2019.06.23
[C#]듀얼 스크린 Capture  (0) 2019.06.11
[C#] 둥근 버튼  (0) 2019.01.12
[C#]파일 확장자로 구분해서 image 저장  (0) 2018.12.15
[C#]CommonOpenFileDialog  (0) 2018.11.27
Posted by 유령회사
|