Skip to content

API Proposal: Update Encoder, EncoderParameterValueType to match GDI+ #30543

@qmfrederik

Description

@qmfrederik

GDI+ has new values for:

  • Encoder: EncoderColorSpace, EncoderImageItems and EncoderSaveAsCMYK
  • EncoderParameterValueType: EncoderParameterValueTypePointer

The proposal is to update the Encoder type and EncoderParameterValueType to expose these new values:

namespace System.Drawing
{
    public sealed partial class Encoder
    {
        public static readonly System.Drawing.Imaging.Encoder ChrominanceTable;
        public static readonly System.Drawing.Imaging.Encoder ColorDepth;
        public static readonly System.Drawing.Imaging.Encoder Compression;
        public static readonly System.Drawing.Imaging.Encoder LuminanceTable;
        public static readonly System.Drawing.Imaging.Encoder Quality;
        public static readonly System.Drawing.Imaging.Encoder RenderMethod;
        public static readonly System.Drawing.Imaging.Encoder SaveFlag;
        public static readonly System.Drawing.Imaging.Encoder ScanMethod;
        public static readonly System.Drawing.Imaging.Encoder Transformation;
        public static readonly System.Drawing.Imaging.Encoder Version;
+       public static readonly System.Drawing.Imaging.Encoder ColorSpace;
+       public static readonly System.Drawing.Imaging.Encoder ImageItems;
+       public static readonly System.Drawing.Imaging.Encoder SaveAsCmyk;
        public Encoder(System.Guid guid) { }
        public System.Guid Guid { get { throw null; } }
    }

    public enum EncoderParameterValueType
    {
        ValueTypeByte = 1,
        ValueTypeAscii = 2,
        ValueTypeShort = 3,
        ValueTypeLong = 4,
        ValueTypeRational = 5,
        ValueTypeLongRange = 6,
        ValueTypeUndefined = 7,
        ValueTypeRationalRange = 8,
+       ValueTypePointer = 9,
    }
}

See https://docs.microsoft.com/en-us/windows/win32/gdiplus/-gdiplus-constant-image-encoder-constants, https://docs.microsoft.com/en-us/windows/win32/api/gdiplusenums/ne-gdiplusenums-encoderparametervaluetype

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions