load and display bitmap image

Hi,

I have a Picture control on a dialog (VC++ 6 + NT 4.0),  and i want to
load an image with a file dialog and display it in the Picture control.
 How do i do this? I cannot seem to find any decent tutorials!

Thanks in advance
lee

0
lee__2k (6)
11/13/2006 2:59:28 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
584 Views

Similar Articles

[PageSpeed] 5

> I have a Picture control on a dialog (VC++ 6 + NT 4.0),  and i want to
> load an image with a file dialog and display it in the Picture control.
>  How do i do this? I cannot seem to find any decent tutorials!
>

A  picture control is a CStatic. You can load the picutre(LoadImage)
and then call CStatic::SetBitmap to show it. There are several examples
on the net, some using GDI+:

http://msdn.microsoft.com/msdnmag/issues/01/10/c/
http://msdn.microsoft.com/msdnmag/issues/02/03/c/default.aspx
http://www.codeproject.com/bitmap/cximage.asp

---
Ajay

0
ajaykalra (6842)
11/13/2006 3:59:32 PM
Reply:

Similar Artilces:

use displayed value in calculation
quick question - if I perform a simple calculation of =(a1+b1) in the m1 cell, and then need to use that result in another calculation in the n1 cell =(m1*3.14), why do I get a value of 0.00 returned? michae What values are in cells A1 and B1? A small number, showing two decimal places, could display as 0.00 michael wrote: > quick question - > > if I perform a simple calculation of =(a1+b1) in the m1 cell, and then > need to use that result in another calculation in the n1 cell > =(m1*3.14), why do I get a value of 0.00 returned? > > > > michae > -- ...

Account Segments not displaying properly Trial Balance
We have 4 workstations running GP 10.0. On 2 of the workstations, when we print/display the Trial Balance the 2 and 3rd segments of the account number do not display properly. Our account number consists of 3 segments, acctnum-branch-region We have over 80 branches and without the branch number displaying properly the Trial Balance from these 2 workstations is useless. I have tried to download and update the newest printer drivers as per Crystal Reports, updated video card drivers, use Named Printers and so far I have not had any luck. Anyone have an idea? I have pasted an example be...

Combining two accounts as one display
If I have two emails, can Live Mail be configured so that both accounts can be displayed (combined) For me this would prevent 2 deletes, 2 junks, etc.- Thanks. Otzi On Tue, 20 Jul 2010 18:58:21 -0700, otzi wrote: > If I have two emails, can Live Mail be configured so that both accounts can > be displayed (combined) For me this would prevent 2 deletes, 2 junks, etc.- Back in the good old days of MS Outlook Express, a number of people wanted separate account folders. Now that MS has accommodated those folk, people are demanding a global Inbox. Well, MS, in their infinite wi...

How do you get the maximum value to display in text box form
In a form, if I have 4 text boxes and 3 of them will contain a number. How do you get the maximum value to display in the 4th. I have tried many different things, I can make it work for a single field in a table, but that finds the value through all records. I just want it to display the max value from the numbers on the form, which could be different for various records. You could use something like this as the Control Source of the 4th text box (the underscore is for ease of reading here, and must be removed from the Control Source): =IIf([Field1]>[Field2] And [Field1]>[Field3],...

Boot-start of system driver(s) failed to load
My event log keeps showing error 7026, The following boot-start or system start driver(s) failed to load ftsata2. Could someone please help me with this? ...

change order in which gwes loads display, touch, hid drivers
I cannot figure out how to do this, but I need GWES to load the display driver FIRST (for a splash screen implementation). Cannot find any registry values that accomplish this... any ideas? Come on guys, somebody has to know the order in which driver's are loaded by GWES.exe and how to alter it.... MS gentlemen???? I don't think that's going to help. What you really want to do is load the image in the bootloader, since, by the time GWES itself loads, you're probably 75% of the way through the boot process. As far as I can recall, GWES loads the keyboard, mouse, a...

Different display names
Hi Is there any way to have an account display differently in the FROM field compared to the GAL (Exchange 2003). We would like the user to appear in the GAL as "Bob User" but when an external recipient reads an email it should be displayed as "Bob of Company <bob.user@company.com>". Cheers Stuart ...

Pink versus White in bitmap resource
I have 50 or so resource bitmaps in a project. All are supposed to be images on white "backgrounds". However, about five of them appear on light-pink backgrounds. If I change the backgrounds to white (e.g., by using the paint bucket or by pasting in the original image), it looks white on the screen. However, if I close and reopen the resource, the "background" is again pink. I suspect this has to do with the color palette (these are 256 color images, which I need to keep for size, as this app also runs on a Pocket PC). There is definitely a pure white in the palette (...

sql server displays
I would like to know what I can use in sql server report 2008 to display several sentences or paragraphs prior to where I have a table generated. Each table in each report will display the data. To display the paragraph(s) and/or sentence(s) before the table containing data what toolbox item would I use? Should I use a matrix, rectangle, textbox, and or another table? Your question is not really clear, but I think you are trying to do would be done using a list box. Add the list box to the report, put the text boxes you want to display here, then add the table control to the ...

Recent documents don't display
Recent documents work in Word but not in Excel. Not grayed out, but simply does not show any. -- Dana Go to Office Button- Go to Excel Options-Advanced, then go down to “Display” In the first line “Show this number of Recent Documents” check the number & modify as you like. -- MFS22 "danappofc" wrote: > Recent documents work in Word but not in Excel. Not grayed out, but simply > does not show any. > -- > Dana Documents that you opened by double-clicking their icon will not show in the list. Only those that you opened from within Ex...

program loading time
The money 05 loads very slow, I have archived everthing past 90 days but it still loads slow. Any suggestions? In microsoft.public.money, oltexasboy wrote: >The money 05 loads very slow, I have archived everthing past 90 days but it >still loads slow. Any suggestions? Restore the archive as your main file, if you have not gone too far with it since the archive. Archiving did not help your speed appreciably, and you might want to refer to that older data. Consider reducing scheduled bills. Remove accounts from the budget if you think that would be appropriate. Set your start page t...

Problem displaying string data in Edit box
Hi, I am trying to display a CString in an Editbox. In the dialog, I have set the edit box to multiline, read-only, auto vertical scroll and want return. I set the Edit box with the CString variable when a serial handler occurs. The serial handler code is obtained from http://www.codeproject.com/KB/system/serial.aspx and have integrated into my main dialog. I have created a edit box variable in my dialog and create a member variable within the main dialog window. When the serial handler is called, I store the serial message into the CString variable and use SetwindowText() to display the st...

Display web chart in excel
I am trying to create a financial spread sheet and link a chart from ADVFN so it shows up live in my spreadsheet. Havent got a clue how to make this work, any ideas would be appreciated. Rgds Mike Hi, Mike, I may not be understanding what you're after... (and I don't know what ADVFN is) but, have you tried inserting a hyperlink from the menu? Select which cell you want the link to show, then Insert->Hyperlink... and complete the information (link address, name, screen tip, etc) Or are you looking for something more?? jeff >-----Original Message----- >I am trying to cre...

I am trying to get access to display leading zeros and auto numbe
we use a sequential number system that begins new each month but we need it to hold 4 places 0001, 0002. etc. I would like to know if Access will do this. "Donna" <Donna@discussions.microsoft.com> wrote in message news:484176CC-EFDE-48BB-BF18-C5BEFD695710@microsoft.com... > we use a sequential number system that begins new each month but we need > it > to hold 4 places 0001, 0002. etc. I would like to know if Access will do > this. Yes, but ... You can't use the built-in autonumber field to do what you want. Therefore you'll need so...

OT...Free Trial...Digital Image Starter Edition 2006...OT
Announcing the availability of the Microsoft Digital Image Starter Edition 2006. This is a fully functional, downloadable trial version with all the bells and whistles of MS Digital Image Suite 2006. The program will revert to very limited functionality after the 60 day trial period. Microsoft Digital Image Starter Edition 2006 http://tinyurl.com/8x6ea Be aware that it's a 109 MB download.... BTW, this program includes Photo Story 3.1 and it has the capability to create VCDs. -- John Inzer Guess a dial-up connection might take a while, huh? ;-) -- JoAnn Paules MVP Micr...

Imaging new PCs
Our company is getting ready to roll-out new PCs for our Accounting desktop. We are also upgrading from Dynamics 7 to 8. I wanted to include the new Dynamics client install in our Ghost image, but our Accounting people are saying that the consultants do not want us to image these PCs. Can anyone tell me if they know of any issues with Dynamics being part of a desktop image? If so, can you give me the details of the problem? Hi I cannot see any issues to why you cannot do this? Maybe its because different users have different modified forms & reports etc.. I have advise clien...

Loading multiple email addresses
When I try to add an additional email account to my Outlook Exprees, it downloads the same folders as the first email account. How can I retain each email account with seperate folders if they are all under the same identity. Also, the email passwords refuse to be saved even when entered and click the sva epassword box. Anhy thoughts. Paul ...

On error displayes default error code instead of the specifyed one
Hi, I have added error handling code to my combo box. Private Sub searchName_AfterUpdate() ' Find the record that matches the control. Dim rs As Object On Error GoTo ERR_Handler Set rs = Me.Recordset.Clone rs.FindFirst "[sdutentId] = " & Str(Nz(Me![searchName], 0)) On Error GoTo 0 Exit Sub ERR_Handler: MsgBox "Please empty search box before continuing!" End Sub But it doesn't display the message in msgbox, it displayed default ms access error code. which is "The text you have entered isn't an item in the ...

loading 5.0 files to money 2003
I just got a new system with Money 2003 preloaded and when attempting to open my backup file(on a floppy) from an earlier version of money all I get is a message that asks if I want to back up to floppy. If I click on "dont back up" all I get is the message "money is not properly installed. Please try set up again" Any idea what I might be doing wrong/not doing??? Help thanks Is it possible that you can reload Money from any disks supplied to you with the system? -- Glyn Simpson, Microsoft MVP - Money Check http://support.microsoft.com/default.aspx?scid=fh;EN-...

displaying data linked to shape
I would like to click on a shape and have the list of linked data in the database be displayed. (I have a lab diagram, and I want to display the contents of a drawer when the shape is clicked..... and vice versa, when I'm in the database and click on an item, I'd like to have the location of the item displayed on a lab map. Can anyone point me to a tutorial or better yet, a functional example, that does this. I've linked the shape and database, but don't seem grasp how to actually put that link into practice. Thanks in advance jillymc ...

Outlook 2007 not loading properly
Hi I am running Windows Vista Home Premium on an HP desktop, with Office 2007 SP2. For months my Outlook has worked fine (or as well as can be expected). In the last 2 weeks it has stopped loading. It will open only in safe mode. How can I fix this problem? I have tried: 1. office diaganostics - no resolution found 2. reinstalling Office 2007 - major pain, and no resolution with the Outlook problem 3. adding a new outlook profile - again no change. regards TM And did you try to disable all the Add Ins and see if it opens that way also. Then if it does return each Add...

image enlarges when uploaded to web
I created a header image for a website in publisher, the size of it is 7.85 in x 1.9 in, saved as jpeg file, also bmp file, when I upload the graphic into builderspot, the graphic enlarges to about 20 inches across by 5 in. deep. How can I keep the correct dimensions so when I upload this it wont increase in size? Help! Dawn Inches isn't the same as pixels. Your picture needs to be measured in pixels, probably about 750 pixels. In Publisher, Tools, Options, change the measurements to pixels. Re-work your banner. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer...

make PNG image visible in Excel
I have an Excel macro that generates a hyperlink from Excel to an URL to download a PNG image. The macro works OK but the image arrives back to Excel as a 'png symbol' only, and is not visible. If I manually do a "New WebQuery" I can see the image in the New WebQuery dialog box but on "Import" all I get is a 'png symbol' only in "A1". "A1" is formatted for text. If I cut and paste the URL through IExplore I get a Visible PNG image OK. but that is to slow for a repetative and time dependant method.. Any suggestions would by most...

MSXML2 to Load xml document using ISO-8859-1 encoding
HI My application connects to the UPS server which returns an ISO-8859-1 encoded XML response. I need a part of this response, ie. the AccessLicenseAgreement , which i need to display in my application and then return to the UPS server with the next request. Their server matches what they sent me with what i return back to them. Due to the difference in the encoding method it returns an Invalid AccessLicenseAgreement error back to me. I set my request Processing Instruction to ISO-8859-1 encoding, but i still get the same error from them. I am guessing the problem is when i read it in using Lo...

pictures in HTML message are displayed as attachment not inline?
Whenever I send meassege in HTML format and having inline pictures these pictures are displayed as attachment and not inline on recieving end? What is the problem and how to resolve it. ...