-
Hi friends
Flash supports Both linear and radial gradient fill styles na?
I have filled a shape with Linear gradient
I want to rotate it by 45 degress.
Then how should i fill gradient matrix?
I am follwing the way, which i described below.
But it is not comming out properly.
only 0 and 180 degrees are working fine.
float fAngDeg = GetGradAng();
float fAngRad = (float) fAngDeg * 3.14159265/180.0;
//Center is a center point of shape.
float deltaX = Center.x * cos( fAngRad ) - Center.y * sin(fAngRad) + Center.x;
float deltaY = Center.x * sin( fAngRad ) + Center.y * cos(fAngRad) + Center.y;
if((fAngDeg != 0) && (fAngDeg != 360))
{
m_flashMat.nRotFlag= 0;
m_flashMat.fSkew0 = (float) sin(fAngRad);
m_flashMat.fSkew1 = (float) -sin(fAngRad);
m_flashMat.fScaleX = (float) cos(fAngRad)*nWidth;
m_flashMat.fScaleY = (float) cos(fAngRad)*nHeight;
m_flashMat.fTransX = (long) center.x; m_flashMat.fTransY = (long) center.y;
else
{
m_flashMat.nRotFlag= 0;
m_flashMat.fSkew0 = 0x00;
m_flashMat.fSkew1 = 0x00;
m_flashMat.fScaleX = (float) nWidth;
m_flashMat.fScaleY = (float) nHeight;
m_flashMat.fTransX = (long) center.x;
m_flashMat.fTransY = (long) center.y;
}
Can any one please help me out?
any help will be greatly appreciated
Lavanya
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|