Click here to Skip to main content
15,917,627 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to avoid word wrap in MFC Pin
lkeller27-Nov-05 15:32
lkeller27-Nov-05 15:32 
AnswerRe: How to avoid word wrap in MFC Pin
raddog27-Nov-05 16:51
raddog27-Nov-05 16:51 
Questioncompiling error when use type_info::operator== Pin
followait27-Nov-05 14:57
followait27-Nov-05 14:57 
AnswerRe: compiling error when use type_info::operator== Pin
PJ Arends27-Nov-05 15:27
professionalPJ Arends27-Nov-05 15:27 
GeneralRe: compiling error when use type_info::operator== Pin
followait28-Nov-05 3:28
followait28-Nov-05 3:28 
QuestionIntelligent bitmap depth conversion 1,4,8,16,24 bits Pin
Sumit Kapoor27-Nov-05 14:52
Sumit Kapoor27-Nov-05 14:52 
AnswerRe: Intelligent bitmap depth conversion 1,4,8,16,24 bits Pin
John R. Shaw27-Nov-05 18:13
John R. Shaw27-Nov-05 18:13 
AnswerRe: Intelligent bitmap depth conversion 1,4,8,16,24 bits Pin
normanS27-Nov-05 18:47
normanS27-Nov-05 18:47 
16-bit colour simply allocates fewer bits per colour than 24-bit. A common 16-bit format which is easy to describe uses 5 pixels each for Red, Green, Blue, with one unused, i.e. it is 15-bit. True 16-bit allocates 6 bits for green, I think.

To check whether an image is entirely suitable for 15-bit, you could use brute-force, and step through every pixel, checking that the 3 least-significant bits for each colour are all zero. Theoretically, you loose information if you discard non-zero bits.

Alternatively, you could just force 24-bit images to 16-bit, but this can give visible changes in the image.

To convert to 8-bit per pixel or lower, I don't think there is an easy way.

I would allocate a 256-member array for 24-bit colour values, then step through the pixels, one by one. For each pixel, check if the value is in the array. If the colour value is in the array, go on to the next pixel. If it is not, add its colour value to the array. If the pixel's colour value is not in the array, but the array already has 256 colour values, then sorry - your image can not be converted to an 8-bit image without loss of quality!
((I seem to remember something about 16 "system reserved" colours in an 8-bit image, so you may only be able to use 240 colours.))

GeneralRe: Intelligent bitmap depth conversion 1,4,8,16,24 bits Pin
Sumit Kapoor27-Nov-05 21:31
Sumit Kapoor27-Nov-05 21:31 
QuestionModal vs Child CDialog style. BIG PROBLEM Pin
xSoptik27-Nov-05 12:13
xSoptik27-Nov-05 12:13 
QuestionHow do I read the content of an Internet Explorer page Pin
stifmeister_ro27-Nov-05 11:38
stifmeister_ro27-Nov-05 11:38 
AnswerRe: How do I read the content of an Internet Explorer page Pin
Michael Dunn27-Nov-05 16:05
sitebuilderMichael Dunn27-Nov-05 16:05 
QuestionHow to hide a cursor ? Pin
quangpk27-Nov-05 4:27
quangpk27-Nov-05 4:27 
AnswerRe: How to hide a cursor ? Pin
PJ Arends27-Nov-05 9:00
professionalPJ Arends27-Nov-05 9:00 
QuestionHow to set the library file in vc 6.0? Pin
rushing27-Nov-05 3:13
rushing27-Nov-05 3:13 
AnswerRe: How to set the library file in vc 6.0? Pin
PJ Arends27-Nov-05 9:58
professionalPJ Arends27-Nov-05 9:58 
QuestionLooking for a quick and smart way to recreate a project. Pin
DWOO27-Nov-05 1:56
DWOO27-Nov-05 1:56 
QuestionFlush a file after reading it? Pin
Lord Kixdemp26-Nov-05 22:21
Lord Kixdemp26-Nov-05 22:21 
AnswerRe: Flush a file after reading it? Pin
Johann Gerell26-Nov-05 23:38
Johann Gerell26-Nov-05 23:38 
QuestionRe: Flush a file after reading it? Pin
David Crow27-Nov-05 11:17
David Crow27-Nov-05 11:17 
AnswerRe: Flush a file after reading it? Pin
PJ Arends27-Nov-05 13:17
professionalPJ Arends27-Nov-05 13:17 
GeneralRe: Flush a file after reading it? Pin
Lord Kixdemp27-Nov-05 15:43
Lord Kixdemp27-Nov-05 15:43 
GeneralRe: Flush a file after reading it? Pin
Lord Kixdemp27-Nov-05 15:48
Lord Kixdemp27-Nov-05 15:48 
GeneralRe: Flush a file after reading it? Pin
Michael Dunn27-Nov-05 16:11
sitebuilderMichael Dunn27-Nov-05 16:11 
AnswerRe: Flush a file after reading it? Pin
Bob Stanneveld27-Nov-05 22:27
Bob Stanneveld27-Nov-05 22:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.