기본 콘텐츠로 건너뛰기

3월, 2019의 게시물 표시

C# - TextBox 넓이 일정하게 정렬

TextBox에 아래와 같이 글씨를 넣으면 각 글씨별 넓이가 달라 정렬이 되지 않는다. 이럴땐 textBox의 폰트를 monospace로 변환 해주면 간단하게 해결된다. //txtData = TextBox txtData . Font = new Font ( FontFamily . GenericMonospace , txtData . Font . Size ) ;

C# - LockBit

reference http://csharpexamples.com/fast-image-processing-c/ //// LockBits and Unsafe and parallel private void ProcessUsingLockbitsAndUnsafeAndParallel(Bitmap processedBitmap) {      unsafe      {          BitmapData bitmapData = processedBitmap.LockBits( new Rectangle(0, 0, processedBitmap.Width, processedBitmap.Height), ImageLockMode.ReadWrite, processedBitmap.PixelFormat);          int bytesPerPixel = System.Drawing.Bitmap.GetPixelFormatSize(processedBitmap.PixelFormat) / 8;          int heightInPixels = bitmapData.Height;          int widthInBytes = bitmapData.Width * bytesPerPixel;          byte * PtrFirstPixel = ( byte *)bitmapData.Scan0;          Parallel.For(0, h...