Any guidelines on bitmap size for a header of a property page ?

Hi,

Would anyone know how to come up with an optimum size for a bitmap to be 
placed on a property page (CPropertyPage) header?  I can't figure it out and 
can't find anything in the docs.  For example, in may case if I create a 
bitmap that is 70x50 pixels then I could see only ~1/2 of it.  On the other 
hand, if I shrink it to 70x49 I could see the whole thing.  There seems to 
be no scaling - just cropping in the first case (which is what docs 
suggest).  The background color for the remaining part of the header is 
picked up correctly in both cases.
I just can't figure out why I get such weird results in the first case.
I'd appreciate if someone could explain this or point me to some docs.

Thanks,
Bogdan


0
bogdan2033 (22)
9/17/2007 7:26:33 PM
vc.mfc 33608 articles. 0 followers. Follow

5 Replies
437 Views

Similar Articles

[PageSpeed] 29

I would be inclined to do something small-icon-sized (e.g., 16x16). But I'm not sure why
you are seeing the behavior you describe.
					joe
On Mon, 17 Sep 2007 15:26:33 -0400, "bogdan" <bogdan@nospam.com> wrote:

>Hi,
>
>Would anyone know how to come up with an optimum size for a bitmap to be 
>placed on a property page (CPropertyPage) header?  I can't figure it out and 
>can't find anything in the docs.  For example, in may case if I create a 
>bitmap that is 70x50 pixels then I could see only ~1/2 of it.  On the other 
>hand, if I shrink it to 70x49 I could see the whole thing.  There seems to 
>be no scaling - just cropping in the first case (which is what docs 
>suggest).  The background color for the remaining part of the header is 
>picked up correctly in both cases.
>I just can't figure out why I get such weird results in the first case.
>I'd appreciate if someone could explain this or point me to some docs.
>
>Thanks,
>Bogdan
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
9/17/2007 8:49:31 PM
How are you creating the bitmap?
Are you are creating a bitmap in a DC?
Are you loading it from a file?
Are you STORING a bitmap?

Anyway if you have MSDN that comes with VS 2003 please take a look at:

ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/gdi/bitmaps_0c1f.htm
(Windows GDI - Using Bitmaps)

"bogdan" wrote:

> Hi,
> 
> Would anyone know how to come up with an optimum size for a bitmap to be 
> placed on a property page (CPropertyPage) header?  I can't figure it out and 
> can't find anything in the docs.  For example, in may case if I create a 
> bitmap that is 70x50 pixels then I could see only ~1/2 of it.  On the other 
> hand, if I shrink it to 70x49 I could see the whole thing.  There seems to 
> be no scaling - just cropping in the first case (which is what docs 
> suggest).  The background color for the remaining part of the header is 
> picked up correctly in both cases.
> I just can't figure out why I get such weird results in the first case.
> I'd appreciate if someone could explain this or point me to some docs.
> 
> Thanks,
> Bogdan
> 
> 
> 
0
gdrivas (16)
9/18/2007 8:46:04 AM
I use a 24-bit bitmap. The bitmap is created outside of IDE but it is 
included in the exe as a resource.  I load it as follows:

HBITMAP hbmp = static_cast<HBITMAP>(LoadImage(AfxGetInstanceHandle(), 
MAKEINTRESOURCE(IDB_HEADER), IMAGE_BITMAP, 0, 0, 0))).

I then pass hbmp to the CPropertySheet constructor.

Please note that the bitmap is displayed properly as long as it's height is 
49 pixels (I have not tried smaller sizes but I'm assuming that they would 
also work).  When I provide a bitmap of 50 pixels in height the property 
sheet crops it on the right side (approx. half of it) and also few pixels at 
the bottom.  This is a bit strange because I'd expect it to be cropped at 
the bottom only.
This is why some 'official' guidelines would be very helpful.  The only info 
about property page header bitmaps that I have found so far (e.g. 
http://msdn2.microsoft.com/en-us/library/ms652417.aspx, 
http://msdn2.microsoft.com/en-us/library/ms738248.aspx) does not deal with 
header bitmap dimensions.

Thanks,
Bogdan

"gdrivas" <gdrivas@discussions.microsoft.com> wrote in message 
news:3E269825-056F-4CD8-9D9A-0658454F1BD4@microsoft.com...
> How are you creating the bitmap?
> Are you are creating a bitmap in a DC?
> Are you loading it from a file?
> Are you STORING a bitmap?
>
> Anyway if you have MSDN that comes with VS 2003 please take a look at:
>
> ms-help://MS.VSCC.2003/MS.MSDNQTR.2003FEB.1033/gdi/bitmaps_0c1f.htm
> (Windows GDI - Using Bitmaps)
>
> "bogdan" wrote:
>
>> Hi,
>>
>> Would anyone know how to come up with an optimum size for a bitmap to be
>> placed on a property page (CPropertyPage) header?  I can't figure it out 
>> and
>> can't find anything in the docs.  For example, in may case if I create a
>> bitmap that is 70x50 pixels then I could see only ~1/2 of it.  On the 
>> other
>> hand, if I shrink it to 70x49 I could see the whole thing.  There seems 
>> to
>> be no scaling - just cropping in the first case (which is what docs
>> suggest).  The background color for the remaining part of the header is
>> picked up correctly in both cases.
>> I just can't figure out why I get such weird results in the first case.
>> I'd appreciate if someone could explain this or point me to some docs.
>>
>> Thanks,
>> Bogdan
>>
>>
>> 


0
bogdan2033 (22)
9/18/2007 3:57:36 PM
Note that IDE is very pernickety with resources. I assume that you import 
this bitmap into the project's resources by Add Resource->Import...
Then, since you have the HBITMAP you are drawing it with BitBlt, Correct?
 Try the following:
- Use CBitmap class (and LoadBitmap member).
- And create a new bitmap resource from within the resource editor.

Also please tell me how exactly you are drawing the resource.
Thank you.

"bogdan" wrote:

> I use a 24-bit bitmap. The bitmap is created outside of IDE but it is 
> included in the exe as a resource.  I load it as follows:
> 
> HBITMAP hbmp = static_cast<HBITMAP>(LoadImage(AfxGetInstanceHandle(), 
> MAKEINTRESOURCE(IDB_HEADER), IMAGE_BITMAP, 0, 0, 0))).
> 
> I then pass hbmp to the CPropertySheet constructor.
> 
> Please note that the bitmap is displayed properly as long as it's height is 
> 49 pixels (I have not tried smaller sizes but I'm assuming that they would 
> also work).  When I provide a bitmap of 50 pixels in height the property 
> sheet crops it on the right side (approx. half of it) and also few pixels at 
> the bottom.  This is a bit strange because I'd expect it to be cropped at 
> the bottom only.
> This is why some 'official' guidelines would be very helpful.  The only info 
> about property page header bitmaps that I have found so far (e.g. 
> http://msdn2.microsoft.com/en-us/library/ms652417.aspx, 
> http://msdn2.microsoft.com/en-us/library/ms738248.aspx) does not deal with 
> header bitmap dimensions.
> 
> Thanks,
> Bogdan
> 

0
gdrivas (16)
9/18/2007 7:34:02 PM
I'm not drawing the bitmap myself.  If I did I would not have this problem 
because I'd have full control over the rendering of it.  I'm trying to make 
a property sheet (CPropertySheet) to display a bitmap in the header section 
of its pages (CPropertyPage).  The property sheet is run in a wizard mode.

Thanks,
Bogdan

"gdrivas" <gdrivas@discussions.microsoft.com> wrote in message 
news:32079D45-E479-4C6F-9DE4-D23486D50370@microsoft.com...
> Note that IDE is very pernickety with resources. I assume that you import
> this bitmap into the project's resources by Add Resource->Import...
> Then, since you have the HBITMAP you are drawing it with BitBlt, Correct?
> Try the following:
> - Use CBitmap class (and LoadBitmap member).
> - And create a new bitmap resource from within the resource editor.
>
> Also please tell me how exactly you are drawing the resource.
> Thank you.
>
> "bogdan" wrote:
>
>> I use a 24-bit bitmap. The bitmap is created outside of IDE but it is
>> included in the exe as a resource.  I load it as follows:
>>
>> HBITMAP hbmp = static_cast<HBITMAP>(LoadImage(AfxGetInstanceHandle(),
>> MAKEINTRESOURCE(IDB_HEADER), IMAGE_BITMAP, 0, 0, 0))).
>>
>> I then pass hbmp to the CPropertySheet constructor.
>>
>> Please note that the bitmap is displayed properly as long as it's height 
>> is
>> 49 pixels (I have not tried smaller sizes but I'm assuming that they 
>> would
>> also work).  When I provide a bitmap of 50 pixels in height the property
>> sheet crops it on the right side (approx. half of it) and also few pixels 
>> at
>> the bottom.  This is a bit strange because I'd expect it to be cropped at
>> the bottom only.
>> This is why some 'official' guidelines would be very helpful.  The only 
>> info
>> about property page header bitmaps that I have found so far (e.g.
>> http://msdn2.microsoft.com/en-us/library/ms652417.aspx,
>> http://msdn2.microsoft.com/en-us/library/ms738248.aspx) does not deal 
>> with
>> header bitmap dimensions.
>>
>> Thanks,
>> Bogdan
>>
> 


0
bogdan2033 (22)
9/19/2007 12:59:28 AM
Reply:

Similar Artilces:

Visio 2007
The themes in Visio 2007 only allow for the setting of the theme font, NOT the font size or style (bold, italic, etc.). So the question is, when I start a Visio diagram how can I ensure that the starting font size is 12 and not 8 pt, bold and not regular. It appears that there is no way to do this, other than perhaps changing registry values. BTW: I use Visio on both XP and Vista. Peregrine Go to the menu bar > Format > Define Styles. The menu allows you to define a custom style which includes font face, size, etc. HTH Wapperdude "Peregrine Maitland" wrote: > T...

Master/content pages: prob with passing a control to JS
Hi, my code: .... <script type="text/javascript"> var myfilter = myJSfunction(document.myform.ListBox1); </script> </form> When compiling the web page, because of the master/content, the Listbox1 control gets a different name/id apparantly. So how can I pass my listbox on as an argument of my JS procedure? thx for helping, J "Jokke" <Jokke007007@hotmail.com> wrote in message news:7839C9C3-037F-4550-B5BC-E6BA75D93A99@microsoft.com... > When compiling the web page, because of the master/content, the L...

Bitmaps in a listbox?
I'm not quite sure how to explain what i want but here goes. I measure up kitchens for a living and whilst doing so i confirm with my clients, the cupboard door styles and accessories they will have in their kitchen. I use my lap top to enter in to a spreadsheet all the requirements and measurements. I have a check measure spreadsheet with lots of list boxes and check boxes. What I want to do is to click on a button and have a bunch of thumbnails of doors styles and colours. I would then click on one of the thumbnails and it would place it in my spreadsheet. Is this possible?....Hope so...

Viewing / Printing more than two pages at once
I'm working on a publication, and I'd like to get a proper overview of it (balance of pictures etc) However, I can only view two pages at a time. Is it possible to view lots of little pages - say 8-10 at a time? Like you can in Powerpoint. If not, can I print lots of pages on one sheet? In the Print setup I can only get two pages at a time. Only in print preview. On the toolbar there is an icon that you can select to show you multiple pages. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "KMcA" <KMcA@discus...

Changing font size in data validation drop-down lists
In Excel 2003, I created the value list on a separate worksheet and labled the range so I could use it in the data validation wizard on a different worksheet. The list is working fine; however, the font size in the drop-down list is too small to comfortably read. So far, I have tried: Making the font in the list larger. Formatting larger font size in the active cell with the drop-down button And, creating the list on the same worksheet. All three remedies have not increased the size of the font in the drop-down list. Suggestions are welcome. Great Optimism, Dutch Driver There is n...

Can there be variable size columns in one report?
I want to create a report that has 3 sub-reports of different column widths. Is this possible? -The 1st sub-report has 1 column that occupies the entire width of the page -The 2nd sub-report can fit 2 columns in the page width -The 3rd sub-report can fit 3 columns in the page width Subreports can have any number of columns that don't have to be the same from one to another. Typically your columns should display across then down in order to render properly as a subreport. -- Duane Hookom Microsoft Access MVP "SheldonHinds" wrote: > I want to create a r...

Keeping Custom Properties When Forwarding or Replying to a Message #2
We have emails saved on the file system, that is kept track of by another program. These emails have custom properties attached to them. There is no custom form, just custom properties. These fields were originally added using objPost.UserProperties.Add. We need it so that when someone opens up one of these emails through the file system, and then replies or fowards the message, these custom properties are kept in the reply. This is so the external program can track these emails. Is there a way this can be done? We could have these emails opened up using an Outlook command line that i...

page number
How do I remove page number from single pages, not only frontpage You can either insert a section break either side the un-numbered page and change the numbering in the new section or you can conditionally insert the page number in all the pages using fields e.g. {IF {Page} <> 4 "{Page}"} will insert the page number on all pages except page 4. -- <>>< ><<> ><<> <>>< ><<> <>>< <>><<> Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mv...

Changing size and placement of maximized dialog
Hi, I want to have maximized window not on all screen. how to change maximized size and placement of dialog ? I red doc for SetWindowPlacement(&wPlac) and I have tried in OnInitDialog(): wPLac.length = sizeof(WINDOWPLACEMENT); GetWindowPlacement(&wPlac); wPlac.ptMaxPosition.x = 200; wPlac.ptMaxPosition.y = 200; SetWindowPlacement(&wPlac) But after dialog is maximized it is on all screen. What is wrong ? Peter "Peter": > I want to have maximized window not on all screen. > how to change maximized size and placement of dialog ? > I red doc for SetWindowPlaceme...

How do you define a custom paper size in Excel? (i.e. 11x17)
How do you define a custom paper size in Excel? (i.e. 11x17) Hello- Excel doesn't provide for custom paper sizes, but most any size appropriate for Excel output is already provided _if_ the installed print driver supports it. Go to File>Page SetUp--Page and open the list of sizes. If your installed driver supports 11x17 it will be in the list (although it may be listed as 'Ledger' rather than by dimensions). HTH |:>) "Marcin Rembisz" wrote: > How do you define a custom paper size in Excel? (i.e. 11x17) ...

Named Properties Error (Event ID: 9667)
Having problems with good old Event 9667. Thats the problem where Exchange 2003 stop accepting some emails when it hits the 16k soft limit on Named Properties. I've seen the KB article regarding adjusting the size of the named properties cache (if i can call it a cache) up to 32k but, as others have pointed out, that just delays the problem. I would like to know if anyone knows of any good ways to filter headers such that they are reduced to just the standard headers necessary for email delivery? Thanks, K ...

windows should reopen in their previously opened size and position
We use large monitors and some dual-monitor setups. Most of the dialogue windows open up designed for a small resolution setting. For example, the "cards/Accounts" window opens up and only shows 10 accounts in the collapsed view. Almost every time I use that window I have to resize and reposition it, and then as soon as it closes and reopens, it is back to the puny size again. There should be an option to "remember" window sizes and positions. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. T...

collating multiple page catalog
I recently got a HP business inkjet 1100d-previously had HP 932. Multiple page catalog in Pub 2002. Was able to print multiple copies & collate with 932. Now Pub will not collate. Word will collate. I tried the old 932 with the catalog after installing the 1100 & it will no longer collate. HP says it probably is a software problem since it works with Word. HELP & thanks ...

Extra pages in form printing
I have a form that exceeds a single printed page. When it is printed extra pages are produced. The extra pages occur after the first printed page but before the rest of the page of the form is printed and another extra page after the rest of the page is printed. The extra pages contain the same background used in the form. In design view I've made sure to shorten up the background to be even with the footer but it doesn't seem to help. Any suggestion on how to get rid of the extra pages in my printout? Thanks. -- Linda I still do not understand why people print forms. For...

Pasting picture files to Excel
Whenever I paste ia jpg picture nto Excel (or Word for that matter), I get only 3 choices (bitmap, metafile (bigger than bitmap), and photoediting (bigger than both)) . My question is, is there anyway to paste in a picture to an Excel file, but keeping it compressed as a jpeg file, this way the excel file size doesn't grow by leaps and bounds? Thanks. Matt: Since Excel has the ability of editing a picture, the software has to limit its pictures to those formats that MS has editing tools to work with. That's why you can't easily set up JPG or GIF pictures as embedde...

Excel: Allow to turn on / off automatic header selection in sorts
Is there a way to turn off automatic selection of header rows in Excel when sorting data? I routinely sort a section of data by the first three columns, and a majority of times Excel wants to make the first row selected a header row. Extremely annoying. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "...

I'm looking for a cookbook page format
Final copy will be bound in 6 x 9 inch format (book size). Thanks :) 2 recipes per page I'm thinking. ...

Bad break field in an additional Header or Footer. Recheck.
Friends, I am trying to add a third party field in a report, with the steps provided in Integration Guide. But I got the following error. “Bad break field in an additional Header or Footer. Recheck.” This error comes in spite of removing third party field from the layout. If anyone can help regarding this, let me know. Look at the Additional Headers and Footers. If you have changed the index used or changed the additional sort, you might have an additional header or footer which is trying to break on a field no longer in the index or sort. David Musgrave [MSFT] Senior Development C...

shrink excel page to print out standard size
I would like to print out an excel page on to a standard sheet of paper. Can not figure it out. In Page Setup>Page look at "Fit to" 1 by 1 Depending upon the size of the printrange the printout may not be readable. Gord Dibben MS Excel MVP On Tue, 11 May 2010 15:50:03 -0700, clara <clara@discussions.microsoft.com> wrote: >I would like to print out an excel page on to a standard sheet of paper. Can >not figure it out. ...

It auto changes font size on e-mail entries, WHY?
We have a document set up in Excel (version 2000) and when I type in a e-mail address in the contact info area of the document, it automatically decreases the font to a 6 instead of a 16 like the rest of the page. I have tried formatting this cell, and simply saving it as that size on the blank document, but nothing is working. Please help. You can change the format for the Hyperlink style. Format|Style|Style Name: Hyperlink and click modify to change it to what you want. Styles live in the workbook. So changing the hyperlink style in this workbook won't affect any other workboo...

Email 3 page newsletter
Trying to email a 3 page newsletter all at once using the send email feature. Publisher only allows 1 page at a time. There has got to be a way to send more than 1 page without having it as an attachment -- bob07 Create the newsletter as one long page. -- Don Vancouver, USA "bob07" <bob07@discussions.microsoft.com> wrote in message news:7B94C8DF-1612-4B04-95F7-C6722E4324D8@microsoft.com... > Trying to email a 3 page newsletter all at once using the send email > feature. > Publisher only allows 1 page at a time. There has got to be a way to send > more tha...

File Size Increases won't print to network printer
I have a user who is trying to print a one page document - size is 172kb. She is using publisher 2003. It will print fine to her deskjet - but of course very slow. And we are able to print in to a network black and white printer. Problem is when she prints to the color network printer, a HP4550, the spooling increases the file size to over 900+ mg. and never prints. I've tried this on two different network printers. Same results. I was able to have her send this to a user using publisher XP and she was able to print it to the same network color printer, without any problems. Any...

Footer on last page
I want a footer to appear only on the last page of a form. How do I accomplish this? The form could have from 1 to 5 pages. Hi Line You can do it with a macro Try this to print the activesheet Sub Test() Dim TotPages As Long TotPages = Application.ExecuteExcel4Macro("GET.DOCUMENT(50)") With ActiveSheet.PageSetup .RightHeader = "" ActiveSheet.PrintOut From:=1, To:=TotPages - 1 .RightHeader = "Your Header info" ActiveSheet.PrintOut From:=TotPages, To:=TotPages End With End Sub -- Regards Ron de Bruin http://www.rond...

Print Preview different from Page Break View
Hi all, i have a excel form which i can see all the contents when it's in the normal page break view but when i preview the form, the right part of the form cannot be seen. The printout is the same as the print preview. Why is there a discrepanices between the page break view and the print preview? I ve checked, both the page setup for the excel file and printer setttings are the same. Is this a bug in Excel 2000? How can i make the print preview the same as normal page break view? Thanks in advance. ...

Option to print worksheets in the same page
There should have a print option to allow printing more than one worksheet in the same page, sharing the same piece of paper for all worksheets and saving paper... Thanks. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/office/community/en-us...