By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,153 Members | 1,005 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,153 IT Pros & Developers. It's quick & easy.

Displaying an image on ATL Dialog

P: n/a
I'm trying to display an image on an ATL Dialog form in VS2003... I think
I am able to load an image (a GIF) w/ CImage.Load, and I'm trying to call
the SetBitmap followed by Invalidate on the CStatic that I get, but no
image appears... I'm doing this in OnInitDialog(...). any help?
Jun 12 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Michael Bray <mb*****************@you.figure.it.out.comwrote in
news:Xn***************************@207.46.248.16:
I'm trying to display an image on an ATL Dialog form in VS2003... I
think I am able to load an image (a GIF) w/ CImage.Load, and I'm
trying to call the SetBitmap followed by Invalidate on the CStatic
that I get, but no image appears... I'm doing this in
OnInitDialog(...). any help?
Hmmm I just realized something that might change what I said above...
the .SetBitmap function is actually defined in a set of headers that I
got off the internet somewhere... basically what it ends up doing is a
SendMessage with STM_SETIMAGE:

HBITMAP SetBitmap(HBITMAP hBitmap)
{
ATLASSERT(::IsWindow(m_hWnd));
return (HBITMAP)::SendMessage(m_hWnd, STM_SETIMAGE, IMAGE_BITMAP,
(LPARAM)hBitmap);
}

my code:

CImage img;
LPCTSTR ctiLogo = L"c:\\\\coleman_logo.gif";
if (img.Load(ctiLogo) == S_OK)
{
ATLControls::CStatic pic = GetDlgItem(IDC_CTI_LOGO);
pic.SetBitmap(img);
pic.Invalidate();
}
Still not working, of course, but I figured a lot of you might say "what
is SetBitmap??"

-mdb
Jun 12 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.