dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: No C# Support for Format4bppIndexedGreyScale?

  1. #1
    Join Date
    Mar 2001
    Posts
    2,527

    Question No C# Support for Format4bppIndexedGreyScale?

    SOLVED!!!
    System.Drawing.Imaging.PixelFormat.Format16bppGrayScale exists but not 4bpp???

    What are my options??? (.net 4.0 app)

    I am already preprocessing the image to GreyScale it and then:

    Code:
            public static Bitmap ConvertTo1BPPIndexed(Bitmap orig)
            {
                Bitmap oldBmp = (Bitmap)orig;
                Bitmap newBmp = new Bitmap(oldBmp);
                Bitmap retBmp = newBmp.Clone(new Rectangle(0, 0, newBmp.Width, newBmp.Height), System.Drawing.Imaging.PixelFormat.Format4bppIndexed);
                return retBmp;
            }
    However Format4bppIndexed shows up as an ARGB file format, and the target device needs 4bpp GreyScale format.
    Last edited by ahoodin; January 14th, 2019 at 12:00 PM. Reason: Solved
    ahoodin
    To keep the plot moving, that's why.

  2. #2
    Join Date
    Mar 2001
    Posts
    2,527

    Re: No C# Support for Format4bppIndexedGreyScale?

    This has been solved.
    ahoodin
    To keep the plot moving, that's why.

  3. #3
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    12,898

    Re: No C# Support for Format4bppIndexedGreyScale?

    Please post the solution so folks finding this post in a search may benefit.
    Last edited by Arjay; January 14th, 2019 at 02:02 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)