Ejemplo n.º 1
0
        public void Add_A_Picture(string MyFileName, Guid thumbID)
        {
            TouchImage MyImage = new TouchImage(thumbID);
            BitmapImage src    = new BitmapImage();

            src.BeginInit();
            src.UriSource = new Uri(MyFileName, UriKind.RelativeOrAbsolute);
            src.EndInit();
            if (src.PixelHeight > 3000)
            {
                src.DecodePixelHeight = 3000;
            }

            int MyImageNo = this.Children.Count;

            MyImage.Source = src;
            MyImage.Height = 300;
            MyImage.IsManipulationEnabled = true;
            MyImage.Name            = "Image" + MyImageNo.ToString();
            MyImage.Stretch         = Stretch.UniformToFill;
            MyImage.RenderTransform = new MatrixTransform(1, 0, 0, 1, 200 + 10 * MyImageNo, 200 + 10 * MyImageNo);
            RenderOptions.SetBitmapScalingMode(MyImage, BitmapScalingMode.HighQuality);

            this.Children.Add(MyImage);
        }
Ejemplo n.º 2
0
        private TouchImage FindPicture(Guid thumbID)
        {
            foreach (UIElement elem in this.Children)
            {
                TouchImage image = elem as TouchImage;

                if (image != null)
                {
                    if (image.ThumbID == thumbID)
                    {
                        return(image);
                    }
                }
            }

            return(null);
        }
Ejemplo n.º 3
0
        public void RemovePicture(Guid thumID)
        {
            TouchImage image = FindPicture(thumID);

            RemovePicture(image);
        }
Ejemplo n.º 4
0
 private void RemovePicture(TouchImage image)
 {
     this.Children.Remove(image);
 }