本文整理汇总了C#中System.Drawing.PointF.Multiply方法的典型用法代码示例。如果您正苦于以下问题:C# PointF.Multiply方法的具体用法?C# PointF.Multiply怎么用?C# PointF.Multiply使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.PointF
的用法示例。
在下文中一共展示了PointF.Multiply方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitParticle
private void InitParticle(Particle particle)
{
//position
particle.pos.X = (int)(CenterOfGravity.X + PosVar.X * Random11());
particle.pos.Y = (int)(CenterOfGravity.Y + PosVar.Y * Random11());
// direction
float a = (Angle + AngleVar * Random11()).ToRadians();
PointF v = new PointF((float)Math.Cos(a), (float)Math.Sin(a));
float s = Speed + SpeedVar * Random11();
v = v.Multiply(s);
particle.dir = v;
// radial accel
particle.radialAccel = RadialAccel + RadialAccelVar * Random11();
// tangential accel
particle.tangentialAccel = TangentialAccel + TangentialAccelVar * Random11();
// life
float life = Life + LifeVar * Random11();
particle.life = Math.Max(0, life);
// color
ColorF start = new ColorF();
start.R = StartColor.R + StartColorVar.R * Random11();
start.G = StartColor.G + StartColorVar.G * Random11();
start.B = StartColor.B + StartColorVar.B * Random11();
start.A = StartColor.A + StartColorVar.A * Random11();
ColorF end = new ColorF();
end.R = EndColor.R + EndColorVar.R * Random11();
end.G = EndColor.G + EndColorVar.G * Random11();
end.B = EndColor.B + EndColorVar.B * Random11();
end.A = EndColor.A + EndColorVar.A * Random11();
particle.color = start;
particle.deltaColor.R = (end.R - start.R) / particle.life;
particle.deltaColor.G = (end.G - start.G) / particle.life;
particle.deltaColor.B = (end.B - start.B) / particle.life;
particle.deltaColor.A = (end.A - start.A) / particle.life;
// size
float startS = StartSize + StartSizeVar * Random11();
startS = Math.Max(0, startS);
particle.size = startS;
if (EndSize == ParticleStartSizeEqualToEndSize) {
particle.deltaSize = 0;
} else {
float endS = EndSize + EndSizeVar * Random11();
particle.deltaSize = (endS - startS) / particle.life;
}
// angle
float startA = StartSpin + StartSpinVar * Random11();
float endA = EndSpin + EndSpinVar * Random11();
particle.angle = startA;
particle.deltaAngle = (endA - startA) / particle.life;
particle.startPos = this.Position;
}
示例2: Reflect
public static PointF Reflect(this PointF vec, PointF point, PointF n)
{
var negVec = vec.Negate();
return n.Multiply(2*negVec.DotProd(n)).Subtract(negVec);
}