Click here to Skip to main content
15,894,330 members

Displaying 16 Bit RAW GRAY SCALE image data in VC++ (mfc)

SolarNigerija asked:

Open original thread
I have 16-bit packed RAW GRAY SCALE images.
each image may have different high bit, for example: 9,11,13, or 15 (10,12,14, or 16 bits per pixel respectfully). Building and using image statistics I can calculate min/max pixel values, and expand dynamic range of image to 16-bit per pixel/or using other embedded information to expand range to 16bits. make notice this images have > 10 mega pixels, file size > 20MB ;) speed is an issue here.

all above is very easily done, and I have that part already done.

now I wish to display this image data onto CDC without loosing dynamic range of image (without converting pixel data ie 16->8 bit). Also not to create double images, for example: one with 16bit (original for processing), and second with 8bit (clone for displaying on DC). Is there any vc++/mfc solution for this, or this is only my wishful thinking?

briefly tried to use DIBSection with pallets, but to my knowledge this should be used on RGB displays with less than 24bits (8 bits per channel). Anyway got stuck in finding proper working example for pallets, ie none of them uses 16bits gratscale image data.

I guess I've tried almost anything. And it seams Windows GDI doesn't like me too much when 16 bit greyscale images are in question.

Any other ideas how to solve the problem would be very appreciated.

thanks
Tags: C++, MFC, GDI

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900