Click here to Skip to main content
15,887,485 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Deleting Files Pin
BobInNJ6-Jan-14 3:55
BobInNJ6-Jan-14 3:55 
QuestionGet the mouse position Pin
Richard Andrew x6431-Dec-13 19:43
professionalRichard Andrew x6431-Dec-13 19:43 
AnswerRe: Get the mouse position Pin
Richard MacCutchan1-Jan-14 1:20
mveRichard MacCutchan1-Jan-14 1:20 
GeneralRe: Get the mouse position Pin
Richard Andrew x641-Jan-14 7:07
professionalRichard Andrew x641-Jan-14 7:07 
AnswerRe: Get the mouse position Pin
SandipG 2-Jan-14 0:46
SandipG 2-Jan-14 0:46 
GeneralRe: Get the mouse position Pin
Richard Andrew x642-Jan-14 5:12
professionalRichard Andrew x642-Jan-14 5:12 
GeneralRe: Get the mouse position Pin
Richard Andrew x642-Jan-14 16:31
professionalRichard Andrew x642-Jan-14 16:31 
Question[SOLVED] Cann't Show Picture using RGB Data Pin
Django_Untaken30-Dec-13 20:00
Django_Untaken30-Dec-13 20:00 
Hello. I can not seem to understand how to show 640 x 480 RGB data onto a dialog as a single picture. Following code uses SetPixel() to show it but looks like it makes and show two pictures of 320 x 240.
C++
void CShowPicDlg::OnShowClick()
{
   CDC* pDC = this->GetDC();

   // preferred to have seperate indices for R, G and B.
   DWORD dwStartIndexRGB = 1, dwMiddleIndexRGB = 2, dwEndIndexRGB = 3;

    for (int y = 0; y < 480; y++)	//Height
    {
       for (int x = 0; x < 640; x++)	//width
       {
            POINT wndPoint;
            wndPoint.x = x;
            wndPoint.y = y;
        
            BYTE r = m_pFrameData[dwStartIndexRGB];
            BYTE g = m_pFrameData[dwMiddleIndexRGB];
            BYTE b = m_pFrameData[dwEndIndexRGB];
        
            pDC->SetPixel(wndPoint, RGB(r, g, b));
            
            dwStartIndexRGB += 4;
            dwMiddleIndexRGB = dwStartIndexRGB + 1;
            dwEndIndexRGB = dwStartIndexRGB + 2;
        
            if(dwStartIndexRGB >= m_nSize)
                break;
       }	
    }
}

So
1 - why is it showing two similar pictures of smaller frame size while the data itself is a single picture with frame size 640 x 480 ?
2 - how do I set alpha value for getting original colors?
Thanks for any pointer.

modified 1-Jan-14 23:34pm.

QuestionRe: Cann't Show Picture using RGB Data Pin
Richard MacCutchan30-Dec-13 22:57
mveRichard MacCutchan30-Dec-13 22:57 
AnswerRe: Cann't Show Picture using RGB Data Pin
Django_Untaken31-Dec-13 0:24
Django_Untaken31-Dec-13 0:24 
GeneralRe: Cann't Show Picture using RGB Data Pin
Jochen Arndt31-Dec-13 3:48
professionalJochen Arndt31-Dec-13 3:48 
AnswerRe: Cann't Show Picture using RGB Data Pin
Django_Untaken31-Dec-13 5:56
Django_Untaken31-Dec-13 5:56 
GeneralRe: Cann't Show Picture using RGB Data Pin
Jochen Arndt31-Dec-13 6:12
professionalJochen Arndt31-Dec-13 6:12 
GeneralRe: Cann't Show Picture using RGB Data Pin
Django_Untaken31-Dec-13 18:33
Django_Untaken31-Dec-13 18:33 
GeneralRe: Cann't Show Picture using RGB Data Pin
Jochen Arndt31-Dec-13 23:50
professionalJochen Arndt31-Dec-13 23:50 
GeneralRe: Cann't Show Picture using RGB Data Pin
Django_Untaken1-Jan-14 1:59
Django_Untaken1-Jan-14 1:59 
GeneralRe: Cann't Show Picture using RGB Data Pin
Jochen Arndt1-Jan-14 2:30
professionalJochen Arndt1-Jan-14 2:30 
GeneralRe: Cann't Show Picture using RGB Data Pin
Django_Untaken1-Jan-14 5:08
Django_Untaken1-Jan-14 5:08 
QuestionClose Child Common Dialog Pin
john563230-Dec-13 18:21
john563230-Dec-13 18:21 
QuestionRe: Close Child Common Dialog Pin
Richard MacCutchan30-Dec-13 22:55
mveRichard MacCutchan30-Dec-13 22:55 
Questionhow to fix the error of the set and get function in my program? Pin
Member 1049499430-Dec-13 5:16
Member 1049499430-Dec-13 5:16 
AnswerRe: how to fix the error of the set and get function in my program? Pin
Thong LeTrung30-Dec-13 5:27
Thong LeTrung30-Dec-13 5:27 
AnswerRe: how to fix the error of the set and get function in my program? Pin
Albert Holguin30-Dec-13 5:28
professionalAlbert Holguin30-Dec-13 5:28 
QuestionHow to convert a visual c++ project to a dll project file? Pin
Adewumi Adedeji29-Dec-13 23:51
Adewumi Adedeji29-Dec-13 23:51 
AnswerRe: How to convert a visual c++ project to a dll project file? Pin
Richard MacCutchan30-Dec-13 0:44
mveRichard MacCutchan30-Dec-13 0:44 

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.