www.pudn.com > C++_Flash.rar > SWFShape.h
// SWFShape.h: interface for the CSWFShape class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(SWFSHAPE_H)
#define SWFSHAPE_H
#include "Definitions.h"
#include "SWFObject.h"
#include "SWFRectangle.h"
#include "SWFMatrix.h"
class CSWFShape : public CSWFObject
{
public:
CSWFShape(USHORT nID, RECT_F rectangle, USHORT depth);
virtual ~CSWFShape();
public:
// Style methods
void AddLineStyle(int lineWidth, SWF_RGBA lineColor);
void AddSolidFillStyle(SWF_RGBA fillColor);
void AddGradientFillStyle(UCHAR gradientFillType, RECT_F gradientRect, SWF_GRADIENTRECORD* gradientRecords, int numRecords);
void AddBitmapFillStyle(USHORT bitmapID, UCHAR bitmapFillType, RECT_F bitmapRect, RECT_F clipRect);
void ChangeStyle(int lineStyleIndex, int fillStyleIndex0, int fillStyleIndex1, POINT_F* newPosition);
// Drawing methods
void AddLineSegment(POINT_F offsetPoint);
void AddLineSegment(float xOffset, float yOffset);
void AddCurveSegment(POINT_F controlPoint, POINT_F anchorPoint);
void AddCurveSegment(float controlPointX, float controlPointY, float anchorPointX, float anchorPointY);
// Transformation methods
void Scale(float scaleX, float scaleY);
void Rotate(float angle);
void Translate(float translateX, float translateY);
void Shear(float shearX, float shearY);
// Special methods
UCHAR* BuildSWFStream();
int GetSWFStreamLength();
private:
// Private methods
UCHAR* BuildRecordArraySWFStream(int numLineIndexBits, int numFillIndexBits, int& streamLength);
private:
// Private members
SWF_DEFINE_SHAPE_TAG m_Shape;
int m_NumberShapes;
UCHAR* m_SWFStream;
int m_SWFStreamLength;
public:
// Public members
CSWFMatrix m_TransformationMatrix;
CSWFRectangle m_ShapeRectangle;
};
#endif // !defined(SWFSHAPE_H)