반응형

C# 51

C# WPF Ripple Effect (원형으로 퍼져 나가는 효과)

효과 버튼이나 클릭 하는 부분에 사용하면 효과적입니다. 디자이너 사용 디자이너 스타일 등록 소스 코드 추가 public class RippleEffectDecorator : ContentControl { static RippleEffectDecorator() { DefaultStyleKeyProperty.OverrideMetadata(typeof(RippleEffectDecorator), new FrameworkPropertyMetadata(typeof(RippleEffectDecorator))); } public Brush HighlightBackground { get { return (Brush)GetValue(HighlightBackgroundProperty); } set { SetValue(Hig..

C#/WPF 2021.11.25

C# string(문자)에 따라 다른 class(클래스) 호출하기 (스크립트 언어)

using Link; using System; using System.Collections.Generic; using System.Windows.Forms; namespace WindowsFormsApp43 { public partial class Form1 : Form { private static Dictionary s_functions = new Dictionary(); public Form1() { InitializeComponent(); Type type1 = Type.GetType("Link." + "Test1"); Type type2 = Type.GetType("Link." + "Test2"); //텍스트 박스 글짜에 따라 다른 클래스 등록 s_functions.Add("textBox1",t..

C#/기술 개발 2021.07.12

C# enum 및 enum Array(배열) 변환

상수 숫자를 의미있는 단어로 표현할때 사용 별도의 지정 없을때는 첫번째 0 이후 1씩 증가 using System; namespace ConsoleApp11 { class Program { enum ei //error id { Emergency , DoorCheck , MotorAlarm , CylinderAlarm, } static void Main(string[] args) { Console.WriteLine((int)ei.Emergency ); //output 0 Console.WriteLine((int)ei.DoorCheck ); //output 1 Console.WriteLine((int)ei.MotorAlarm ); //output 2 Console.WriteLine((int)ei.Cylind..

C# 2021.07.01

C# Queue 자료구조 (feat Thread-safe한 ConcurrentQueue)

선입선출(FIFO, First In First Out) 구조 맨뒤에 데이터를 추가하고 맨 앞에서 데이터가 출력 큐가 비어 있을때 에러 System.InvalidOperationException: '큐가 비어 있습니다.' 일반 Queue using System; using System.Collections.Generic; namespace ConsoleApp11 { class Program { static void Main(string[] args) { Queue numbers = new Queue(); numbers.Enqueue(1); //큐에 데이터 추가 numbers.Enqueue(2); numbers.Enqueue(3); int iDequeue = 0 ; iDequeue = numbers.Peek..

C# 2021.06.30

Vision 기본 지식 및 설명

카메라와 렌즈의 관계 예시 카메라 BFS-PGE-16S2M-CS resolution 1440x1080, pixel size 3.45um x 3.45um (1/3'') 예시 렌즈 VS-LDA15 0.03x - 0.15x (2/3'') (단 렌즈의 2/3'' 는 카메라의 1/3''보다 크거나 같아야 함) FOV (Field Of View) 센서 크기와 렌즈 배율에 따라 달라짐 FOV = Sensor Size / 렌즈 배율 카메라 센서 센서의 가로 크기 = 1440 x 3.45 = 4968 um 센서의 세로 크기 = 1024 x 3.45 = 3532.8 um FOV 최대 FOV(H) = 4.968 mm / 0.03 = 165.6 mm FOV(V) = 3.5328 mm / 0.03 = 117.76 mm FOV ..

C#/Vision 2021.06.29

머신비전 기본용어 (machine vision basic words)

용어 설명 Space 카메라 외형 끝에서 오브젝트까지의 총 구간 거리 O/I (Object to Imager) 카메라 센서와 물체 까지의 거리 WD (Working Distance) 렌즈끝에서 물체까지의 거리 (Lens WD) LWD (Lighting Working Distance) 조명끝에서 물체까지의 거리 FOV (Field Of View) 영상을 획득하고자 하는 영역 DOF (Depth Of Field) 심도, 렌즈의 초점이 맞는 범위 이외 Suhtter Speed - 노출시간 (셔터가 열려있는 시간) fps (Frame per second) - 초당 찍히는 프레임의 수 Aperture - 조리개, 렌즈의 구멍 크기를 조절하여 빛의 양 조절 (F-Number, 낮을수록 밝기값이 높음) Focal L..

C#/Vision 2021.06.29

2021년 6월 29일 프로그래밍 언어 순위 및 비교

어느 프로그래밍 언어가 많이 사용되는지 알아 봅니다. 2021 년 6 월 TIOBE 지수 (파이썬의 엄청난 강세이며 C#은 5위를 기록하고 있습니다.) Python은 이전에 1 위에 그토록 가까웠 던 적이 없습니다. 파이썬이 TIOBE 인덱스에서 첫 번째 위치를 차지하려고 합니다. 현재 1 위인 프로그래밍 언어 C와 Python의 차이는 현재 0.7 %에 불과합니다. 프로그래밍 언어 C와 Java는이 20 년 동안 1 위를 차지한 유일한 두 가지 언어입니다. 따라서 Python이 TIOBE 인덱스에서 첫 번째 위치를 차지한다면 이것은 확실히 역사적인 순간이 될 것입니다. Dart, Kotlin, Julia, Rust, TypeScript 및 Elixir와 같은 미래의 챔피언은 지난 달에 큰 변화를 보이지..

C# 2021.06.29

C# Thread (Process RealTime 및 우선순위)

메인 쓰레드를 만들때 사용 (프로세스 우선순위 최대, 쓰레드 우선순위 최대, Sleep 최소화) using System.Diagnostics; using System.Threading; using System.Windows.Forms; namespace WindowsFormsApp40 { public partial class Form1 : Form { Thread MainThread ; public Form1() { InitializeComponent(); MainThread = new Thread(Update); //WinApi.TimeBeginPeriod(1); //Process 우선순위 RealTime Process.GetCurrentProcess().PriorityBoostEnabled = tru..

C# 2021.06.29

C# 구조체 형식 및 구조체 저장하기(Serializable)

구조체 형식 데이터와 관련 기능을 캡슐화할 수 있는 값 형식 using System; using System.IO; using System.Runtime.Serialization.Formatters.Binary; using System.Windows.Forms; namespace WindowsFormsApp39 { public partial class Form1 : Form { [Serializable] public struct Point { private int x ; private int y ; private int z ; public Point(int x, int y, int z) { this.x = x ; this.y = y ; this.z = z ; } public int X { get { re..

C# 2021.06.28