Help - Image Objects
You can use SVG, EMF, PNG, JPG and GIF images in your Web Cartoon Maker movies. It is preferable to use SVG and EMF images, because both of them are vector formats and scaling such images does not influence on movie quality. Each image you use in movie should be an instance of class Image:
void Scene1 () { Image Back ( "backgrounds/beach.svg" ); Back.SetVisible (); }
File name in Image constructor can point to a file in online Web Cartoon Maker library (for example "backgrounds/beach.svg"), your local file (for example "c:\\myimage.jpg") or any online image (for example "http://www.mywebsite.com/myimage.png"). If image cannot be found or cannot be displayed because of unsupported format then no errors will be reported but no image will be displayed.
The default image is associated in constructor, but you can change the image associated with an object at any time using this function:
void Image::SetImage ( const string &sImage )
You can also retrieve the image currently associated with an image object
string Image::GetImage ()
You can also use all the IObject methods with images:
Help - Methods Derived from IObject
These methods can be used with any objects in your cartoons
void IObject::SetVisible ( int bVisible = true )
This method makes an object visible or invisible after the current moment in scene
void IObject::SetX ( double dX ) void IObject::SetY ( double dY ) void IObject::SetPos ( double dX, double dY )
These methods change an object position after the current moment in scene. If a position was explicitly set before, it will be changed smoothly causing your object to move
void IObject::SetAngle ( double dAngle )
This method sets an object angle after the current moment in scene. If it was explicitly set before, it will be changed smoothly causing your object to rotate
void IObject::SetXScale ( double dXScale ) void IObject::SetYScale ( double dYScale ) void IObject::SetScale ( double dScale )
These methods change an object size after the current moment in scene. If it was explicitly set before, it will be changed smoothly causing your object to increase or decrease in size. If parameter is greater than 1 an object will be bigger than original. If parameter is less than 1 an object will be smaller than original
void IObject::SetTransparency ( double dTransp )
This method changes an object transparency after the current moment in scene. Parameter between 0 and 1 is expected. 0 means that an object in not transparent at all. 1 means that and object is fully transparent and invisible. Any value between 0 and 1 makes and object semi-transparent. If this parameter was explicitly set before, it will be changed smoothly causing your object to appear or disappear
void IObject::SetMirror ( int bMirror )
This method can flip your object horizontally (when bMirror=true) and restore it back (when bMirror=false) after the current moment in scene.
int IObject::GetVisible ()
You can use this method to determine if an object is visible at a current moment in the scene. When it is visible true is returned. Otherwise false is returned
double IObject::GetX () double IObject::GetY ()
You can use these methods to determine an object coordinates at a current moment in the scene.
double IObject::GetAngle ()
You can use this method to determine an object angle at a current moment in the scene.
double IObject::GetXScale () double IObject::GetYScale ()
You can use these methods to determine an object scale factors at a current moment in the scene.
double IObject::GetTransparency ()
You can use this method to determine an object transparency at a current moment in the scene. The returned value is between 0 and 1. 0 means that an object in not transparent at all. 1 means that and object is fully transparent and invisible. Any value between 0 and 1 means that an object is semi-transparent
int IObject::GetMirror ()
You can use this method to determine if an object is flipped horizontally. When it is flipped true is returned. Otherwise false is returned
void IObject::ChangeX ( double dX, double dDuration )
void IObject::ChangeY ( double dY, double dDuration )
void IObject::ChangePos ( double dX, double dY, double dDuration )
void IObject::ChangeAngle ( double dAngle, double dDuration )
void IObject::ChangeXScale ( double dXScale, double dDuration )
void IObject::ChangeYScale ( double dYScale, double dDuration )
void IObject::ChangeScale ( double dScale, double dDuration )
void IObject::ChangeTransparency ( double dTransp, double dDuration )
These Change... methods are similar to their Set... analogs except they require duration parameter. They do following:
- Fix current value of a parameter (before changing it)
- Sleep for dDuration seconds
- Set a new parameter value
As a result of this you can easily change a parameter smoothly from its current value to a new value during dDuration numer of seconds. It is preferable to use these Change... functions instead of Set... in almost all cases unless you know what are you doing
You can also read the tutorial topic about using images in Web Cartoon Maker. |