LoadMappedBitmap not working?

I have the following code in my OnInitialUpdate method for a CFormView. 
m_logo is a CStatic member variable, and m_logoBitmap is a CBitmap member 
variable:

  COLORMAP colormap;
  colormap.from = RGB(255,255,255);
  colormap.to = GetSysColor(COLOR_3DFACE);

  m_logoBitmap.LoadMappedBitmap(IDB_BITMAP_3M_RFID,0,&colormap,1);
  m_logo.SetBitmap(m_logoBitmap);

This loads and sets the bitmap just fine, however it displays the bitmap 
unaltered. The white background is still white, when I thought it should be 
the dialog color. Can anyone see what I am missing?
0
Ken1 (215)
7/20/2005 7:36:31 PM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
1583 Views

Similar Articles

[PageSpeed] 12

"Ken" <Ken@discussions.microsoft.com> wrote in message
news:7DC21C38-BD1D-4DF6-AC85-E93B158F54DD@microsoft.com...
> I have the following code in my OnInitialUpdate method for a CFormView.
> m_logo is a CStatic member variable, and m_logoBitmap is a CBitmap member
> variable:
>
>   COLORMAP colormap;
>   colormap.from = RGB(255,255,255);
>   colormap.to = GetSysColor(COLOR_3DFACE);
>
>   m_logoBitmap.LoadMappedBitmap(IDB_BITMAP_3M_RFID,0,&colormap,1);
>   m_logo.SetBitmap(m_logoBitmap);
>
> This loads and sets the bitmap just fine, however it displays the bitmap
> unaltered. The white background is still white, when I thought it should
be
> the dialog color. Can anyone see what I am missing?

How many colors are in your resource?  LoadMappedBitmap will not work with
bitmaps that do not have a colortable, so the function will not work (for
example) if your resource has more thatn 256 colors.  See "PRB:
CreateMappedBitmap() and LoadMappedBitmap() are Unsuccessful With
Non-Indexed Bitmaps" at
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q329006

Mike


0
7/20/2005 8:33:27 PM
Thanks for the response. I did convert it to 256 colors using MS Paint - I 
found the same article after trying LoadMappedBitmap with a > 256 color 
bitmap and receiving an exception.

"Michael K. O'Neill" wrote:

> "Ken" <Ken@discussions.microsoft.com> wrote in message
> news:7DC21C38-BD1D-4DF6-AC85-E93B158F54DD@microsoft.com...
> > I have the following code in my OnInitialUpdate method for a CFormView.
> > m_logo is a CStatic member variable, and m_logoBitmap is a CBitmap member
> > variable:
> >
> >   COLORMAP colormap;
> >   colormap.from = RGB(255,255,255);
> >   colormap.to = GetSysColor(COLOR_3DFACE);
> >
> >   m_logoBitmap.LoadMappedBitmap(IDB_BITMAP_3M_RFID,0,&colormap,1);
> >   m_logo.SetBitmap(m_logoBitmap);
> >
> > This loads and sets the bitmap just fine, however it displays the bitmap
> > unaltered. The white background is still white, when I thought it should
> be
> > the dialog color. Can anyone see what I am missing?
> 
> How many colors are in your resource?  LoadMappedBitmap will not work with
> bitmaps that do not have a colortable, so the function will not work (for
> example) if your resource has more thatn 256 colors.  See "PRB:
> CreateMappedBitmap() and LoadMappedBitmap() are Unsuccessful With
> Non-Indexed Bitmaps" at
> http://support.microsoft.com/default.aspx?scid=kb;en-us;Q329006
> 
> Mike
> 
> 
> 
0
Ken1 (215)
7/20/2005 8:48:03 PM
FYI - just to clarify, saving it out as a 256 color bitmap eliminated the 
assertion, but then I still have my current problem, which is the fact that 
it is not mapping the background color.

"Michael K. O'Neill" wrote:

> "Ken" <Ken@discussions.microsoft.com> wrote in message
> news:7DC21C38-BD1D-4DF6-AC85-E93B158F54DD@microsoft.com...
> > I have the following code in my OnInitialUpdate method for a CFormView.
> > m_logo is a CStatic member variable, and m_logoBitmap is a CBitmap member
> > variable:
> >
> >   COLORMAP colormap;
> >   colormap.from = RGB(255,255,255);
> >   colormap.to = GetSysColor(COLOR_3DFACE);
> >
> >   m_logoBitmap.LoadMappedBitmap(IDB_BITMAP_3M_RFID,0,&colormap,1);
> >   m_logo.SetBitmap(m_logoBitmap);
> >
> > This loads and sets the bitmap just fine, however it displays the bitmap
> > unaltered. The white background is still white, when I thought it should
> be
> > the dialog color. Can anyone see what I am missing?
> 
> How many colors are in your resource?  LoadMappedBitmap will not work with
> bitmaps that do not have a colortable, so the function will not work (for
> example) if your resource has more thatn 256 colors.  See "PRB:
> CreateMappedBitmap() and LoadMappedBitmap() are Unsuccessful With
> Non-Indexed Bitmaps" at
> http://support.microsoft.com/default.aspx?scid=kb;en-us;Q329006
> 
> Mike
> 
> 
> 
0
Ken1 (215)
7/20/2005 8:49:03 PM
Reply:

Similar Artilces:

Does not work in 2003
The following code will not work in excel 2003, it stops on the line: tintandshade=0 is there a work around? Cells.Select With Selection.Interior .Pattern = xlNone .TintAndShade = 0 .PatternTintAndShade = 0 End With begin 666 Ed Davis.vcf M0D5'24XZ5D-!4D0-"E9%4E-)3TXZ,BXQ#0I..D1A=FES.T5D#0I&3CI%9"!$ M879I<PT*3DE#2TY!344Z160-"D5-04E,.U!2148[24Y415).150Z961 9&%N M=F5R<W-O9G1W87)E+F-O;0T*4D56.C(P,#DP-S$T5# P,30Q.%H-"D5.1#I6 &0T%21 T* ` end Don't include that line (or the line after, too!)????? If you have to use...

Running Access 2003 db in 2007, and a few forms don't work
I have a database that's been updated from at least Access 97 (maybe Access 2, I can't remember anymore) and has been running fine in Access 2003 for years. My client upgraded to Vista with Office 2007. Almost everything in the database works fine, except 3 forms. Each of these forms has a tab control. Two of the forms have subforms on some of the tabs, one doesn't. When I try to open the forms in Access 2007 running on Vista in Virtual PC, I get the error "There isn't enough memory to perform this operation. Close unneeded programs and try the operation again."...

outlook working offline
I installed exchange to outlook but outlook can't connect to exchange and i removed but i can't remove offline icon and outlook can't connect automatically how can i fix thid problem thnks... Version of Outlook? Error message when you try to connect to Exchange? Have you tried it already with a clean profile? Control Panel-> Mail-> button Show Profiles... Can you ping the server by FQDN? Also contact your administrator to verify the Exchange server settings. -- Robert Sparnaaij [MVP-Outlook] www.howto-outlook.com Tips of the month: -What do the Outlook Icons Mean?...

SelectSingleNode not working... Code provided.
All, The xml file below is a response from a Live Meeting service. I need to extract the following two fields: mid and audienceInviteText I am using vbscript to try and retrieve these values but my code tells me the replynode is required at line 5. Here is what I have: set xmlbody = createobject("Msxml2.DOMDocument") xmlbody.loadXML("c:\MeetingResponse.xml") Set replynode = xmlbody.selectSingleNode("//CreateMeetingReply/MeetingReply/OptionList") Set myAtt = replynode.getAttributes.GetNamedItem("mid") msgbox myAtt.Value ' File name is C:\Me...

when i save a file that i have worked on, excel7 closes down work.
i have recently purchased office pro 2007. Excel 2007, when i save a filethat i have worked on, excel closes down and work is lost, done all updates, re installed from disc, please help i have lost 2 hours of work this moring that i need for a report a few questions: 1. what happens with save as? 2. what happens in safe mode? (hold shift key while starting excel) 3. do you have add-ins? 4. what operating system? x64? -- Gary Keramidas Excel 2003 "rob" <rob@discussions.microsoft.com> wrote in message news:0483F09B-3289-42B4-8849-0C0A61380B11@mic...

Working directory problems
Hello, My application runs from C:\Program Files\Superna\ConfigNet\Bin (a.k.a Bin Directory) directory. My shared dll are in C:\Program Files\Superna\Common Files (a.k.a CommonFiles Directory) directory. My application dllz are in the Bin Directory. My application uses dll files both from my Bin Directory and my CommonFiles Directory. My application shortcut exists both in Start->Programs->Superna and on the user's desktop. User can doubleclick an nfg file so the application will run and load the nfg file (my network file). In order to support this behaviour I did the following...

That Worked
Hey, It worked. I created a new profile and that seem to do the trick. Bonus!, my KeySuite for my palm seems to have come over as well. I did a test sync with my Palm with a new record entered in and it came over no problem. Thank you for your help!!!! Dominic ...

System manager not working properly
Last week I was goingt o move a mailbox from one mailbox store to another and when I right click on a user the following error message comes up: The server is not operational. Facility: Win32 ID no: 8007203a Exchange System Manager Seems that something is broken but I can't figure out what it is. Any ideas as to what is wrong and is there a fix floating around out there somewhere? Thanks in advance. -- Glenn MCP A+ Network Admin MBBC Have you looked here... http://support.microsoft.com/default.aspx?kbid=325322 Here is another article that points to DNS issues... http://www.mcse.m...

LoadMappedBitmap not working?
I have the following code in my OnInitialUpdate method for a CFormView. m_logo is a CStatic member variable, and m_logoBitmap is a CBitmap member variable: COLORMAP colormap; colormap.from = RGB(255,255,255); colormap.to = GetSysColor(COLOR_3DFACE); m_logoBitmap.LoadMappedBitmap(IDB_BITMAP_3M_RFID,0,&colormap,1); m_logo.SetBitmap(m_logoBitmap); This loads and sets the bitmap just fine, however it displays the bitmap unaltered. The white background is still white, when I thought it should be the dialog color. Can anyone see what I am missing? "Ken" <Ken@discus...

Is there away to keep "auto save" from jumping to the first work sheet in the work book?
Auto save is truly a mixed blessing. Nice to be reminded but with it jumping to the first sheet in the work book sure can mess things up.. Marc I don't think so. Marc wrote: > > Auto save is truly a mixed blessing. Nice to be reminded but with it > jumping to the first sheet in the work book sure can mess things up.. > > Marc -- Dave Peterson You didn't mention what version of xl you're using so I can't attest to versions other than 2k, but; In 2k I deselect the "Prompt Before Saving" checkbox to allow it to do the save in the background an...

Microsoft works stopped working
when I try to open my works and a new document it says it has stopped working and will contact me if it finds a solution. I'm stuck ...

_CRTDBG_MAP_ALLOC wont work
hello, went thru the msdn help and some of the posting related to ths same question .. I have the following lines inserted on top of stdafx.h #define _CRTDBG_MAP_ALLOC #include <malloc.h> #include <stdlib.h> #include <crtdbg.h> i had to include both stdlib.h and malloc.h, else i get " error C2733: second C linkage of overloaded function '_calloc_dbg' not allowed" kind of errors for all the function related "CRTDBG_MAP_ALLOC" and "_DEBUG" are defined as well .. the final debug output looks like .. Detected memory leaks! Dumping objec...

UserForms
I've created a multipage userform using the design toolbox, linked th controlsources to a hidden spreadsheet and now I want to add a butto which will call the userform and enable the user to, well, use it. I haven't a clue how to do it though. I'm also having trouble with the buttons on the form, I want one whic will exit and not save changes, another which will gather the info an write it to a series of cells, and one which will do that and the clear the form ready for another entry. I can write the rest of th code, it's just linking the 'cancel', 'finish' an...

my VB6 app does not work in a foreign country
Dear all I have written a VB6 app that mainly copies or renames files of certain folders and subfolders. To rename the files I use Name sFilename As sNewfilename to copy the files I use the Win32API function Public Declare Function CopyFileEx Lib "Kernel32.dll" Alias "CopyFileExA" (ByVal lpExistingFileName As String, ByVal lpNewFileName As String, ByVal lpProgressRoutine As Long, lpData As Any, ByRef pbCancel As Long, ByVal dwCopyFlags As Long) As Long and call it like: ret = CopyFileEx(sFilenames, sNewfilename, AddressOf CopyProgressRoutine, ByVal 0&...

Not working...
Well this is what happened: I have 3 servers on my network. The main server [call it SERVER-1(MS ENTERPRISE SERVER 2003)] is what everyone connects to to get through to the internet and their public and private folders. SERVER-2 is the EXCHANGE SERVER (MS SBS 2003). SERVER-3 is just there for more storage space (MS SBS 2003). On the main server (SERVER-1) the message " One or more controllers do not meet the licensing requirements." keeps popping up and then what ever server name it has on the message turns off after showing another message saying "SERVER-2 will shut down in ...

New IE 9 will not work in Windows XP
The newest version of Microsoft's (Nasdaq: MSFT) Internet Explorer will feature full hardware acceleration and a new Javascript engine that engages multiple processor cores for faster rendering, the company has announced. The new version aso reverses the software giant's reluctance to adapt to HTML 5. The company released a developer preview of Internet Explorer 9 at the MIX10 developer conference in Las Vegas on Tuesday. Rough Draft The preview is not a fully functioning browser, lacking crucial tidbits such as an address bar, for instance. It's designed to give ...

Works Money 2002
I am having my desktop computer upgraded. I installed MSMoney 2002 on my laptop and used a backup file from USB 2.0 Flash Drive to copy it to my laptop. Everything seems to be working fine. Two questions if you will patient with me. I Have an icon on my desktop"MS Money Central MS.com\Money\2002\redir.asp", It's function?. In Program Files, MS Money there is a folder Titled, WORKS with some images. It's function?. The installation of money on my desktop was upgrades so this works folder did not exist, or the shortcut for the above mentioned icon. TIA Do you look t...

[vc++6] LoadMappedBitmap doesn't work
Hi Group! After a few tests I realized that LoadMappedBitmap function works only with 256 color bitmaps. So, I create such bitmap using external graphical application (with solid, white backgroud). I put it into resources and try this: COLORMAP sColorMap = {RGB(255, 255, 255), GetSysColor(COLOR_3DFACE)}; m_myBitmap.LoadMappedBitmap( IDB_BITMAP1, 0, &sColorMap, 1 ); But I do not get this what I wanted. My bitmap is rendered on a white background - not on a COLOR_3DFACE... But when I create a bitmap in VC (e.g. red circle on a white background) function works great. If you want to ...

thesuarus is not working, why
i have had this problem before and do not know why. The tool bar shows thesaurus but when you click it does not work, any answers Which language is applied to text? Have proofing tools been installed for that language? -- Stefan Blom Microsoft Word MVP "gnajar" wrote: > i have had this problem before and do not know why. The tool bar shows > thesaurus but when you click it does not work, any answers ...

how can I get a web link to work in a Publisher2000 table?
we do a 'line sheet' for our rep firm and want to include links so that when we email the sheet, in PDF, people can just click on the links to go to the sites. Like you can do in MS Word, with no problems. try putting the link in the pdf "D. Jay" <D. Jay@discussions.microsoft.com> wrote in message news:2C1DEF6B-99F1-4913-A97E-AFA170FA7C0F@microsoft.com... > we do a 'line sheet' for our rep firm and want to include links so that > when > we email the sheet, in PDF, people can just click on the links to go to > the > sites. Like you can d...

Add working days to date...
Hi all, I would like to be able to add a number of working days to a given date to determine the 'due-by' date. Any ideas how I might do this. The formulae would need to accommodate a list of public holidays in the way the NETWORKDAYS function does. Any hideas greatly appreciated. Cheers! jim Look at the WORKDAY() function in help. In article <8d4d01c3ea61$d14b5bd0$a301280a@phx.gbl>, "jim" <anonymous@discussions.microsoft.com> wrote: > Hi all, > I would like to be able to add a number of working days to > a given date to determine the 'due-by...

Would like cell data to be more editable and work with formula
The Microsoft Excel spreadsheet that I am using has three fields of data in each cell in column b. A sample cell looks like this: Year: 2008 Once you click it, you see more information: Year: 2008 Model: 1234 Quantity: 5 Each cell in cell B mentioned above, has to match up with a code in column a. For example, the cell above would match this value in column a: basic The way they have each cell in column B, you have to click on the cell to get all the data. It is difficult to get to the "quantity" amount (you can't use the arrow keys). Maybe the cell has been merged to get a...

Record counter doesn't work
I have an unbound form with a sql string in the Record Source like: Select Name_ID from tblName; Normally, when I do this, the record selector updates and shows the number of records in the table; but in this case it doesn't; I think it must be a switch I need to flip or something, but I can't seem to crack it. Any suggestions? Huh? If you have a Record Source your form is not unbound! -- There's ALWAYS more than one way to skin a cat! Answers/posts based on Access 2000 Message posted via AccessMonster.com http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/20...

Inventory Reconcile Not Working
We are using GP 10.0 and for some reason my inventory allocation keeps getting messed up. For example, I put in an order where the total quantity of the item was 2,000 but the system is allocating 62,174 units for that order. I ran the Inventory Reconcile utility several nights ago and it resolved this type of problem, but now the reconcile report is blank and the system is still allocating the wrong amount of inventory. I've tried just deleting the line item from the order but that doesn't work. They system is still allocating the 62,000 units anyway. The only way I can ma...

My Shortcuts do not work
When I click My shortcuts at teh leftside of teh screen, I get "unable to switch to the new category..." message. I cannot place a web site to it either. What should I do? I have a lot of ram and HD disk space available. Are these the shortcuts in the Outlook Bar? If yes, just right click on the ones that no longer work, select Delete this Shortcut. Then, pin open your folder list and drag and drop the folders for the shortcuts to the Outlook bar. Outlook will offer to create a shortcut in the Outlook Bar Group that you selected. --� Milly Staples [MVP - Outlook] Post al...