Click here to Skip to main content
15,913,261 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralScott Meyers' Effective STL :: C++ Pin
valikac12-Oct-02 17:37
valikac12-Oct-02 17:37 
GeneralRe: Scott Meyers' Effective STL :: C++ Pin
Michael Dunn12-Oct-02 18:24
sitebuilderMichael Dunn12-Oct-02 18:24 
GeneralRe: Scott Meyers' Effective STL :: C++ Pin
Jim Crafton12-Oct-02 19:07
Jim Crafton12-Oct-02 19:07 
GeneralRe: Scott Meyers' Effective STL :: C++ Pin
Paul M Watt12-Oct-02 19:52
mentorPaul M Watt12-Oct-02 19:52 
GeneralRe: Scott Meyers' Effective STL :: C++ Pin
Daniel Turini12-Oct-02 22:03
Daniel Turini12-Oct-02 22:03 
GeneralRe: Scott Meyers' Effective STL :: C++ Pin
Paul M Watt12-Oct-02 18:22
mentorPaul M Watt12-Oct-02 18:22 
GeneralRe: Scott Meyers' Effective STL :: C++ Pin
valikac12-Oct-02 18:34
valikac12-Oct-02 18:34 
GeneralHelp pls! Pin
oly200212-Oct-02 16:02
oly200212-Oct-02 16:02 
I wanted to display 10 bitmaps using CImageList
but why all the bitmaps were black

1.first ,I created a project "Cards",Imported 1,2,...,10
2.and I added variable in CCardsView
CImageList* m_pImageList
and the function

BOOL CCardsView::AddBitmap(UINT nResourceID)
{
CBitmap m_bmp;

if(m_bmp.LoadBitmap(nResourceID))
{
m_pImageList->Add(&m_bmp,RGB(256,256,256));
m_bmp.DeleteObject();

return TRUE;
}

return FALSE;
}

3.CCardsView::CCardsView()
{
// TODO: add construction code here
m_pImageList=new CImageList;
m_pImageList->Create(71,96,ILC_COLORDDB,256,1);

for(int i=1;i<11;i++)
{
AddBitmap(i);
}

}

4.CCardsView::~CCardsView()
{
if(m_pImageList!=NULL)
{
delete m_pImageList;
}
}

5.void CCardsView::OnDraw(CDC* pDC)
{
CCardsDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here

CPoint pos(0,0);

// m_pImageList->SetBkColor(CLR_NONE);
// m_pImageList->SetOverlayImage(0,1);

for(int i=0;i<10;i++)
{
m_pImageList->Draw(pDC,i,pos,ILD_NORMAL);

pos.x+=50;
}
}

Why?


--oly--
GeneralRe: Help pls! Pin
tongc12-Oct-02 16:37
tongc12-Oct-02 16:37 
GeneralRe: Help pls! Pin
Anonymous12-Oct-02 16:49
Anonymous12-Oct-02 16:49 
GeneralRe: Help pls! Pin
tongc12-Oct-02 16:57
tongc12-Oct-02 16:57 
GeneralRe: Help pls! Pin
Anonymous12-Oct-02 17:06
Anonymous12-Oct-02 17:06 
GeneralRe: Help pls! Pin
tongc12-Oct-02 17:10
tongc12-Oct-02 17:10 
GeneralRe: Help pls! Pin
oly200212-Oct-02 20:03
oly200212-Oct-02 20:03 
GeneralRe: Help pls! Pin
Gary R. Wheeler13-Oct-02 4:43
Gary R. Wheeler13-Oct-02 4:43 
GeneralIdentify blank line with gets() function!! Pin
tongc12-Oct-02 15:17
tongc12-Oct-02 15:17 
GeneralRe: Identify blank line with gets() function!! Pin
Roger Stewart12-Oct-02 15:29
professionalRoger Stewart12-Oct-02 15:29 
GeneralRe: Identify blank line with gets() function!! Pin
Gary R. Wheeler13-Oct-02 4:48
Gary R. Wheeler13-Oct-02 4:48 
GeneralRe: Identify blank line with gets() function!! Pin
Ravi Bhavnani13-Oct-02 5:39
professionalRavi Bhavnani13-Oct-02 5:39 
GeneralADOX Console Application Linker Problem Pin
perlmunger12-Oct-02 14:52
perlmunger12-Oct-02 14:52 
GeneralFast selecting from a ListBox Pin
Darroll Walsh12-Oct-02 14:36
Darroll Walsh12-Oct-02 14:36 
QuestionIs this (sort of) normal? Pin
WREY12-Oct-02 14:10
WREY12-Oct-02 14:10 
AnswerRe: Is this (sort of) normal? Pin
Chris Losinger12-Oct-02 14:25
professionalChris Losinger12-Oct-02 14:25 
GeneralRe: Is this (sort of) normal? Pin
WREY12-Oct-02 14:49
WREY12-Oct-02 14:49 
GeneralTransparentBlit and win 95 Pin
RobertC12-Oct-02 11:33
RobertC12-Oct-02 11:33 

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.