Exemplo n.º 1
0
        private void CreateParticles(int x, int y)
        {
            t_particles = new Effects.Particles.Obsolete.PixelParticle_O[t_count];

            for (int i = 0; i < t_particles.Length; i++)
            {
                Engine.Color.Cell cVar;

                if (t_useColorFromImage)
                {
                    cVar       = t_imageSource.GetPixel(x, y, PixelRetrievalOptions.ReturnEdgePixel);
                    cVar.Alpha = t_alpha;
                }
                else
                {
                    t_colorVariance.Step();

                    // currently colorVariance is off
                    cVar       = new Color.Cell(t_colorVariance.Blue, t_colorVariance.Green, t_colorVariance.Red, t_colorVariance.Alpha);
                    cVar.Alpha = t_alpha;
                }

                t_particles[i] = new Effects.Particles.Obsolete.PixelParticle_O(cVar,
                                                                                x + Engine.Calc.Math.NextFloatRandomInRange((float)t_scatter),
                                                                                y + Engine.Calc.Math.NextFloatRandomInRange((float)t_scatter));
            }
        }
Exemplo n.º 2
0
 private static void thread_CopyFromImage(Engine.Surface.Canvas source, Engine.Surface.Canvas dest, int originX, int originY, int destX, int destY, int width, int height)
 {
     for (int y = destY; y < height; y++)
     {
         int offset         = source.GetOffset(originX, originY + y);
         int offsetNewImage = dest.GetOffset(destX, y);
         for (int x = destX; x < width; x++)
         {
             Engine.Color.Cell c = new Color.Cell(source.Array, offset);
             c.WriteBytes(dest.Array, offsetNewImage);
             offset         += Engine.BytesPerPixel.BGRA;
             offsetNewImage += Engine.BytesPerPixel.BGRA;
         }
     }
 }