Click here to Skip to main content
15,892,537 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Hide Member from Intellisense list Pin
chandu0049-Oct-07 3:05
chandu0049-Oct-07 3:05 
AnswerRe: Hide Member from Intellisense list Pin
Waleed Eissa9-Oct-07 18:08
Waleed Eissa9-Oct-07 18:08 
GeneralRe: Hide Member from Intellisense list Pin
chandu0049-Oct-07 18:24
chandu0049-Oct-07 18:24 
QuestionClient server interaction Pin
William Engberts8-Oct-07 22:46
William Engberts8-Oct-07 22:46 
AnswerRe: Client server interaction Pin
jhwurmbach9-Oct-07 1:19
jhwurmbach9-Oct-07 1:19 
QuestionBitmap-Histogram using MFC Pin
go9398-Oct-07 22:45
go9398-Oct-07 22:45 
AnswerRe: Bitmap-Histogram using MFC Pin
Waldermort9-Oct-07 1:13
Waldermort9-Oct-07 1:13 
AnswerRe: Bitmap-Histogram using MFC Pin
jhwurmbach9-Oct-07 1:16
jhwurmbach9-Oct-07 1:16 
You loop over the pixel and make a map<int, int=""> with the color_number as key and the number of pixel with this color_number as value.
typedef std::map<int, int> HistoMapT;
HistoMapT theMap;
For every color-number you encounter, you add one to the value under the key "color-number"
E.g. The first pixel has value 30:
You check if this number is already in the map. When it is, you increment its value. When its not, you insert it with a value of 1:
HistoMapT::iterator theIterator = theMap.find(color_number);
  int value = 1;
  if (theIterator != theMap.end() ) {
    value += theIterator.second;
  }
  theMap.insert(MAKEPAIR(color_number, value));


You see, std::map is quite helpful here, providing you with elegant and easy to read code.



Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal.
George Orwell, "Keep the Aspidistra Flying", Opening words
{
GeneralRe: Bitmap-Histogram using MFC Pin
Chris Losinger9-Oct-07 3:13
professionalChris Losinger9-Oct-07 3:13 
GeneralRe: Bitmap-Histogram using MFC Pin
jhwurmbach9-Oct-07 3:51
jhwurmbach9-Oct-07 3:51 
GeneralRe: Bitmap-Histogram using MFC [modified] Pin
Chris Losinger9-Oct-07 4:14
professionalChris Losinger9-Oct-07 4:14 
GeneralRe: Bitmap-Histogram using MFC Pin
jhwurmbach9-Oct-07 4:39
jhwurmbach9-Oct-07 4:39 
GeneralRe: Bitmap-Histogram using MFC [modified] Pin
Chris Losinger9-Oct-07 4:44
professionalChris Losinger9-Oct-07 4:44 
GeneralRe: Bitmap-Histogram using MFC Pin
jhwurmbach9-Oct-07 5:21
jhwurmbach9-Oct-07 5:21 
GeneralRe: Bitmap-Histogram using MFC Pin
Chris Losinger9-Oct-07 5:26
professionalChris Losinger9-Oct-07 5:26 
GeneralRe: Bitmap-Histogram using MFC Pin
jhwurmbach9-Oct-07 5:45
jhwurmbach9-Oct-07 5:45 
GeneralRe: Bitmap-Histogram using MFC Pin
Chris Losinger9-Oct-07 5:52
professionalChris Losinger9-Oct-07 5:52 
GeneralRe: Bitmap-Histogram using MFC Pin
jhwurmbach9-Oct-07 5:55
jhwurmbach9-Oct-07 5:55 
GeneralRe: Bitmap-Histogram using MFC Pin
Chris Losinger9-Oct-07 6:09
professionalChris Losinger9-Oct-07 6:09 
QuestionDisable a Menu Option upon right click on a folder Pin
narayanagvs8-Oct-07 22:13
narayanagvs8-Oct-07 22:13 
AnswerRe: Disable a Menu Option upon right click on a folder Pin
chandu0048-Oct-07 22:21
chandu0048-Oct-07 22:21 
AnswerRe: Disable a Menu Option upon right click on a folder Pin
William Engberts8-Oct-07 22:58
William Engberts8-Oct-07 22:58 
GeneralRe: Disable a Menu Option upon right click on a folder Pin
narayanagvs9-Oct-07 1:38
narayanagvs9-Oct-07 1:38 
GeneralRe: Disable a Menu Option upon right click on a folder Pin
narayanagvs9-Oct-07 1:44
narayanagvs9-Oct-07 1:44 
QuestionProblem about Precompiled Header (*.pch) directive Pin
TooShy2Talk8-Oct-07 21:36
TooShy2Talk8-Oct-07 21:36 

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.