[ SM3117 ] - [ Class 08 ] - Imaging

Class 08 - Director workshop - Imaging concept

 

1

What is an image?

An object in Director, with pre-defined properties and methods.

 

2

How to create an image?

 

3

The image command

myImage = image(320,240,32);

 

4

From a cast member

myImage = member("love").image;

 

5

From the stage

myImage = _movie.stage.image;

 

6

Duplicate another copy of the image

  • myImage = member("bryan").image.duplicate();
  • myImage = _movie.stage.image.duplicate();

 

7

Properties of an image

  • myImage.width
  • myImage.height
  • myImage.depth
  • myImage.rect

 

8

Copy from one image to another

image2.copyPixels(image1, rect2, rect1);

 

9

Obtain pixel details

  • myPoint = point(100,200);
  • myColour = myImage.getPixel(myPoint1);

myColour will contain either the RGB value or a colour palette index.