Example #1
0
 private void init(int width, int height, bool alpha)
 {
     this.width       = width;
     this.height      = height;
     this.hasAlpha    = alpha;
     this.buffer      = LImage.CreateImage(width, height, alpha);
     this.pixels      = buffer.GetPixels();
     this.finalPixels = (Color[])CollectionUtils.CopyOf(pixels);
 }
Example #2
0
 private void init(int width, int height, bool alpha)
 {
     this.width = width;
     this.height = height;
     this.hasAlpha = alpha;
     this.buffer = LImage.CreateImage(width, height, alpha);
     this.pixels = buffer.GetPixels();
     this.finalPixels = (Color[])CollectionUtils.CopyOf(pixels);
 }
Example #3
0
 public PShadowEffect(LImage img, LImage back, int x, int y, int w, int h)
 {
     if (deasilTrans == null || widdershinTrans == null)
     {
         deasilTrans = new Color[max_pixel];
         for (int i = 0; i < max_pixel; i++)
         {
             deasilTrans[i] = new Color(i, i, i);
         }
         int count = 0;
         widdershinTrans = new Color[max_pixel];
         for (int i = 0; i < max_pixel; i++)
         {
             widdershinTrans[count++] = deasilTrans[i];
         }
     }
     this.SetLocation(x, y);
     this.width = w;
     this.height = h;
     this.visible = true;
     LImage temp = null;
     if (back == null)
     {
         this.scaleWidth = width / 2;
         this.scaleHeight = height / 2;
         temp = GraphicsUtils.GetResize(img, scaleWidth, scaleHeight);
         this.image = LImage.CreateImage(scaleWidth, scaleHeight, true);
         this.finalDrawPixels = temp.GetPixels();
         this.nowDrawPixels = (Color[])CollectionUtils.CopyOf(finalDrawPixels);
         if (temp != null)
         {
             temp.Dispose();
             temp = null;
         }
     }
     else
     {
         this.scaleWidth = width / 2;
         this.scaleHeight = height / 2;
         temp = GraphicsUtils.GetResize(img, scaleWidth, scaleHeight);
         this.image = LImage.CreateImage(scaleWidth, scaleHeight, true);
         if (back.GetWidth() == scaleWidth
                 && back.GetHeight() == scaleHeight)
         {
             this.finalBackgroundPixels = back.GetPixels();
             this.backgroundPixels = (Color[])CollectionUtils
                     .CopyOf(finalBackgroundPixels);
         }
         else
         {
             LImage tmp = GraphicsUtils.GetResize(back, scaleWidth,
                     scaleHeight);
             this.finalBackgroundPixels = tmp.GetPixels();
             if (tmp != null)
             {
                 tmp.Dispose();
                 tmp = null;
             }
             this.backgroundPixels = (Color[])CollectionUtils
                     .CopyOf(finalBackgroundPixels);
         }
         this.finalDrawPixels = temp.GetPixels();
         this.nowDrawPixels = (Color[])CollectionUtils.CopyOf(finalDrawPixels);
     }
     this.SetBlackToWhite(flag);
     if (temp != null)
     {
         temp.Dispose();
         temp = null;
     }
     if (img != null)
     {
         img.Dispose();
         img = null;
     }
     if (back != null)
     {
         back.Dispose();
         back = null;
     }
 }
Example #4
0
 public LPixmapData(LImage pix)
     : this(pix.GetPixels(), pix.GetWidth(), pix.GetHeight())
 {
 }
Example #5
0
        public LPixmapData(LImage pix)
            : this(pix.GetPixels(), pix.GetWidth(), pix.GetHeight())
        {

        }