예제 #1
0
 public ImageThumb(Page p, Photo ph)
 {
     InitializeComponent();
     this.p = p;
     thumbnail.DataContext = ph;
     this.ph = ph;
 }
예제 #2
0
        void xml_parse(object sender, DownloadStringCompletedEventArgs e)
        {
            XElement xml = XElement.Parse(e.Result);
            var mes_images = from p in xml.Elements("image") select p;

            foreach (XElement img in mes_images)
            {
                Photo ph = new Photo(img, this.page);
                images.Add(ph);
            }
            page.refresh(this);
        }
예제 #3
0
        public Page()
        {
            InitializeComponent();

            albChooser.MainPage = this;
            
            mInitialWidth = this.Width;
            mInitialHeight = this.Height;
            
            grille.Children.Remove(pause1);
            grille.Children.Remove(pause2);


            

            Application.Current.Host.Content.FullScreenChanged += new EventHandler(Content_FullScreenChanged);

            
            WebClient xmlfile = new WebClient();
            xmlfile.DownloadStringCompleted += new DownloadStringCompletedEventHandler(xml_parse);
            xmlfile.DownloadStringAsync(new Uri(Page.ALBUMS_URL));

            

            next.Opacity = 0;
            back.Opacity = 0;
            play.Opacity = 0;
            

            grille.MouseMove += new MouseEventHandler(grille_MouseMoved);
            eventHandler = new EventHandler(timer_Tick);
            myDispatcherTimer = new System.Windows.Threading.DispatcherTimer();
            myDispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 2500);
            myDispatcherTimer.Tick += eventHandler;
            myDispatcherTimer.Start();

            slideShowTimer = new System.Windows.Threading.DispatcherTimer();
            slideShowTimer.Interval = new TimeSpan(0, 0, 0, timeInterval, 0);
            slideShowTimer.Tick += new EventHandler(NextPicture_Tick);




            mainImage.Width = 10000;
            Photo p = new Photo(this);
           
            mainImage.DataContext = p;

            
        }
예제 #4
0
        void AddPhotosInFolder(string folder)
        {
            try
            {
                foreach (string s in Directory.GetFiles(folder, "*.jpg"))
                {
                    Photo photo = new Photo(s);
                    photos.Add(photo);

                    // Construct the ListBoxItem with an Image as content:
                    ListBoxItem item = new ListBoxItem();
                    item.Padding = new Thickness(3, 8, 3, 8);
                    item.MouseDoubleClick += delegate { ShowPhoto(false); };
                    TransformGroup tg = new TransformGroup();
                    tg.Children.Add(st);
                    tg.Children.Add(new RotateTransform());
                    item.LayoutTransform = tg;
                    item.Tag = s;

                    Image image = new Image();
                    image.Height = 35;

                    // If the image contains a thumbnail, use that instead of the entire image:
                    Uri uri = new Uri(s);
                    BitmapDecoder bd = BitmapDecoder.Create(uri, BitmapCreateOptions.DelayCreation, BitmapCacheOption.Default);
                    if (bd.Frames[0].Thumbnail != null)
                        image.Source = bd.Frames[0].Thumbnail;
                    else
                        image.Source = new BitmapImage(uri);

                    // Construct a ToolTip for the item:
                    Image toolImage = new Image();
                    toolImage.Source = bd.Frames[0].Thumbnail;

                    TextBlock textBlock1 = new TextBlock();
                    textBlock1.Text = System.IO.Path.GetFileName(s);
                    TextBlock textBlock2 = new TextBlock();
                    textBlock2.Text = photo.DateTime.ToString();

                    StackPanel sp = new StackPanel();
                    sp.Children.Add(toolImage);
                    sp.Children.Add(textBlock1);
                    sp.Children.Add(textBlock2);

                    item.ToolTip = sp;
                    item.Content = image;

                    pictureBox.Items.Add(item);
                }
            }
            catch (UnauthorizedAccessException) { }
            catch (IOException) { }
        }
예제 #5
0
        public void setPhoto(Photo ph)
        {
            int i = displayedImages().IndexOf(ph);

            setPicture(i);
        }
예제 #6
0
 public void setPhoto(Photo ph)
 {
    
     int i = displayedImages().IndexOf(ph);
     setPicture(i);
 }