473,396 Members | 1,599 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Displaying an image on ATL Dialog

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
1 1942
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: John | last post by:
Hi I am trying to display an image in a dialog using the following code; Dim frm As New frmImage Dim z As System.Drawing.Bitmap z.FromFile("c:\temp\image.gif") frm.picImage.Image = z...
8
by: Jon Weston | last post by:
I'm setting up an Access2003 database with pictures. I put a bound ole picture ctrl on a form that's source is the table that contains the pictures and follow ALL the directions for embedding a...
7
by: alwayssmiling | last post by:
Hi frends, In my application, a class supports backend processing. In this class im creating a new excel sheet and im inserting some data into this excel sheet, and im trying to save the file...
13
by: arashkk | last post by:
I convert a bitmap from Format24bppRgb to Format8bppIndexed this way: Bitmap bmp = new Bitmap("c:\\flower.bmp"); BitmapData bmData = bmp.LockBits(new Rectangle(0, 0, bmp.Width, bmp.Height),...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.