Advertisement
nikminer4sv

Untitled

Dec 13th, 2022
740
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.64 KB | None | 0 0
  1. using System.Drawing;
  2. using SixLabors.ImageSharp;
  3.  
  4. namespace tiff;
  5.  
  6. internal class Program
  7. {
  8.     static void Main(string[] args)
  9.     {
  10.         string fileName = "image.tiff";
  11.         int width = 650;
  12.         int height = 434;
  13.  
  14.         FileStream fs = new System.IO.FileStream(fileName, System.IO.FileMode.Open);
  15.         Image img = Image.FromStream(fs);
  16.         fs.Close();
  17.  
  18.         Graphics g = Graphics.FromImage(img);
  19.         g.FillRectangle(Brushes.Black, 5, 5, 100, 30);
  20.         g.DrawRectangle(Pens.Black, 5, 5, 100, 30);
  21.         g.Dispose();
  22.  
  23.         img.Save("new.tiff", System.Drawing.Imaging.ImageFormat.Tiff);
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement