Click here to Skip to main content
       

C / C++ / MFC

 
AnswerRe: Kernel programming PinmvpRichard MacCutchan7-Feb-13 23:08 
GeneralRe: Kernel programming PinmemberOmarSH7-Feb-13 23:49 
GeneralRe: Kernel programming PinmvpRichard MacCutchan8-Feb-13 0:32 
GeneralRe: Kernel programming PinmemberOmarSH8-Feb-13 2:11 
GeneralRe: Kernel programming PinmvpRichard MacCutchan8-Feb-13 5:15 
AnswerRe: Kernel programming [modified] PinmemberErudite_Eric8-Feb-13 0:09 
GeneralRe: Kernel programming PinmemberAlbert Holguin8-Feb-13 6:01 
AnswerRe: Kernel programming PinmemberAlbert Holguin8-Feb-13 6:06 
QuestionDirectShow Video Playback from memory Pinmembersdancer756-Feb-13 3:07 
AnswerRe: DirectShow Video Playback from memory PinmemberCode-o-mat8-Feb-13 8:35 
GeneralRe: DirectShow Video Playback from memory Pinmembersdancer758-Feb-13 21:49 
GeneralRe: DirectShow Video Playback from memory PinmemberCode-o-mat9-Feb-13 0:19 
GeneralRe: DirectShow Video Playback from memory Pinmembersdancer759-Feb-13 5:19 
QuestionBitmap Display from Buffer received by TCP socket Pinmembertoms from newdelhi6-Feb-13 1:21 
I want to display my image on window without saving it.
When data is received window size changes but there is no display
on window.
My Code is:
 
int iBufferLength;
    int iEnd;
    int iSpaceRemaining;
     
    int i;
 
    iBufferLength = iSpaceRemaining = sizeof(chIncomingDataBuffer);
    iEnd = 0;
    iSpaceRemaining -= iEnd;
 
    iBytesRead = recv(Socket, chIncomingDataBuffer+iEnd, iSpaceRemaining, 0);
     
    iEnd+=iBytesRead;
    if (iBytesRead == SOCKET_ERROR)
        MessageBox(hWnd,
                        "Socket Error",
                        "Connection strt",
                        MB_ICONINFORMATION|MB_OK);
        chIncomingDataBuffer[iEnd] = '\0';
 
    if (lstrlen(chIncomingDataBuffer) != 0)
    {
        /*FILE* pfile;
                     
                    pfile =     fopen("test.jpeg", "wb");
                fwrite(chIncomingDataBuffer,1, iBytesRead ,pfile);
                fclose(pfile);*/
 
                GetWindowRect(hWnd, &rect);
                SetWindowPos(hWnd, NULL, rect.left, rect.top, cBitmap.bmWidth, cBitmap.bmHeight, 0);
                  HDC ThisDC = GetDC(hWnd);
 
              DeleteDC(RemoteDC);
              RemoteDC = CreateCompatibleDC(ThisDC);
              DeleteObject(hbitmap);
              hbitmap= CreateCompatibleBitmap(ThisDC, cBitmap.bmWidth, cBitmap.bmHeight);
 
              SelectObject(RemoteDC, hbitmap);
 
              ReleaseDC(hWnd, ThisDC);
 
 
 
              BITMAPINFO bi;
              HBITMAP hbmap;
              int bisize = sizeof(BITMAPINFO);
              memcpy(&bi, chIncomingDataBuffer+iEnd, bisize );
              SetDIBits(RemoteDC, hbitmap, 0,  cBitmap.bmHeight, chIncomingDataBuffer+iEnd+bisize,  &bi, DIB_RGB_COLORS);
 
 
              InvalidateRect(hWnd, NULL, false);
 
can anyone tell me..where I am wrong?
QuestionRe: Bitmap Display from Buffer received by TCP socket PinmvpCPallini6-Feb-13 2:20 
AnswerRe: Bitmap Display from Buffer received by TCP socket PinmvpRichard MacCutchan6-Feb-13 3:09 
Questionicon on button not displayed in XP. PingroupVCProgrammer5-Feb-13 21:47 
SuggestionRe: icon on button not displayed in XP. PinmvpRichard MacCutchan6-Feb-13 3:11 
QuestionRe: icon on button not displayed in XP. PinmemberDavidCrow6-Feb-13 5:58 
AnswerRe: icon on button not displayed in XP. PingroupVCProgrammer6-Feb-13 17:36 
SuggestionRe: icon on button not displayed in XP. PinmemberDavidCrow7-Feb-13 2:35 
GeneralRe: icon on button not displayed in XP. [modified] PingroupVCProgrammer7-Feb-13 18:46 
GeneralRe: icon on button not displayed in XP. PinmvpRichard MacCutchan7-Feb-13 23:07 
GeneralRe: icon on button not displayed in XP. PingroupVCProgrammer7-Feb-13 23:52 
GeneralRe: icon on button not displayed in XP. PinmvpRichard MacCutchan8-Feb-13 0:37 
GeneralRe: icon on button not displayed in XP. PingroupVCProgrammer8-Feb-13 1:15 
GeneralRe: icon on button not displayed in XP. PinmvpRichard MacCutchan8-Feb-13 1:21 
JokeRe: icon on button not displayed in XP. PinmemberDavidCrow8-Feb-13 2:38 
JokeRe: icon on button not displayed in XP. PinmvpRichard MacCutchan8-Feb-13 5:16 
GeneralRe: icon on button not displayed in XP. PingroupVCProgrammer8-Feb-13 20:33 
GeneralRe: icon on button not displayed in XP. PinmvpRichard MacCutchan8-Feb-13 22:42 
GeneralRe: icon on button not displayed in XP. PingroupVCProgrammer9-Feb-13 1:00 
GeneralRe: icon on button not displayed in XP. PinmvpRichard MacCutchan9-Feb-13 1:08 
GeneralRe: icon on button not displayed in XP. PingroupVCProgrammer9-Feb-13 1:20 
GeneralRe: icon on button not displayed in XP. PinmvpRichard MacCutchan9-Feb-13 1:30 
GeneralRe: icon on button not displayed in XP. PingroupVCProgrammer9-Feb-13 1:36 
GeneralRe: icon on button not displayed in XP. PinmvpRichard MacCutchan9-Feb-13 2:05 
GeneralRe: icon on button not displayed in XP. PingroupVCProgrammer10-Feb-13 20:31 
GeneralRe: icon on button not displayed in XP. PinmvpRichard MacCutchan11-Feb-13 0:35 
GeneralRe: icon on button not displayed in XP. PingroupVCProgrammer11-Feb-13 20:29 
GeneralRe: icon on button not displayed in XP. PinmvpRichard MacCutchan11-Feb-13 22:13 
GeneralRe: icon on button not displayed in XP. PinmvpRichard MacCutchan12-Feb-13 9:37 
GeneralRe: icon on button not displayed in XP. PingroupVCProgrammer12-Feb-13 19:59 
QuestionShellExecute Problem PinmemberLFK_Michael4-Feb-13 22:56 
AnswerRe: ShellExecute Problem PinmvpRichard MacCutchan5-Feb-13 0:00 
GeneralRe: ShellExecute Problem PinmemberLFK_Michael5-Feb-13 0:16 
GeneralRe: ShellExecute Problem PinmvpRichard MacCutchan5-Feb-13 0:26 
SuggestionRe: ShellExecute Problem PinmemberDavidCrow5-Feb-13 2:17 
AnswerRe: ShellExecute Problem PinmemberMarius Bancila5-Feb-13 1:05 
GeneralRe: ShellExecute Problem PinmemberLFK_Michael5-Feb-13 3:15 

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

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


Advertise | Privacy | Mobile
Web02 | 2.8.140902.1 | Last Updated 2 Sep 2014
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid