Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int width = 40, height = 40;
- int count_i = 10, count_j = 10;
- Bitmap bmp = new Bitmap(Convert.ToInt32((count_i * width) + (count_i * count_i - count_i)), Convert.ToInt32((count_j * height) + (count_j * count_j - count_j)),PixelFormat.Format32bppArgb);
- Graphics g = Graphics.FromImage(bmp);
- int input = (int)(DateTime.Parse("2017/07/06 8:00 AM") - DateTime.Now).TotalDays;
- int h = 0;
- for (int i = 0; i < count_i; i++)
- {
- for (int j = 0; j < count_j; j++)
- {
- h++;
- SolidBrush b;
- if (h <= input)
- {
- b = new SolidBrush(Color.Green);
- }
- else
- {
- b = new SolidBrush(Color.LightGray);
- }
- g.FillRectangle(b, new Rectangle(i * (width + count_i), j * (height + count_j), width, height));
- }
- }
- bitmap.Save(@"C:\Users\admin\Desktop\test.png", ImageFormat.Png);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement