Click here to Skip to main content
15,924,829 members
Home / Discussions / Mobile
   

Mobile

 
GeneralDialog-based project Pin
illidan9915-Nov-04 3:46
illidan9915-Nov-04 3:46 
GeneralRe: Dialog-based project Pin
eli1502197921-Nov-04 0:44
eli1502197921-Nov-04 0:44 
GeneralNewbie question: CDC, CBitmap, and Member Functions Pin
nandhp14-Nov-04 10:49
nandhp14-Nov-04 10:49 
GeneralRe: Newbie question: CDC, CBitmap, and Member Functions Pin
eli1502197915-Nov-04 2:53
eli1502197915-Nov-04 2:53 
GeneralRe: Newbie question: CDC, CBitmap, and Member Functions Pin
nandhp15-Nov-04 8:41
nandhp15-Nov-04 8:41 
GeneralRe: Newbie question: CDC, CBitmap, and Member Functions Pin
Jonas Larsson15-Nov-04 20:56
Jonas Larsson15-Nov-04 20:56 
GeneralRe: Newbie question: CDC, CBitmap, and Member Functions Pin
nandhp16-Nov-04 6:46
nandhp16-Nov-04 6:46 
GeneralRe: Newbie question: CDC, CBitmap, and Member Functions Pin
Jonas Larsson16-Nov-04 7:09
Jonas Larsson16-Nov-04 7:09 
Ok, let me rephrase myself

void CChildView::ShowKing(int facing) {
CPaintDC dc(this); // device context for painting
CDC tempdc;
CBitmap card;
if ( facing == 1 )
card.LoadBitmap(IDB_KINGRIGHT);
else
card.LoadBitmap(IDB_KINGLEFT);
card.CreateCompatibleBitmap(&tempdc,29,41);
// here you create a bitmap that is comaptible to an unintialized dc (ie a monocrome dc), and my guess is that you also overwrite whatever bitmapbits you loaded into the CBitmap object.
tempdc.CreateCompatibleDC(&tempdc);
// this should be done before you create a compatible bitmap.
tempdc.SelectObject(&card);
dc.BitBlt(113,3,14,16, &tempdc,0,0,SRCCOPY);
}
This should work better. If not, check your return value from LoadBitmap.
void CChildView::ShowKing(int facing)
{
CPaintDC dc(this); // device context for painting
CDC tempdc;
CBitmap card;
if ( facing == 1 )
card.LoadBitmap(IDB_KINGRIGHT);
else
card.LoadBitmap(IDB_KINGLEFT);
tempdc.CreateCompatibleDC(&dc);
tempdc.SelectObject(&card);
dc.BitBlt(113,3,14,16, &tempdc,0,0,SRCCOPY);
tempdc.RelaseDC()
dc.ReleaseDC()
}
Note: untested code, I dont have a dev.env. on this computer.

---

"Man will never be free until the last king is strangled with the entrails of the last priest". -- Denis Diderot

GeneralRe: Newbie question: CDC, CBitmap, and Member Functions Pin
nandhp16-Nov-04 9:11
nandhp16-Nov-04 9:11 
GeneralRe: Newbie question: CDC, CBitmap, and Member Functions Pin
nandhp20-Nov-04 8:22
nandhp20-Nov-04 8:22 
GeneralAbout context menu Pin
sea_caty14-Nov-04 6:21
sea_caty14-Nov-04 6:21 
Generaldrive mapping Pin
Jan van den Baard13-Nov-04 5:26
professionalJan van den Baard13-Nov-04 5:26 
GeneralInfra red strange problem Pin
wk_vigorous11-Nov-04 6:47
wk_vigorous11-Nov-04 6:47 
GeneralBasic question Pin
eli1502197911-Nov-04 4:19
eli1502197911-Nov-04 4:19 
Questionwhy does it take 3 DestroyWindow()'s to kill my child? Pin
hedpe10-Nov-04 22:58
hedpe10-Nov-04 22:58 
GeneralUsing VC++ Express for Windows Mobile Pin
Member 213881410-Nov-04 21:18
Member 213881410-Nov-04 21:18 
GeneralRe: Using VC++ Express for Windows Mobile Pin
eli1502197910-Nov-04 23:48
eli1502197910-Nov-04 23:48 
Questionnew version of win mobile? Pin
Roger Alsing10-Nov-04 20:30
Roger Alsing10-Nov-04 20:30 
GeneralPlease helpppppppp Pin
eli1502197910-Nov-04 3:25
eli1502197910-Nov-04 3:25 
GeneralRe: Please helpppppppp Pin
GDavy11-Nov-04 1:00
GDavy11-Nov-04 1:00 
GeneralRe: Please helpppppppp Pin
eli1502197911-Nov-04 2:25
eli1502197911-Nov-04 2:25 
GeneralRe: Please helpppppppp Pin
GDavy11-Nov-04 3:13
GDavy11-Nov-04 3:13 
GeneralRe: Please helpppppppp Pin
eli1502197911-Nov-04 3:59
eli1502197911-Nov-04 3:59 
General3D Effects on buttons lost Pin
LittleYellowBird10-Nov-04 2:47
LittleYellowBird10-Nov-04 2:47 
GeneralRe: 3D Effects on buttons lost Pin
João Paulo Figueira10-Nov-04 10:16
professionalJoão Paulo Figueira10-Nov-04 10:16 

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.