dani333
asked on
Can't see a picture which combine from CImageList
Hi,
I have a list of pics which combine to one picture ,and i can see it on the Image rect
when the background is not painted,but if i paint the background i can't see it any more
i just see now an empty space where it should be.
What should i do?
///////////////////////Fix ed code after your help//////////////
CRect rect;
CRect rect1;
m_cMouth.GetWindowRect(&re ct1); // screen coordinates
ScreenToClient(&rect1); // client coordinates
CPaintDC dc(this);
dc.ExcludeClipRect(rect1);
CPen p[64];
int i,factor;
GetClientRect(&rect);
factor=rect.bottom/63;
for(i=0;i<64;i++)
p[i].CreatePen(PS_SOLID,1, RGB(250,12 0+i*2,0));
for(i=0;i<rect.bottom;i++)
{
dc.SelectObject(&p[i/facto r]);
dc.MoveTo(0,i);
dc.LineTo(rect.right,i);
}
/* If i put this code in comments i can see the pics*/
////////////////////////// ////////// ////////// ////////// ///
CPaintDC dc(this);
CDialog::OnPaint();
// Draw into memory DC
m_cMouthList.Draw(&dc, 0, m_cMouthRect.TopLeft(), INDEXTOOVERLAYMASK(m_iMout hBmp));
if (m_iMouthBmp % 6 == 2)
{
m_cMouthList.Draw(&dc, WEYESNAR, m_cMouthRect.TopLeft(), 0 );
}
else if (m_iMouthBmp % 6 == 5)
{
m_cMouthList.Draw(&dc, WEYESCLO, m_cMouthRect.TopLeft(), 0 );
}
////////////////////////// ////////// ////////// ////////// ////////// /////////
InitMouthImageList()
{
m_cMouth.GetClientRect(&m_ cMouthRect );
m_cMouth.ClientToScreen(&m _cMouthRec t);
ScreenToClient(&m_cMouthRe ct);
CBitmap bmp;
m_cMouthList.Create(CHARAC TER_WIDTH, CHARACTER_HEIGHT, ILC_COLOR32
|ILC_MASK, 1, 0);
bmp.LoadBitmap(MAKEINTRESO URCE(IDB_M ICFULL));
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO URCE(IDB_M ICMOUTH2)) ;
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO URCE(IDB_M ICMOUTH3)) ;
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO URCE(IDB_M ICMOUTH4)) ;
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO URCE(IDB_M ICMOUTH5)) ;
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO URCE(IDB_M ICMOUTH6)) ;
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO URCE(IDB_M ICMOUTH7)) ;
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO URCE(IDB_M ICMOUTH8)) ;
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO URCE(IDB_M ICMOUTH9)) ;
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO URCE(IDB_M ICMOUTH10) );
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO URCE(IDB_M ICMOUTH11) );
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO URCE(IDB_M ICMOUTH12) );
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO URCE(IDB_M ICMOUTH13) );
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO URCE(IDB_M ICEYESNAR) );
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO URCE(IDB_M ICEYESCLO) );
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
m_cMouthList.SetOverlayIma ge(1, 1);
m_cMouthList.SetOverlayIma ge(2, 2);
m_cMouthList.SetOverlayIma ge(3, 3);
m_cMouthList.SetOverlayIma ge(4, 4);
m_cMouthList.SetOverlayIma ge(5, 5);
m_cMouthList.SetOverlayIma ge(6, 6);
m_cMouthList.SetOverlayIma ge(7, 7);
m_cMouthList.SetOverlayIma ge(8, 8);
m_cMouthList.SetOverlayIma ge(9, 9);
m_cMouthList.SetOverlayIma ge(10, 10);
m_cMouthList.SetOverlayIma ge(11, 11);
m_cMouthList.SetOverlayIma ge(12, 12);
m_cMouthList.SetOverlayIma ge(13, 13);
m_cMouthList.SetOverlayIma ge(14, WEYESNAR);
m_cMouthList.SetOverlayIma ge(15, WEYESCLO);
return TRUE;
}
I have a list of pics which combine to one picture ,and i can see it on the Image rect
when the background is not painted,but if i paint the background i can't see it any more
i just see now an empty space where it should be.
What should i do?
///////////////////////Fix
CRect rect;
CRect rect1;
m_cMouth.GetWindowRect(&re
ScreenToClient(&rect1); // client coordinates
CPaintDC dc(this);
dc.ExcludeClipRect(rect1);
CPen p[64];
int i,factor;
GetClientRect(&rect);
factor=rect.bottom/63;
for(i=0;i<64;i++)
p[i].CreatePen(PS_SOLID,1,
for(i=0;i<rect.bottom;i++)
{
dc.SelectObject(&p[i/facto
dc.MoveTo(0,i);
dc.LineTo(rect.right,i);
}
/* If i put this code in comments i can see the pics*/
//////////////////////////
CPaintDC dc(this);
CDialog::OnPaint();
// Draw into memory DC
m_cMouthList.Draw(&dc, 0, m_cMouthRect.TopLeft(), INDEXTOOVERLAYMASK(m_iMout
if (m_iMouthBmp % 6 == 2)
{
m_cMouthList.Draw(&dc, WEYESNAR, m_cMouthRect.TopLeft(), 0 );
}
else if (m_iMouthBmp % 6 == 5)
{
m_cMouthList.Draw(&dc, WEYESCLO, m_cMouthRect.TopLeft(), 0 );
}
//////////////////////////
InitMouthImageList()
{
m_cMouth.GetClientRect(&m_
m_cMouth.ClientToScreen(&m
ScreenToClient(&m_cMouthRe
CBitmap bmp;
m_cMouthList.Create(CHARAC
|ILC_MASK, 1, 0);
bmp.LoadBitmap(MAKEINTRESO
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
bmp.LoadBitmap(MAKEINTRESO
m_cMouthList.Add(&bmp, RGB(255,0,255));
bmp.Detach();
m_cMouthList.SetOverlayIma
m_cMouthList.SetOverlayIma
m_cMouthList.SetOverlayIma
m_cMouthList.SetOverlayIma
m_cMouthList.SetOverlayIma
m_cMouthList.SetOverlayIma
m_cMouthList.SetOverlayIma
m_cMouthList.SetOverlayIma
m_cMouthList.SetOverlayIma
m_cMouthList.SetOverlayIma
m_cMouthList.SetOverlayIma
m_cMouthList.SetOverlayIma
m_cMouthList.SetOverlayIma
m_cMouthList.SetOverlayIma
m_cMouthList.SetOverlayIma
return TRUE;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
CDC *pdc = GetDC();
.
.
..