예제 #1
0
파일: Page.cs 프로젝트: fizikci/Cinar
 public Page()
 {
     //Zoom = 100;
     Background = new Background();
     Width = 864;
     Height = 1194;
 }
예제 #2
0
파일: Page.cs 프로젝트: fizikci/Cinar
        public static void DrawBackgroundStyle(Graphics g, Point location, Size size, Background background)
        {
            // draw background color
            g.FillRectangle(
                new SolidBrush(System.Drawing.Color.FromKnownColor(background.Color)),
                location.X,
                location.Y,
                size.Width,
                size.Height);

            // draw background image
            if (background.Image != null)
            {
                Image bg = background.Image; // Image.FromFile(this.Background.Image);
                switch (background.Repeat)
                {
                    case BackgroundRepeat.Undefined:
                    case BackgroundRepeat.Tile:
                        for (int i = 0; i < size.Width / bg.Width; i++)
                            for (int j = 0; j < size.Height / bg.Height; j++)
                                g.DrawImageUnscaled(bg, location.X + i * bg.Width, location.Y + j * bg.Height);
                        break;
                    case BackgroundRepeat.Strech:
                        g.DrawImage(bg, location.X, location.Y, size.Width, size.Height);
                        break;
                    case BackgroundRepeat.Center:
                        int posX = location.X + size.Width / 2 - bg.Width / 2;
                        int posY = location.Y + size.Height / 2 - bg.Height / 2;
                        g.DrawImageUnscaled(bg, posX, posY);
                        break;
                    default:
                        break;
                }
            }
        }
예제 #3
0
파일: Element.cs 프로젝트: fizikci/Cinar
 public Element()
 {
     //Color = KnownColor.Black;
     Background = new Background();
     Border = new BorderComplex();
     Padding = new MarginPadding();
 }