Exemplo n.º 1
0
        private RadImageItem GetThumbNail(string path)
        {
            RadImageItem imageItem = new RadImageItem();
            Image        image     = Image.FromFile(path);

            // workaround to prevent using internal image thumbnail
            image.RotateFlip(System.Drawing.RotateFlipType.Rotate180FlipNone);
            image.RotateFlip(System.Drawing.RotateFlipType.Rotate180FlipNone);
            // calculate aspect ratio so image is not distorted

            double ratio = 0;

            if (image.Width < image.Height)
            {
                ratio = (double)rotatorPhotos.Width / (double)image.Width;
            }
            else
            {
                ratio = (double)rotatorPhotos.Height / (double)image.Height;
            }
            int newWidth  = (int)((double)image.Width * ratio);
            int newHeight = (int)((double)image.Height * ratio);

            imageItem.Image = image.GetThumbnailImage(newWidth, newHeight, null, IntPtr.Zero);
            //imageItem.Image = image;
            //imageItem.Alignment = ContentAlignment.MiddleCenter;  // doesn't work
            ((Telerik.WinControls.Primitives.ImagePrimitive)(imageItem.GetChildAt(0))).Alignment = System.Drawing.ContentAlignment.MiddleCenter;
            return(imageItem);
        }
Exemplo n.º 2
0
        private void PrepareLogo()
        {
            StackLayoutElement logoLayout = new StackLayoutElement();
            logoLayout.Orientation = Orientation.Horizontal;
            logoLayout.Margin = new System.Windows.Forms.Padding(120, 645, 0, 0);
            logoLayout.StretchHorizontally = false;

            this.logoTlieta = new RadImageItem();
            this.logoTlieta.Image = Tlieta.Pdms.Properties.Resources.TLIETA250;
            this.logoTlieta.BackColor = Color.Transparent;
            this.logoTlieta.BorderThickness = new Padding(0, 0, 0, 0);
            logoLayout.Children.Add(this.logoTlieta);

            this.radPanorama1.PanoramaElement.Children.Add(logoLayout);
        }
Exemplo n.º 3
0
        private void PrepareHeader()
        {
            StackLayoutElement headerLayout = new StackLayoutElement();
            headerLayout.Orientation = Orientation.Horizontal;
            headerLayout.Margin = new System.Windows.Forms.Padding(0, 35, 0, 0);
            headerLayout.NotifyParentOnMouseInput = true;
            headerLayout.ShouldHandleMouseInput = false;
            headerLayout.StretchHorizontally = false;

            this.backButton = new RadImageItem();
            this.backButton.Margin = new Padding(40, 0, 28, 0);
            this.backButton.Click += new EventHandler(backButton_Click);
            this.backButton.Visibility = ElementVisibility.Hidden;
            this.backButton.Image = Tlieta.Pdms.Properties.Resources.back;
            this.backButton.BackColor = Color.Transparent;
            this.backButton.BorderThickness = new Padding(0, 0, 0, 0);
            headerLayout.Children.Add(this.backButton);

            this.headerLabel = new LightVisualElement();
            this.headerLabel.Text = ConfigurationSettings.AppSettings["ApplicationLabel"].ToString();
            this.headerLabel.Font = new Font("Segoe UI Light", 35, GraphicsUnit.Point);
            this.headerLabel.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias;
            this.headerLabel.ForeColor = Color.White;
            this.headerLabel.TextAlignment = ContentAlignment.MiddleLeft;
            this.headerLabel.MaxSize = new Size(1030, 110);
            this.headerLabel.NotifyParentOnMouseInput = true;
            this.headerLabel.ShouldHandleMouseInput = false;
            this.headerLabel.StretchHorizontally = false;
            headerLayout.Children.Add(this.headerLabel);

            //StackLayoutElement headerLogo = new StackLayoutElement();
            //headerLogo.Margin = new System.Windows.Forms.Padding(1220, 60, 0, 0);
            //headerLogo.StretchHorizontally = false;

            //this.logoTlietaHeader = new RadImageItem();
            //this.logoTlietaHeader.Image = Tlieta.Pdms.Properties.Resources.TLIETA90;
            //this.logoTlietaHeader.BackColor = Color.Transparent;
            //this.logoTlietaHeader.Margin = new Padding(0, 0, 20, 0);
            //this.logoTlietaHeader.BorderThickness = new Padding(0, 0, 0, 0);
            //headerLogo.Children.Add(this.logoTlietaHeader);

            this.radPanorama1.PanoramaElement.Children.Add(headerLayout);
            //this.radPanorama1.PanoramaElement.Children.Add(headerLogo);
        }