Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 183643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:09:09+00:00 2026-05-11T15:09:09+00:00

Is there any way to get a BITMAPV5HEADER out of a Bitmap object in

  • 0

Is there any way to get a BITMAPV5HEADER out of a Bitmap object in C#? Or just get the values that are in their? I need to get some ColorSpace information out of a bitmap and can’t see a way to do this in C#.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T15:09:09+00:00Added an answer on May 11, 2026 at 3:09 pm

    Doesn’t seem to be an easy way to do it, but a hackish (and probably very buggy) way would be to read in the raw data and convert it to a BITMAPV5HEADER structure.

    Structure

    [StructLayout(LayoutKind.Sequential)] public struct BITMAPV5HEADER {   uint bV5Size;   long bV5Width;   long bV5Height;   int bV5Planes;   int bV5BitCount;   uint bV5Compression;   uint bV5SizeImage;   long bV5XPelsPerMeter;   long bV5YPelsPerMeter;   uint bV5ClrUsed;   uint bV5ClrImportant;   uint bV5RedMask;   uint bV5GreenMask;   uint bV5BlueMask;   uint bV5AlphaMask;   uint bV5CSType;   IntPtr bV5Endpoints;   uint bV5GammaRed;   uint bV5GammaGreen;   uint bV5GammaBlue;   uint bV5Intent;   uint bV5ProfileData;   uint bV5ProfileSize;   uint bV5Reserved; } 

    Helper Method

    public static T RawStructureRead<T>(Stream stream) where T : struct {   T @struct;   int size = Marshal.SizeOf(typeof(T));    BinaryReader reader = new BinaryReader(stream);   byte[] buffer = reader.ReadBytes(size);    GCHandle handle = GCHandle.Alloc(buffer, GCHandleType.Pinned);   @struct = (T)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(T));   handle.Free();    return @struct; } 

    Usage

    using (FileStream stream = File.OpenRead('...')) {   BITMAPV5HEADER header = RawStructureRead<BITMAPV5HEADER>(stream); } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to get an object by it's UID so that the
Is there any way to get the text of the selector that invoked some
Is there any way to get the ID of the element that fires an
Is there any way to get the handle to the control that has focus?
Is there any way to get the custom attributes of a specific object I
Is there any way to get the Form from its Processhandle ? Some thing
Is there any way to get at least some information inside of here? ...
Is there any way in OpenJPA to get hold of a nested object property
is there any way to get the ASP.NET validation summary control to just display
Is there any way to GET the ContentValues object from the SQLite? It's very

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.