ScrollBarRes.cs
上传用户:xlxx0122
上传日期:2015-04-24
资源大小:3904k
文件大小:5k
源码类别:

.net编程

开发平台:

C#

  1. namespace Sunisoft.IrisSkin
  2. {
  3.     using System;
  4.     using System.Drawing;
  5.     public class ScrollBarRes : IDisposable
  6.     {
  7.         private Bitmap[,] x804214fd8fadc2a7;
  8.         private Brush x9646b37d9a66d008;
  9.         private bool xa605cad12563f03c;
  10.         private Bitmap[,] xc088a3c732c3a72e;
  11.         private SkinEngine xdc87e2b99332cd4a;
  12.         private Bitmap[,] xe26e029a72589589;
  13.         public ScrollBarRes(SkinEngine engine)
  14.         {
  15.             this.xdc87e2b99332cd4a = engine;
  16.             this.x89aa76148c30a93b();
  17.         }
  18.         public void Dispose()
  19.         {
  20.             this.xdc87e2b99332cd4a = null;
  21.         }
  22.         private void x89aa76148c30a93b()
  23.         {
  24.             this.x9646b37d9a66d008 = this.xdc87e2b99332cd4a.GetBrush("SKIN2_SCROLLBARCOLOR");
  25.             this.x804214fd8fadc2a7 = new Bitmap[2, 3];
  26.             this.xe26e029a72589589 = new Bitmap[2, 3];
  27.             this.xc088a3c732c3a72e = new Bitmap[2, 5];
  28.             this.x804214fd8fadc2a7[0, 0] = this.xdc87e2b99332cd4a.GetBitmap("SKIN2_SCROLLBARUPBUTTON", 3, 1);
  29.             this.x804214fd8fadc2a7[0, 1] = this.xdc87e2b99332cd4a.GetBitmap("SKIN2_SCROLLBARUPBUTTON", 3, 2);
  30.             this.x804214fd8fadc2a7[0, 2] = this.xdc87e2b99332cd4a.GetBitmap("SKIN2_SCROLLBARUPBUTTON", 3, 3);
  31.             this.xe26e029a72589589[0, 0] = this.xdc87e2b99332cd4a.GetBitmap("SKIN2_SCROLLBARDOWNBUTTON", 3, 1);
  32.             this.xe26e029a72589589[0, 1] = this.xdc87e2b99332cd4a.GetBitmap("SKIN2_SCROLLBARDOWNBUTTON", 3, 2);
  33.             this.xe26e029a72589589[0, 2] = this.xdc87e2b99332cd4a.GetBitmap("SKIN2_SCROLLBARDOWNBUTTON", 3, 3);
  34.             for (int i = 0; i < 3; i++)
  35.             {
  36.                 this.x804214fd8fadc2a7[1, i] = (Bitmap) this.x804214fd8fadc2a7[0, i].Clone();
  37.                 this.x804214fd8fadc2a7[1, i].RotateFlip(RotateFlipType.Rotate270FlipNone);
  38.                 this.xe26e029a72589589[1, i] = (Bitmap) this.xe26e029a72589589[0, i].Clone();
  39.                 this.xe26e029a72589589[1, i].RotateFlip(RotateFlipType.Rotate270FlipNone);
  40.             }
  41.             Bitmap image = this.xdc87e2b99332cd4a.GetBitmap("SKIN2_SCROLLBAR");
  42.             try
  43.             {
  44.                 if (((image.Height == 0x21) && (this.xdc87e2b99332cd4a.GetColor("SKIN2_SCROLLBARCOLOR") == Color.FromArgb(0xff, 0xcb, 0xcb, 0xcb))) && (image.GetPixel(1, 10) == Color.FromArgb(0xff, 1, 0x39, 0xb2)))
  45.                 {
  46.                     this.xa605cad12563f03c = true;
  47.                 }
  48.             }
  49.             catch
  50.             {
  51.             }
  52.             int num2 = (image.Height - 6) / 3;
  53.             int width = image.Width;
  54.             int top = 0;
  55.             int bottom = 0;
  56.             for (int j = 0; j < 5; j++)
  57.             {
  58.                 switch (j)
  59.                 {
  60.                     case 0:
  61.                     case 4:
  62.                         bottom += 3;
  63.                         break;
  64.                     default:
  65.                         if (j == 2)
  66.                         {
  67.                             bottom += num2 + ((image.Height - 6) % 3);
  68.                         }
  69.                         else
  70.                         {
  71.                             bottom += num2;
  72.                         }
  73.                         break;
  74.                 }
  75.                 this.xc088a3c732c3a72e[0, j] = new Bitmap(width, bottom - top);
  76.                 using (Graphics graphics = Graphics.FromImage(this.xc088a3c732c3a72e[0, j]))
  77.                 {
  78.                     graphics.DrawImage(image, new Rectangle(0, 0, width, bottom - top), Rectangle.FromLTRB(0, top, width, bottom), GraphicsUnit.Pixel);
  79.                 }
  80.                 this.xc088a3c732c3a72e[1, j] = (Bitmap) this.xc088a3c732c3a72e[0, j].Clone();
  81.                 this.xc088a3c732c3a72e[1, j].RotateFlip(RotateFlipType.Rotate270FlipNone);
  82.                 top = bottom;
  83.             }
  84.         }
  85.         public Brush BackColorBrush
  86.         {
  87.             get
  88.             {
  89.                 return this.x9646b37d9a66d008;
  90.             }
  91.         }
  92.         public Bitmap[,] DownButton
  93.         {
  94.             get
  95.             {
  96.                 return this.xe26e029a72589589;
  97.             }
  98.         }
  99.         public bool IsMacOS
  100.         {
  101.             get
  102.             {
  103.                 return this.xa605cad12563f03c;
  104.             }
  105.         }
  106.         public Bitmap[,] Slider
  107.         {
  108.             get
  109.             {
  110.                 return this.xc088a3c732c3a72e;
  111.             }
  112.         }
  113.         public Bitmap[,] UpButton
  114.         {
  115.             get
  116.             {
  117.                 return this.x804214fd8fadc2a7;
  118.             }
  119.         }
  120.     }
  121. }