Tutorial - Image Objects
You already know that it is possible to use image objects in your cartoons. These could be images from our online library, images from the web or images from your hard drive. Here is an example of each image type declaration:
void Scene1 ()
{
// Declare an image from your hard drive.
// Please make sure the image actually exist
// Please specify full path to another image if it does not exist
Image MyBackgroundImage ( "c:\\windows\\web\\wallpaper\\autumn.jpg" );
// Declare an image from our online library
Image MyCarImage ( "vehicles/sedan.svg" );
// Declare an image using full web URL
Image MyLogoImage ( "http://www.webcartoonmaker.com/wcm_logo_icon.png" );
// Lets make these images to appear at correct places
MyBackgroundImage.SetPos ( 0, 0 );
MyBackgroundImage.SetVisible ();
MyCarImage.SetPos ( 0, 150 );
MyCarImage.SetVisible ();
MyLogoImage.SetPos ( 350, -250 );
MyLogoImage.SetVisible ();
}
Images do not have any specific methods to work with them. But you can use methods common for all kinds of objects to move, rotate, scale them and do other operations. We are going to make the car to disappear in this tutorial:
- Copy and paste the following script to Web Cartoon Maker
void Scene1 ()
{
// Declare an image from your hard drive.
// Please make sure the image actually exist
// Please specify full path to another image if it does not exist
Image MyBackgroundImage ( "c:\\windows\\web\\wallpaper\\autumn.jpg" );
// Declare an image from our online library
Image MyCarImage ( "vehicles/sedan.svg" );
// Declare an image using full web URL
Image MyLogoImage ( "http://www.webcartoonmaker.com/wcm_logo_icon.png" );
// Lets make these images to appear at correct places
MyBackgroundImage.SetPos ( 0, 0 );
MyBackgroundImage.SetVisible ();
MyCarImage.SetPos ( 0, 150 );
MyCarImage.SetVisible ();
MyLogoImage.SetPos ( 350, -250 );
MyLogoImage.SetVisible ();
// Make the car to disappear
MyCarImage.ChangeTransparency ( 1, 3 );
}
- Compile it, and preview in WCM Player
|