Appendix C. Image Editor

I mentioned in Chapter 3 that the 2.0 version of the NXT-G software comes with a tool that will allow you to create your own small images that can be displayed on the LCD screen. That tool is called Image Editor and it's extremely easy to use. I'm going to walk you through creating a custom image in this appendix.

Opening an Image

After opening up your NXT-G software (version 2.0), click on the Tools menu and select Image Editor from the drop-down list. Figure C-1 shows the Image Editor tool open.

The Image Editor tool allows you to create custom images for your programs.

Figure C-1. The Image Editor tool allows you to create custom images for your programs.

One of the best ways to learn how to use this tool is to open an existing image and make some changes. To do this, click the Open button in the upper-left corner of the tool. You'll see a new window open that displays a list of the current images stored on your computer's hard drive, as shown in Figure C-2.

Select an existing image to make changes to it.

Figure C-2. Select an existing image to make changes to it.

I selected Boom.ric but feel free to select any image you like. After you've clicked on a file, click the OK button. The image will open in the Image Editor tool, as shown in Figure C-3.

The selected image will be loaded into Image Editor.

Figure C-3. The selected image will be loaded into Image Editor.

Note

Keep in mind as you edit existing images or create your own that the size of the image that can be displayed on the NXT brick's LCD screen will be limited to what's visible on the Image Editor workspace here. If you wish the image to appear on the screen, it must fit on the grid workspace.

Modifying an Image

I'd now like to edit the word "Boom" inside the image and change it to something else. To do this, I'll use the tools that are available as buttons along the left side of the Image Editor tool. In Figure C-4, I've selected the Erase tool, and I simply hold down my mouse button and drag the mouse pointer over any pixels I wish to remove.

The Eraser tool allows you to remove pixels from an image.

Figure C-4. The Eraser tool allows you to remove pixels from an image.

Next, I select the Pencil tool. While I'm holding down the mouse button, any pixel I move the Pencil tool over will be filled in. I can go back and use the Erase tool to fix mistakes. Figure C-5 shows my new image, which I'll call "Zap."

The Pencil tool allows you to fill in pixels on the screen.

Figure C-5. The Pencil tool allows you to fill in pixels on the screen.

I can see the results of my editing in the Preview window in the upper-right corner of the tool. In addition to the Erase and Pencil tools, I have access to the Rectangle tool, which allows me to draw squares and rectangles, the Ellipse tool, which allows me to create circles and ellipses, and the Text tool, which can put text on the screen. There's a selection tool for circling a part of your image then moving that selected part around. Below the tool buttons are the Small, Medium, and Large buttons, which allow you to change the thickness of the edges when using the Rectangle or Ellipse tools. And finally, there's the Undo and Redo buttons at the bottom-left corner of the tool, which allow you to correct mistakes (click the Undo button) or add back in something you've removed like an erased bit of image) by clicking the Redo button.

Saving an Image

After you've created your new image (or modified an existing one), all you need to do is save your work. Click the Save button and give your new image a name, as shown in Figure C-6. If you're editing an existing image, don't overwrite the original—always remember to give your edits a new name. Figure C-6 shows I've saved this file as Zap.

Save your image by giving it a short but unique name.

Figure C-6. Save your image by giving it a short but unique name.

After saving your image, click the Close button to close the Image Editor tool.

Using Your Image

Now all that's left is to use your new image with a DISPLAY block. Drop a DISPLAY block into your program and scroll down the File list until you find the name of your new image. Figure C-7 shows that I've located the Zap image and selected it to be displayed on the LCD screen.

Use a DISPLAY block to put your new image on the brick's LCD screen.

Figure C-7. Use a DISPLAY block to put your new image on the brick's LCD screen.

And that's it! I have a new custom image that I can use in my NXT-G programs to display a large "Zap!" on the LCD screen.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset