Example #1
0
 public void Dispose()
 {
     this.isClose = true;
     if (buffer != null)
     {
         buffer.Dispose();
         buffer = null;
     }
 }
Example #2
0
 public void Dispose()
 {
     if (drawTexWidth != null)
     {
         drawTexWidth.Destroy();
     }
     if (drawTexHeight != null)
     {
         drawTexHeight.Destroy();
     }
     if (drawImgWidth != null)
     {
         drawImgWidth.Dispose();
     }
     if (drawImgWidth != null)
     {
         drawImgWidth.Dispose();
     }
 }
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;
     }
 }