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

From wiki.visual-prolog.com
(New page: <noinclude>Category:Ide</noinclude> ---- ==== 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 ...)
 
m (Category)
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<noinclude>[[Category:Ide]]</noinclude>
<noinclude>[[Category:Ide/Create New Project Items]]</noinclude>
----
==  Creating a New Image (Bitmap, Cursor or Icon) ==
====  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:
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:
Line 15: 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.
Line 43: Line 42:
:<br />You can either input it directly from the keyboard or allow the IDE to create a default value.
:<br />You can either input it directly from the keyboard or allow the IDE to create a default value.


The default values for constants are:
:The default values for constants are:


{|{{prettytable}}
{|{{prettytable}} width="75%"
|-
|-
! Image Type
! Image Type
Line 60: Line 59:
|}
|}


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.
: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 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:
In case when you create a new bitmap, you can specify several additional attributes:
Line 71: Line 70:
: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.
: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.
:The size of icons and cursors is always 32x32.


'''Colors'''
'''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".
: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".
==== Editing Image Attributes ====
You can always wake up (with the '''Resource | Attribute''' task menu item or with the '''Attribute''' item from pop up menu) the '''Bitmap/Cursor/Icon Attributes''' dialog for the created bitmap, cursor or icon to view and change some image attributes.
Notice that the appeared '''Bitmap Attributes''' dialog for an existing bitmap will display less bitmap attributes then it has for created bitmaps:
[[Image:Ide_GE_ExistingBitmapAttributes.png|center|frame|'''The Bitmap Attributes dialog for an existing bitmap''']]
You see that for existing bitmap the dialog does not contain the '''Width''', '''Height''', and '''Color''' attributes.
The only image attribute that you can edit is the '''Constant'''.:
'''Constant'''
:In the '''Constant''' list edit the programmer can change the default resource constant for the image (at the picture it is '''''idb_mybitmap''''').

Latest revision as of 15:17, 13 June 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".