RIC elements

 

Sprite

 

Sprite elements will be used for defining a monochrome bitmap. The output to the NXT screen will be done later with the RIC element CopyBits. You can define up to 10 independent Sprites at the same time within a RIC file. If you use the same Sprite ID again, than you can’t access anymore to the first of them.

 

 

Parameter

Function

Range

Parameter

VarMap

Sprite ID

Define the ID of Sprite within the RIC file

1 - 10

   

 

 

Size of element:

12+ Byte (Speicherbedarf ist Abhängig von der Bitmapgröße)

   

Input modes:

For manipulation of Sprites you have three different input modes:

 

Draw

Mark

Stamp

 

 

Draw area:

The size of drawing area is up to 1024 x 512 pixels – greater than the area of 100 x 64 pixels which can be shown on the NXT display. As you can use the RIC element CopyBits for copy only a part (up to 100 x 64 pixels) of defined image, you also can use more than 100 x 64 pixels for your own images.

The program nxtRICeditV2 display the pixels in three different statuses:

Pixel is unsed

Pixel was defined as white

Pixel was defined as black

 

At the beginning all pixels are unused. The status will be changed when you draw or stamp on the image – than the pixels will be defined as black or white. Unused areas of pixels will not be stored inside the RIC element Sprite. But unused pixels will be changed to white pixels when you draw above the current used area. So the used area will automatically expand when it is necessary.

 

The used area will be marked with small triangles at the border of the drawing area inside the scale. And you can also find the size of used area in the bottom right area marked as “Image size”.

 

 

With this function you can minimize the used area when there are still some white pixels in the outer area. White pixels will be changed to unused pixels and the used area will be reduced for saving memory. But keep in mind that every time 8 horizontal pixels will be stored in one byte. This means that you have optical reduction without memory savings. But when you reduce from 9 to 8 pixels of horizontal used area then you can cut in half your memory usage for every line!

 

 

 

Display:

After expanding the usable image area up to 1024 x 512 pixels - more then the available size of the NXT screen – the program allows to scroll and zoom the image for better handling. So you can display every area of the drawing matrix and zoom in for detail manipulation. For scrolling of the image you can use the scroll bars on the bottom and right side of the drawing area. Zoom can be changed with the trackbar in the bottom right area. With button you can set the zoom to the original size of NXT screen (100 x 64 pixels).

 

 

Select color:

As you know you can define monochrome pictures. For selecting the colour you can use both mouse buttons within the draw mode:

 

Left mouse button

Draw with black colour

Right mouse button

Draw with white colour

I

In the following list of functions you can see in the right column which colour options will be available:

 

Select colour with left or right mouse button

Pixels will be set to white only

Insert images by using the stamp mode

   

Functions:

Here is a list of modifiaction functions which are available for manipulating the images of the Sprite element:

 

Icon

Funktion

Beschreibung

Farbe

Draw single pixels

As long as you press the mouse button the pixels will be inserted.

Draw a line

Start of line will be defined by pressing the mouse button. When you release the mouse button then the end of line will be fixed.

Draw rectangle

First edge will be set by pressing the mouse button. The opposite edge will be excepted when you release the mouse button.

Draw filled rectangle

First edge will be set by pressing the mouse button. The opposite edge will be excepted when you release the mouse button. The rectangle will be filled with same colour like the frame.

Draw ellipse

Pressing the mouse button define the first edge of the delimitated rectangle. When you release the mouse button than the opposite edge will be fixed. Within this delimitated rectangle the ellipse will be drawn.

Draw filled ellipse

Pressing the mouse button define the first edge of the delimitated rectangle. When you release the mouse button than the opposite edge will be fixed. Within this delimitated rectangle the ellipse will be drawn. The ellipse will be filled with the same colour like the frame.

Draw circle

The centre point of the circle will be defined by pressing the mouse button. Releasing the mouse button define the radius of the circle.

Draw filled circle

The centre point of the circle will be defined by pressing the mouse button. Releasing the mouse button define the radius of the circle. The circle will be filled with the same colour like the frame.

Insert text

When you click into the drawing area, a popup window will be displayed. There you can type in your text and set the format of the font. After accepting the input you can insert the text into your drawing image by clicking the mouse button.

Fill area with colour

Fill an area within your image with given colour. The area is limited by selected colour and already used area.

Import image from file

Open a window where you can select the file for import. Additionally you can define the size if image for insertion and also the threshold for black and white colour. Afterwards you can stamp the picture as often you want into the drawing area.

Mark a rectangle area

Define a rectangle area by pressing/releasing the mouse button. When a marked area was defined you can see some other buttons for manipulating the marked area.

 

Copy marked area to clipboard

Copy marked area to Clipboard for later usage.

 

Insert impage from clipboard

Take picture from clipboard and switch to stamp mode. You can stamp the green marked area as often you want to the drawing area.

Clean marked area

Set all pixels within the marked area to white.

Rotate marked area counterclockwise

Copy marked area to clipboard and rotate it counterclockwise by 90 degrees. Afterwards the program switch to stamp mode for inserting the image.

Rotate marked area clockwise

Copy marked area to clipboard and rotate it clockwise by 90 degrees. Afterwards the program switch to stamp mode for inserting the image.

Scroll marked area up

Scroll marked area up by 1 pixel. The upper pixel row will be copied to the bottom.

 

Scroll marked area right

Scroll marked area right by 1 pixel. The right pixel column will be copied to the left side.

 

Scroll marked area down

Scroll marked area down by 1 pixel. The bottom bixel row will be copied to the top.

 

Scroll marked area left

Scroll marked area left by 1 pixel. The left pixel column will be copied to the right side.

 

Invert marked area

Invert all pixels of the marked ara. Unused pixels will be changed to black and the used area will be expanded.

 

Mirror marked area horizontal

Mirror the marked area horizontal. Unused pixels will be handled as white pixels and the used area will be extended when it is necessary.

 

Mirror marked area vertical

Mirror the marked area vertical. Unused pixels will be handled as white pixels and the used area will be extended when it is necessary.

 

Undo last modification

Undo the last modifications of image which were done since selection of RIC element sprite. The undo buffer is organized as a ring buffer and can store up to 50 modifications.

 

   

Input of text:

Before you can insert text, a popup window will be displayed. Here you can define the text and also the attributes of the font which should be used. You also can see the preview of the text which will be inserted afterwards.

When you press OK, the input text will be displayed as red selection. With the left (black) or right (white) mouse button you can draw the text on the drawing area.

 

 

Import:

You will also get a popup window when you would like to import a graphic file. Here you have to select first the file and than you can define the size of the image for insert and also the threshold for black/white decision.

After confirming the import, the image will be copied to the clipboard and program change to the stamp mode for inserting the picture as often you want: