목록프로그래밍 (15)
노주현 개인 블로그

Designer 에서 ListBox 를 사용할 때 아래와 같이 사용 하는 경우 처음 Page 를 열거나, 리스트 박스를 클릭할 때 2~3번 이상 여러번 실행되는 경우가 있음 원인 분석 및 확인 결과 위와 같이 Camera List 를 추가하는 코드에서 기존 : DeleteAll 실행 -> 원하는 item 을 하나씩 AddRow 해서 추가 AddRow 할 때 인덱스가 0이 되면서 여러번 타게 된다고 생각했었다. 수차례 확인 결과 DeleteAll 해서 하나씩 지워질 때 1번 인덱스 -> 0번 인덱스로 밀리면서 On Value Changed 가 실행되고 계속 Item Index 가 0 이 들어오는 현상이 발생하였다. 변경 : Item Index 를 -1로 변경 -> DeleteAll 실행 -> 원하는 ite..
if (System.Diagnostics.Debugger.IsAttached) System.Diagnostics.Debugger.Break(); $System.Debug.Break();

동기 1. 상대방의 일정 신호(결과 신호)에 의해서 다음 동작으로 이뤄짐 2. 어떤 루틴을 완전히 끝내고 제어를 반납 비동기 1. 상대방의 상태와 관계없이 일방적으로 동작하면 비동기 2. 동작이 안 끝났어도 일단 제어권을 반납한 후 작업 계속 BeginInvoke / EndInvoke int threadID; // 비 동기 실행에서 Thread 를 구분하는 ID // delegate 인스턴스 생성 AasyncDelegateCaller caller = new AasyncDelegateCaller(AasyncDelegate); // 비동기 시작 IAsyncResult result = caller.BeginInvoke(3000, out threadID, null, null); // EndInvoke 를 통해서..

Array Copy() Array.Copy(srcData, 0, dstData, 0, size); Buffer.BlockCopy() Buffer.BlockCopy(srcData, 0, dstData, 0, size); Marshal.Copy() static unsafe void MarshalCopy(byte[] src, int srcOffset, byte[] dst, int dstOffset, int count) { fixed (byte* b1 = &src[0]) fixed (byte* b2 = &dst[0]) { IntPtr ab2 = new IntPtr(b2); Marshal.Copy(src, 0, ab2,count); } } Cpp Copy Memory using System.Runtime.Inte..
using System.Drawing; using System.Drawing.Imaging; using System.Runtime.InteropServices; // Camera 등에서 buffer 값을 가져온다. byte[] buffer = 버퍼값 // Parameter int width; int height; // bmp LockBits 실행 Bitmap bmp = new Bitmap(width, height, PixelFormat.Format8bppIndexed); BitmapData bmpData = bmp.LockBits(new Rectangle(0, 0, width, height), ImageLockMode.ReadWrite, bmp.PixelFormat); // byte[] to bmp Ma..
// Process 실행 여부 초기화 System.Diagnostics.Process proc = new System.Diagnostics.Process(); proc.StartInfo.FileName = "FileName.exe"; proc.StartInfo.WorkingDirectory = "C:\\FileDir"; proc.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.NOrmal; proc.Start(); // Process 확인되면 강제로 종료 System.Diagnostics.Process[] procList = SYstem.Diagnostics.Process.GetProcessesByName("FileName.exe"); if(..
Assembly : Cognex.VisionPro NameSpace : Cognex.VisionPro.Implementation // 나열 방식 Cognex.VisionPro.Implementation.CogRecord sampleRecord= new Cognex.VisionPro.Implementation.CogRecord(); sampleRecord.ContentType = typeof(ICogImage); //sampleRecord.Content = $RunState.Teaching.Tool.MultiPM_PMAlignTool.InputImage; sampleRecord.Content = InputImage; sampleRecord.Annotation = "MyInputImage.Graphics";..