'System.Drawing.Color' does not contain a definition for 'FromARgb'

6.3k views Asked by At

I have added System.Drawing as a reference, yet this code seems to fail on the line where I declare the new color

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
using System.Windows.Forms;
using System.IO;


namespace BitmapParser
{
    class Program
    {
        static void Main(string[] args)
        {
            Color a = Color.FromARgb(0, 255, 0);
        }
    }
}

So what is going on here? I looked up System.Drawing.Color and it does have a 3-int constructor https://msdn.microsoft.com/en-us/library/system.drawing.color.aspx

1

There are 1 answers

0
15ee8f99-57ff-4f92-890c-b56153 On BEST ANSWER

Did you try spelling it correctly? This works fine for me:

var clr = System.Drawing.Color.FromArgb(0, 128, 255);