Skip to content

Commit a0fdf62

Browse files
author
msebolt
committed
resource file consolidation pr24
1 parent 248e9c1 commit a0fdf62

4 files changed

Lines changed: 29 additions & 44 deletions

File tree

‎.openpublishing.redirection.json‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7585,6 +7585,11 @@
75857585
"redirect_url": "/cpp/windows/string-editor",
75867586
"redirect_document_id": false
75877587
},
7588+
{
7589+
"source_path": "docs/windows/new-toolbar-resource-dialog-box.md",
7590+
"redirect_url": "/cpp/windows/converting-bitmaps-to-toolbars",
7591+
"redirect_document_id": false
7592+
},
75887593
{
75897594
"source_path": "docs/windows/activationfactory-activationfactory-constructor.md",
75907595
"redirect_url": "/cpp/windows/activationfactory-class#activationfactory",

‎docs/windows/TOC.md‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,6 @@
138138
#### [Toolbar Editor](toolbar-editor.md)
139139
##### [Creating New Toolbars](creating-new-toolbars.md)
140140
##### [Converting Bitmaps to Toolbars](converting-bitmaps-to-toolbars.md)
141-
###### [New Toolbar Resource Dialog Box](new-toolbar-resource-dialog-box.md)
142141
##### [Creating, Moving, and Editing Toolbar Buttons](creating-moving-and-editing-toolbar-buttons.md)
143142
###### [Creating a New Toolbar Button](creating-a-new-toolbar-button.md)
144143
###### [Moving a Toolbar Button](moving-a-toolbar-button.md)
Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,48 @@
11
---
22
title: "Converting Bitmaps to Toolbars (C++)"
33
ms.date: "11/04/2016"
4-
helpviewer_keywords: ["bitmaps [C++], converting to toolbars", "Toolbar editor [C++], converting bitmaps", "toolbars [C++], converting bitmaps"]
4+
f1_keywords: ["vc.editors.newtoolbarresource"]
5+
helpviewer_keywords: ["bitmaps [C++], converting to toolbars", "Toolbar editor [C++], converting bitmaps", "toolbars [C++], converting bitmaps", "New Toolbar Resource dialog box [C++]"]
56
ms.assetid: 971c181b-40f5-44be-843d-677a7c235667
67
---
78
# Converting Bitmaps to Toolbars (C++)
89

9-
You can create a new toolbar in a C++ project by converting a bitmap. The graphic from the bitmap converts to the button images for a toolbar. Usually the bitmap contains several button images on a single bitmap, with one image for each button. Images can be any size; the default is 16 pixels wide and the height of the image. You can specify the size of the button images in the [New Toolbar Resource dialog box](../windows/new-toolbar-resource-dialog-box.md) when you choose **Toolbar Editor** from the **Image** menu while in the Image editor.
10+
You can create a new toolbar in a C++ project by converting a bitmap. The graphic from the bitmap converts to the button images for a toolbar. Usually the bitmap contains several button images on a single bitmap, with one image for each button. Images can be any size; the default is 16 pixels wide and the height of the image. You can specify the size of the button images in the **New Toolbar Resource** dialog box when you choose **Toolbar Editor** from the **Image** menu while in the Image editor.
1011

11-
### To convert bitmaps to a toolbar
12+
The **New Toolbar Resource** dialog box allows you to specify the width and height of the buttons you're adding to a toolbar resource in a C++ project. The default is 16 × 15 pixels.
1213

13-
1. Open an existing bitmap resource in the [Image editor](../windows/image-editor-for-icons.md). (If the bitmap is not already in your .rc file, right-click the .rc file, choose **Import** from the shortcut menu, navigate to the bitmap you want to add to your .rc file, then click **Open**.)
14+
A bitmap that is used to create a toolbar has a maximum width of 2048. So if you set the **Button Width** to 512, you can only have four buttons. If you set the width to 513, you can only have three buttons.
1415

15-
2. From the **Image** menu, choose **Toolbar Editor**.
16+
The dialog box has the following properties:
1617

17-
The [New Toolbar Resource dialog box](../windows/new-toolbar-resource-dialog-box.md) appears. You can change the width and height of the icon images to match the bitmap. The toolbar image is then displayed in the Toolbar editor.
18+
|Property|Description|
19+
|---|---|
20+
|**Button Width**|Provides a space for you to enter the width for the toolbar buttons you're converting from a bitmap resource to a toolbar resource. The images are cropped to the width and height specified, and the colors are adjusted to use standard toolbar colors (16 colors).|
21+
|**Button Height**|Provides a space for you to enter the height for the toolbar buttons you're converting from a bitmap resource to a toolbar resource. The images are cropped to the width and height specified, and the colors are adjusted to use standard toolbar colors (16 colors).|
1822

19-
3. To finish the conversion, change the command **ID** of the button using the [Properties window](/visualstudio/ide/reference/properties-window). Type the new **ID** or select an **ID** from the drop-down list.
23+
For information on adding resources to managed projects, see [Resources in Desktop Apps](/dotnet/framework/resources/index) in the *.NET Framework Developer's Guide*. For information on manually adding resource files to managed projects, accessing resources, displaying static resources, and assigning resource strings to properties, see [Creating Resource Files for Desktop Apps](/dotnet/framework/resources/creating-resource-files-for-desktop-apps). For information on globalization and localization of resources in managed apps, see [Globalizing and Localizing .NET Framework Applications](/dotnet/standard/globalization-localization/index).
24+
25+
## To convert bitmaps to a toolbar
26+
27+
1. Open an existing bitmap resource in the [Image editor](../windows/image-editor-for-icons.md). (If the bitmap isn't already in your .rc file, right-click the .rc file, choose **Import** from the shortcut menu, navigate to the bitmap you want to add to your .rc file, then select **Open**.)
28+
29+
1. From the **Image** menu, choose **Toolbar Editor**.
30+
31+
The **New Toolbar Resource** dialog box appears. You can change the width and height of the icon images to match the bitmap. The toolbar image is then displayed in the Toolbar editor.
32+
33+
1. To finish the conversion, change the command **ID** of the button using the [Properties window](/visualstudio/ide/reference/properties-window). Type the new **ID** or select an **ID** from the drop-down list.
2034

2135
> [!TIP]
22-
> The **Properties** window contains a pushpin button in the title bar. Clicking this button enables or disables **Auto Hide** for the window. To quickly cycle through all the toolbar button properties without having to reopen the individual property windows, turn **Auto Hide** off so the **Properties** window stays stationary.
36+
> The **Properties** window contains a pushpin button in the title bar. Selecting this button enables or disables **Auto Hide** for the window. To quickly cycle through all the toolbar button properties without having to reopen the individual property windows, turn **Auto Hide** off so the **Properties** window stays stationary.
2337
2438
You can also change the command IDs of the buttons on the new toolbar by using the [Properties window](/visualstudio/ide/reference/properties-window). For information on editing the new toolbar, see [Creating, Moving, and Editing Toolbar Buttons](../windows/creating-moving-and-editing-toolbar-buttons.md).
2539

26-
For information on adding resources to managed projects, please see [Resources in Desktop Apps](/dotnet/framework/resources/index) in the *.NET Framework Developer's Guide*. For information on manually adding resource files to managed projects, accessing resources, displaying static resources, and assigning resource strings to properties, see [Creating Resource Files for Desktop Apps](/dotnet/framework/resources/creating-resource-files-for-desktop-apps). For information on globalization and localization of resources in managed apps, see [Globalizing and Localizing .NET Framework Applications](/dotnet/standard/globalization-localization/index).
27-
2840
## Requirements
2941

3042
MFC or ATL
3143

3244
## See Also
3345

3446
[Creating New Toolbars](../windows/creating-new-toolbars.md)<br/>
35-
[Toolbar Editor](../windows/toolbar-editor.md)
47+
[Toolbar Editor](../windows/toolbar-editor.md)<br/>
48+
[Toolbar Button Properties](../windows/toolbar-button-properties.md)<br/>

‎docs/windows/new-toolbar-resource-dialog-box.md‎

Lines changed: 0 additions & 32 deletions
This file was deleted.

0 commit comments

Comments
 (0)