Horje
c# create monochrome bitmap Code Example
c# create monochrome bitmap
Bitmap bmp = new Bitmap(300, 300);
           using (Graphics g = Graphics.FromImage(bmp))
           {
               Font font = new Font("Arial", 20, FontStyle.Bold, GraphicsUnit.Point);
               g.Clear(Color.White);
               g.DrawString("Hello", font, Brushes.Black, 0, 0);
           }
           System.Drawing.Imaging.BitmapData bmpData = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height), System.Drawing.Imaging.ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format1bppIndexed);
           Bitmap newBitmap = new Bitmap(300, 300, bmpData.Stride, System.Drawing.Imaging.PixelFormat.Format1bppIndexed, bmpData.Scan0);
           newBitmap.Save(@"c:\x\x.bmp");




Csharp

Related
ontriggerenter2d not working Code Example ontriggerenter2d not working Code Example
list add value position c# Code Example list add value position c# Code Example
decimal in .asp.net core Code Example decimal in .asp.net core Code Example
c# create default instance of type Code Example c# create default instance of type Code Example
Min max to 01 Code Example Min max to 01 Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8