Esempio n. 1
0
        public Gradient()
        {
            PixelYhsa pxUpper = null;
            PixelYhsa pxLower = null;
            bool      bGood   = true;

            try {
                pxUpper = new PixelYhsa(1, 0, 0, 1);
                pxLower = new PixelYhsa(0, 0, 0, 0);
                if (pxUpper == null)
                {
                    bGood = false;
                    RReporting.ShowErr("Couldn't allocate pixel (upper)", "Gradient");                   //TODO: remove this line, for performance
                }
                if (pxLower == null)
                {
                    bGood = false;
                    RReporting.ShowErr("Couldn't allocate pixel (lower)", "Gradient");                   //TODO: remove this line, for performance
                }
                if (bGood)
                {
                    RReporting.Write("Create gradient...");
                    bGood = From(ref pxUpper, ref pxLower);
                    RReporting.WriteLine(bGood?"Success.":"Failed!");
                }
                else
                {
                    RReporting.ShowErr("Create gradient failed!", "Gradient constructor");
                }
            }
            catch (Exception exn) {
                bGood = false;
                RReporting.ShowExn(exn, "Gradient()", "initializing");
            }
        }