コード例 #1
0
        protected override void ReadData(PsdReader reader, object userData)
        {
            var colorDescriptor = new StructureDescriptor(reader, true);
            var typeDesc        = (StructureEnumerate)colorDescriptor.Items["Type"];

            switch (typeDesc.Value)
            {
            // linear
            case "Lnr ":
            {
                Color = ColorReader.GetLinearGradientColor(colorDescriptor);
                break;
            }

            // radial
            case "Rdl ":
            {
                Color = ColorReader.GetRadialGradientColor(colorDescriptor);
                break;
            }

            // angle
            case "Angl":

            //reflected
            case "Rflc":

            // diamand
            case "Dmnd":
            default:
            {
                var solid = new SolidColor();
                Color = solid;

                solid.Color = ColorReader.GetUnknownColor();
                break;
            }
            }
        }