×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Conversion to .bmp

Conversion to .bmp

Conversion to .bmp

(OP)
I am relatively new to visual C++.  I have a file of data that was transmitted in 16-bit chunks.  The format is undetermined (maybe in hex).  I need to convert the file to .bmp format and then display.

Any ideas or suggestions on how to do this would be greatly appreciated.

RE: Conversion to .bmp

You must know what the format of the file is, and what it represents, otherwise how do you expect to convert it to a bitmap? Where does this file come from?

RE: Conversion to .bmp

(OP)
The file is being transmitted from a camera flying around.  The camera is taking pictures and sending the info.  The format was left up to me. So any suggestions on that would be helpful too. Can it be just in lines of hexidecimal numbers?

RE: Conversion to .bmp

I guess the easiest, but perhaps bulkiest, format would be 24-bit RGB format - 8 bits red, 8 bits green, 8 bits blue.

You mentioned 16-bit chunks - does this perhaps mean 16-bit RGB (usually 5 red, 6 green, 5 blue)?

To get that information into a bitmap, take a look at the CreateCompatibleBitmap() function to create the initial bitmap object (assuming you know the size in advance), and then the SetBitmapBits() function for filling out the bitmap object from the raw data.

Be aware though, that you will need to make sure your screen is in the 16-bit colour format for this conversion to work - if your screen is another format (different from that supplied by the camera), then you will need to fill out a BITMAPINFO structure and use one of the other CreateBitmap functions.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close