Difference between revisions of "Ide/Creating new Project Items/Creating a Image"

From wiki.visual-prolog.com
Line 14: Line 14:
:With the '''Package''' selection the programmer can determine into directory of which package will be placed the image file.
:With the '''Package''' selection the programmer can determine into directory of which package will be placed the image file.


==== Image (Bitmap) Attributes Dialog ====
==== Image Attributes Dialog ====


After you press the '''OK''' button in the '''New Bitmap''' dialog, the '''Bitmap Attributes''' dialog appears. The similar dialogs appear in case if you will create a cursor or an icon.
After you press the '''OK''' button in the '''New Bitmap''' dialog, the '''Bitmap Attributes''' dialog appears. The similar dialogs appear in case if you will create a cursor or an icon.

Revision as of 14:05, 22 April 2013

Creating a New Image (Bitmap, Cursor or Icon)

To create and register a new image (a bitmap, an icon or a cursor) in a project you need to use the File | New menu item. In the opened New dialog you should select the Bitmap, the Icon or the Cursor type of creating item. Then the following dialog (in case if you have selected the Bitmap) appears:

Creating a new bitmap image

In this dialog you should specify the following items:

Name

In this dialog you should type in the Name which will be associated with this image in the code generated by default. This Name should be a correct Visual Prolog name. It should be any sequence of letters, digits, and underscores, beginning with a letter. This is the name of the creating image. It appears as the names of image files in the project tree in the Project window.

Package

With the Package selection the programmer can determine into directory of which package will be placed the image file.

Image Attributes Dialog

After you press the OK button in the New Bitmap dialog, the Bitmap Attributes dialog appears. The similar dialogs appear in case if you will create a cursor or an icon.

The Bitmap Attributes dialog while creation of a new bitmap

After clicking the OK button the new bitmap will be created and its name will be added to the existing bitmaps for the current project.

The similar (but little simpler) dialogs appear when you create a new Icon:

The Icon Attributes dialog while creation of a new icon

and a new Cursor:

The Cursor Attributes dialog while creation of a new cursor

In these dialogs you can change only the Constant attribute. The attributes Name and File are generated automatically and cannot be changed by the programmer.

Name

This is the Name which was specified for the image in the previous New dialog. It cannot be changed here.

File

Here you will see the name of file, with the path relative to the project root directory, in which the image will be stored. This filename is generated automatically by the IDE and cannot be changed.

Constant

The constant is used to identify the image in your program. An image identifier must be unique throughout the project.

You can either input it directly from the keyboard or allow the IDE to create a default value.

The default values for constants are:

Image Type Constant
Bitmap idb_bitmap_name
Icon idi_icon_name
Cursor idc_cursor_name

Constant must be either legal symbolic constant name (for example, idb_MyBitmap) or an integer. The IDE automatically places the symbolic identifier into the ResourceIdentifiers.i file and generates an integer value for it. The Graphics Editor automatically concatenates a sequence number if the project already has an image with the same name.

In case of Icons and Cursors this is the only attribute which can be edited in this dialog.

In case when you create a new bitmap, you can specify several additional attributes:

Width and Height

Defines the Width and Height of the bitmap in pixels. The maximal possible values are 64.
You may specify the size of the image for bitmaps only. The Graphics Editor allows you to create and edit bitmaps ranging in size from 4x4 pixels to 64x64 pixels.

The size of icons and cursors is always 32x32.

Colors

In this field you may specify using of either a 16-color palette or monochrome shadow palette for bitmaps and icons. Remember that for creating cursor images only 2 colors are available - the color black and transparent for background "color".