Click here to Skip to main content
16,003,611 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: Transparent Window Pin
Rajkumar R29-Feb-08 2:47
Rajkumar R29-Feb-08 2:47 
GeneralDirectshow filter crashes in thumbnail view Pin
mTahir29-Feb-08 0:45
mTahir29-Feb-08 0:45 
GeneralRe: Directshow filter crashes in thumbnail view Pin
Cedric Moonen29-Feb-08 0:58
Cedric Moonen29-Feb-08 0:58 
GeneralRe: Directshow filter crashes in thumbnail view Pin
Rajkumar R29-Feb-08 2:07
Rajkumar R29-Feb-08 2:07 
GeneralRe: Directshow filter crashes in thumbnail view Pin
mTahir2-Mar-08 20:03
mTahir2-Mar-08 20:03 
GeneralA query in bitmap routine Pin
jossion29-Feb-08 0:00
jossion29-Feb-08 0:00 
GeneralRe: A query in bitmap routine Pin
CPallini29-Feb-08 0:18
mveCPallini29-Feb-08 0:18 
GeneralRe: A query in bitmap routine(CDC versus HDC) Pin
jossion4-Mar-08 1:43
jossion4-Mar-08 1:43 
rtant = 0;

bm.bmiHeader = bmi;

for (int color_index = 0; color_index < 256; color_index++)
{
rgbarray[color_index].rgbBlue = i;
rgbarray[color_index].rgbGreen = i;
rgbarray[color_index].rgbRed = i;
rgbarray[color_index].rgbReserved = 0;
}
bm.bmiColors[1] = rgbarray[0];


/////////////////////

CRect rcClient;
GetClientRect(rcClient); // See Note 1
rcClient.right=176;
rcClient.bottom=144;



CDC MemDC,*pDC;
CBitmap MemBitmap,*drawmem;

pDC = this->GetDC(); // Get Current DC

MemDC.CreateCompatibleDC(pDC);


CreateDIBSection(MemDC,bm,DIB_RGB_COLORS,disp_frame,NULL,0);
CBitmap *pOldBitmap =MemDC.SelectObject(&MemBitmap);

pDC->BitBlt(150,100,176,144,&MemDC,0,0,SRCCOPY);

MemDC.SelectObject(pOldBitmap);


ReleaseDC(pDC);


}

This was the piece of code which was posted previously. But the CreateDIBSection code
CreateDIBSection(MemDC,bm,DIB_RGB_COLORS,disp_frame,NULL,0); was having MemDC is a CDC type. But actually it should be HDC type. So I have rewritten the code as

HDC hDC;
hDC = CreateDC("DISPLAY",NULL,NULL,NULL);
HDC memDC = CreateCompatibleDC(hDC);
CreateDIBSection(hDC,bitmap,DIB_PAL_COLORS,ppbits,NULL,0);
HBITMAP memBM = CreateCompatibleBitmap(hDC,176,144);
SelectObject(memDC,memBM);

BitBlt(memDC,150,100,176,144,hDC,0,0,SRCCOPY);

But CreateDIBSection is creating exception. What could be the reason. Basically I could not get the difference between CDC and HDC. Could anyone give a clear solution to my problem. I am actually trying to display a grayscale image which exists as R=G=B values in memory.
QuestionRe: A query in bitmap routine(CDC versus HDC) Pin
CPallini4-Mar-08 2:08
mveCPallini4-Mar-08 2:08 
GeneralRe: A query in bitmap routine(CDC versus HDC) Pin
jossion4-Mar-08 19:01
jossion4-Mar-08 19:01 
GeneralRe: A query in bitmap routine(CDC versus HDC) Pin
CPallini4-Mar-08 21:35
mveCPallini4-Mar-08 21:35 
QuestionHow to flash the taskbar icon of a certain frame ? Pin
Ahmed Charfeddine28-Feb-08 23:59
Ahmed Charfeddine28-Feb-08 23:59 
GeneralRe: How to flash the taskbar icon of a certain frame ? Pin
Rajesh R Subramanian29-Feb-08 0:02
professionalRajesh R Subramanian29-Feb-08 0:02 
GeneralRe: How to flash the taskbar icon of a certain frame ? Pin
Ahmed Charfeddine29-Feb-08 3:36
Ahmed Charfeddine29-Feb-08 3:36 
GeneralRe: How to flash the taskbar icon of a certain frame ? Pin
Rajesh R Subramanian29-Feb-08 3:44
professionalRajesh R Subramanian29-Feb-08 3:44 
QuestionCan't find the win32 C/C++ equivalents of the VB functions SelStart, SelLength, and SelText Pin
glyfyx28-Feb-08 22:48
glyfyx28-Feb-08 22:48 
GeneralRe: Can't find the win32 C/C++ equivalents of the VB functions SelStart, SelLength, and SelText Pin
CPallini28-Feb-08 23:04
mveCPallini28-Feb-08 23:04 
GeneralRe: Can't find the win32 C/C++ equivalents of the VB functions SelStart, SelLength, and SelText Pin
glyfyx6-Mar-08 9:20
glyfyx6-Mar-08 9:20 
AnswerRe: Can't find the win32 C/C++ equivalents of the VB functions SelStart, SelLength, and SelText Pin
JohnCz4-Mar-08 13:03
JohnCz4-Mar-08 13:03 
GeneralRe: Can't find the win32 C/C++ equivalents of the VB functions SelStart, SelLength, and SelText Pin
glyfyx6-Mar-08 9:19
glyfyx6-Mar-08 9:19 
GeneralRe: Can't find the win32 C/C++ equivalents of the VB functions SelStart, SelLength, and SelText Pin
JohnCz6-Mar-08 17:30
JohnCz6-Mar-08 17:30 
Generalinsert Picture Pin
bhat28-Feb-08 21:57
bhat28-Feb-08 21:57 
GeneralRe: insert Picture Pin
Maxwell Chen28-Feb-08 22:25
Maxwell Chen28-Feb-08 22:25 
GeneralRe: insert Picture Pin
bhat29-Feb-08 1:18
bhat29-Feb-08 1:18 
GeneralRe: insert Picture Pin
Hamid_RT29-Feb-08 3:07
Hamid_RT29-Feb-08 3:07 

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.