Prev: CMFCPropertyGridCtrl - Get the value from the grid
Next: How to let a CFrameWnd based SDI application start in full screen?
From: Peter Olcott on 10 Jun 2010 14:43 I am getting pixels from a memory device context and they are coming back as BRG order instead of RGB order. How can I get then to come in RGB order. I am using CDC::GetPixel(X, Y);
From: Peter Olcott on 10 Jun 2010 14:52 On 6/10/2010 1:43 PM, Peter Olcott wrote: > I am getting pixels from a memory device context and they are coming > back as BRG order instead of RGB order. How can I get then to come in > RGB order. I am using CDC::GetPixel(X, Y); http://www.eggheadcafe.com/software/aspnet/29555797/cdcgetpixel-and-getdi.aspx The above is the answer from the last time that I asked this question.
From: Joseph M. Newcomer on 10 Jun 2010 21:03 Note that the result of GetPixel is a COLORREF. If you want the compnents of a COLORREF, you should use the macros GetRValue, GetGValue and GetBValue. Note that an RGB triple is in hex 00BBGGRR I have never had GetPixel give me other than RGB triples, so without seeing the code you are using to interpret the values, there is no way to tell what is going on. joe On Thu, 10 Jun 2010 13:43:03 -0500, Peter Olcott <NoSpam(a)OCR4Screen.com> wrote: >I am getting pixels from a memory device context and they are coming >back as BRG order instead of RGB order. How can I get then to come in >RGB order. I am using CDC::GetPixel(X, Y); Joseph M. Newcomer [MVP] email: newcomer(a)flounder.com Web: http://www.flounder.com MVP Tips: http://www.flounder.com/mvp_tips.htm
From: Peter Olcott on 10 Jun 2010 22:04 On 6/10/2010 8:03 PM, Joseph M. Newcomer wrote: > Note that the result of GetPixel is a COLORREF. If you want the compnents of a COLORREF, > you should use the macros GetRValue, GetGValue and GetBValue. > > Note that an RGB triple is in hex 00BBGGRR > > I have never had GetPixel give me other than RGB triples, so without seeing the code you > are using to interpret the values, there is no way to tell what is going on. > joe You already answered this Joe, here is your original answer: http://www.eggheadcafe.com/software/aspnet/29555797/cdcgetpixel-and-getdi.aspx > > > On Thu, 10 Jun 2010 13:43:03 -0500, Peter Olcott<NoSpam(a)OCR4Screen.com> wrote: > >> I am getting pixels from a memory device context and they are coming >> back as BRG order instead of RGB order. How can I get then to come in >> RGB order. I am using CDC::GetPixel(X, Y); > Joseph M. Newcomer [MVP] > email: newcomer(a)flounder.com > Web: http://www.flounder.com > MVP Tips: http://www.flounder.com/mvp_tips.htm
From: Liviu on 11 Jun 2010 00:31
"Peter Olcott" <NoSpam(a)OCR4Screen.com> wrote... > On 6/10/2010 1:43 PM, Peter Olcott wrote: >> I am getting pixels from a memory device context and they are coming >> back as BRG order instead of RGB order. How can I get then to come in >> RGB order. I am using CDC::GetPixel(X, Y); > > http://www.eggheadcafe.com/software/aspnet/29555797/cdcgetpixel-and-getdi.aspx > > The above is the answer from the last time that I asked this question. Are you implying that the answer was not right the first time, or do you somehow expect a different, yet still right, answer now? Liviu |