protected static void Xp1skin() { button = new ImageObject("DotNetSkin.SkinControls.xp1_button.png",5,Rectangle.FromLTRB(8,9,8,9)); checkbox = new ImageObject("DotNetSkin.SkinControls.xp1_checkbox.png",12,new Rectangle(0,0,0,0)); radiobutton = new ImageObject("DotNetSkin.SkinControls.xp1_radiobutton.png",8,new Rectangle(0,0,0,0)); }
internal static void DrawRect2(Graphics g,ImageObject obj,Rectangle r,int index) { if (obj.img == null) return; Rectangle r1,r2; int x = (index-1)*obj.Width; int y = 0;//obj.r.Top; int x1 = r.Left; int y1 = r.Top; if (r.Height > obj.Height && r.Width <= obj.Width) { r1 = new Rectangle(x,y, obj.Width,obj.lr.Top); r2 = new Rectangle(x1,y1, r.Width,obj.lr.Top); g.DrawImage(obj.img,r2,r1,GraphicsUnit.Pixel); r1 = new Rectangle(x,y+obj.lr.Top, obj.Width,obj.Height-obj.lr.Top-obj.lr.Bottom); r2 = new Rectangle(x1,y1+obj.lr.Top, r.Width, r.Height-obj.lr.Top-obj.lr.Bottom); if ((obj.lr.Top+obj.lr.Bottom) == 0) r1.Height = r1.Height-1; g.DrawImage(obj.img,r2,r1,GraphicsUnit.Pixel); r1 = new Rectangle(x,y+obj.Height-obj.lr.Bottom, obj.Width,obj.lr.Bottom); r2 = new Rectangle(x1,y1+r.Height-obj.lr.Bottom, r.Width,obj.lr.Bottom); g.DrawImage(obj.img,r2,r1,GraphicsUnit.Pixel); } else if (r.Height <= obj.Height && r.Width > obj.Width) { r1 = new Rectangle(x,y,obj.lr.Left,obj.Height); r2 = new Rectangle(x1,y1,obj.lr.Left,r.Height); g.DrawImage(obj.img,r2,r1,GraphicsUnit.Pixel); r1 = new Rectangle(x+obj.lr.Left,y, obj.Width-obj.lr.Left-obj.lr.Right,obj.Height); r2 = new Rectangle(x1+obj.lr.Left,y1, r.Width-obj.lr.Left-obj.lr.Right,r.Height); g.DrawImage(obj.img,r2,r1,GraphicsUnit.Pixel); r1 = new Rectangle(x+obj.Width-obj.lr.Right,y, obj.lr.Right,obj.Height); r2 = new Rectangle(x1+r.Width-obj.lr.Right,y1,obj.lr.Right,r.Height); g.DrawImage(obj.img,r2,r1,GraphicsUnit.Pixel); } else if (r.Height <= obj.Height && r.Width <= obj.Width) { r1 = new Rectangle((index-1)*obj.Width,0,obj.Width,obj.Height-1); //r1.Offset(obj.r.Left,obj.r.Top); g.DrawImage(obj.img,new Rectangle(x1,y1,r.Width,r.Height),r1,GraphicsUnit.Pixel); } else if (r.Height > obj.Height && r.Width > obj.Width) { //top-left r1 = new Rectangle(x,y,obj.lr.Left,obj.lr.Top); r2 = new Rectangle(x1,y1,obj.lr.Left,obj.lr.Top); g.DrawImage(obj.img,r2,r1,GraphicsUnit.Pixel); //top-bottom r1 = new Rectangle(x,y+obj.Height-obj.lr.Bottom,obj.lr.Left,obj.lr.Bottom); r2 = new Rectangle(x1,y1+r.Height-obj.lr.Bottom,obj.lr.Left,obj.lr.Bottom); g.DrawImage(obj.img,r2,r1,GraphicsUnit.Pixel); //left r1 = new Rectangle(x,y+obj.lr.Top,obj.lr.Left,obj.Height-obj.lr.Top-obj.lr.Bottom); r2 = new Rectangle(x1,y1+obj.lr.Top,obj.lr.Left,r.Height-obj.lr.Top-obj.lr.Bottom); g.DrawImage(obj.img,r2,r1,GraphicsUnit.Pixel); //top r1 = new Rectangle(x+obj.lr.Left,y, obj.Width-obj.lr.Left-obj.lr.Right,obj.lr.Top); r2 = new Rectangle(x1+obj.lr.Left,y1, r.Width-obj.lr.Left-obj.lr.Right,obj.lr.Top); g.DrawImage(obj.img,r2,r1,GraphicsUnit.Pixel); //right-top r1 = new Rectangle(x+obj.Width-obj.lr.Right,y,obj.lr.Right,obj.lr.Top); r2 = new Rectangle(x1+r.Width-obj.lr.Right,y1,obj.lr.Right,obj.lr.Top); g.DrawImage(obj.img,r2,r1,GraphicsUnit.Pixel); //Right r1 = new Rectangle(x+obj.Width-obj.lr.Right,y+obj.lr.Top, obj.lr.Right,obj.Height-obj.lr.Top-obj.lr.Bottom); r2 = new Rectangle(x1+r.Width-obj.lr.Right,y1+obj.lr.Top, obj.lr.Right,r.Height-obj.lr.Top-obj.lr.Bottom); g.DrawImage(obj.img,r2,r1,GraphicsUnit.Pixel); //right-bottom r1 = new Rectangle(x+obj.Width-obj.lr.Right,y+obj.Height-obj.lr.Bottom, obj.lr.Right,obj.lr.Bottom); r2 = new Rectangle(x1+r.Width-obj.lr.Right,y1+r.Height-obj.lr.Bottom, obj.lr.Right,obj.lr.Bottom); g.DrawImage(obj.img,r2,r1,GraphicsUnit.Pixel); //bottom r1 = new Rectangle(x+obj.lr.Left,y+obj.Height-obj.lr.Bottom, obj.Width-obj.lr.Left-obj.lr.Right,obj.lr.Bottom); r2 = new Rectangle(x1+obj.lr.Left,y1+r.Height-obj.lr.Bottom, r.Width-obj.lr.Left-obj.lr.Right,obj.lr.Bottom); g.DrawImage(obj.img,r2,r1,GraphicsUnit.Pixel); //Center r1 = new Rectangle(x+obj.lr.Left,y+obj.lr.Top, obj.Width-obj.lr.Left-obj.lr.Right,obj.Height-obj.lr.Top-obj.lr.Bottom); //r1 = Rectangle.FromLTRB(x+obj.lr.Left,y+obj.lr.Top, // x+obj.width-obj.lr.Right,y+obj.height-obj.lr.Bottom); r2 = new Rectangle(x1+obj.lr.Left,y1+obj.lr.Top, r.Width-obj.lr.Left-obj.lr.Right,r.Height-obj.lr.Top-obj.lr.Bottom); g.DrawImage(obj.img,r2,r1,GraphicsUnit.Pixel); } }
protected static void Macskin() { button = new ImageObject("DotNetSkin.SkinControls.mac_button.png",5,Rectangle.FromLTRB(14,11,14,11)); checkbox = new ImageObject("DotNetSkin.SkinControls.mac_checkbox.png",12,new Rectangle(0,0,0,0)); radiobutton = new ImageObject("DotNetSkin.SkinControls.mac_radiobutton.png",8,new Rectangle(0,0,0,0)); }
internal static void DrawRect1(Graphics g,ImageObject obj,Rectangle r,int index) { if (obj.img == null) return; Rectangle r1,r2; int x = (index-1)*obj.Width; int y = 0; int x1 = r.Left; int y1 = r.Top; r1 = new Rectangle(x,y, obj.Width,obj.Height); r2 = new Rectangle(x1,y1, r.Width,r.Height); g.DrawImage(obj.img,r2,r1,GraphicsUnit.Pixel); }