Пример #1
0
        public ImageDialogMain()//构造函数
        {
            InitializeComponent();



            m_ImageDialog = new ImageDialog();

            m_AddImageDelegate = new DelegateAddImage(this.AddImage);

            Controller          = new GetImageThumbnail();
            Controller.OnStart += new GetImageThumbnailEventHandler(m_Controller_OnStart);
            Controller.OnAdd   += new GetImageThumbnailEventHandler(m_Controller_OnAdd);
            Controller.OnEnd   += new GetImageThumbnailEventHandler(m_Controller_OnEnd);
        }
Пример #2
0
        public void ShowPhotoThumbnail()
        {
            var getImageThumbnail = new GetImageThumbnail();

            ImageBrush thumbnailImageBrush = new ImageBrush();

            getImageThumbnail.GetThumbnailPath();

            switch (templateName)
            {
            case "foreground_1":
                if (photoNumberInTemplate == 1)
                {
                    CenterThumbnailImage.Source = new BitmapImage(new Uri(getImageThumbnail.thumbnailPath));
                    CenterThumbnail.Visibility  = Visibility.Visible;
                }
                break;


            case "foreground_3":
                switch (photoNumberInTemplate)
                {
                case 1:
                    LeftThumbnailImage.Source = new BitmapImage(new Uri(getImageThumbnail.thumbnailPath));
                    LeftThumbnail.Visibility  = Visibility.Visible;
                    break;

                case 2:
                    CenterThumbnailImage.Source = new BitmapImage(new Uri(getImageThumbnail.thumbnailPath));
                    CenterThumbnail.Visibility  = Visibility.Visible;
                    break;

                case 3:
                    RightThumbnailImage.Source = new BitmapImage(new Uri(getImageThumbnail.thumbnailPath));
                    RightThumbnail.Visibility  = Visibility.Visible;
                    break;

                default:
                    Debug.WriteLine("bug at switch which template in ShowPhotoThumbnail - foreground3");
                    Debug.WriteLine("bug because photoNumberInTemplate = " + photoNumberInTemplate);

                    break;
                }
                break;

            case "foreground_4":
                switch (photoNumberInTemplate)
                {
                case 1:
                    FirstThumbnailImage.Source = new BitmapImage(new Uri(getImageThumbnail.thumbnailPath));
                    FirstThumbnail.Visibility  = Visibility.Visible;
                    break;

                case 2:
                    SecondThumbnailImage.Source = new BitmapImage(new Uri(getImageThumbnail.thumbnailPath));
                    SecondThumbnail.Visibility  = Visibility.Visible;
                    break;

                case 3:
                    ThirdThumbnailImage.Source = new BitmapImage(new Uri(getImageThumbnail.thumbnailPath));
                    ThirdThumbnail.Visibility  = Visibility.Visible;
                    break;

                case 4:
                    FourthThumbnailImage.Source = new BitmapImage(new Uri(getImageThumbnail.thumbnailPath));
                    FourthThumbnail.Visibility  = Visibility.Visible;
                    break;

                default:
                    Debug.WriteLine("bug at switch which template in ShowPhotoThumbnail - foreground 4");
                    Debug.WriteLine("bug because photoNumberInTemplate = " + photoNumberInTemplate);

                    break;
                }
                break;

            case "foreground_4_paski":
                switch (photoNumberInTemplate)
                {
                case 1:
                    FirstThumbnailImage.Source = new BitmapImage(new Uri(getImageThumbnail.thumbnailPath));
                    FirstThumbnail.Visibility  = Visibility.Visible;
                    break;

                case 2:
                    SecondThumbnailImage.Source = new BitmapImage(new Uri(getImageThumbnail.thumbnailPath));
                    SecondThumbnail.Visibility  = Visibility.Visible;
                    break;

                case 3:
                    ThirdThumbnailImage.Source = new BitmapImage(new Uri(getImageThumbnail.thumbnailPath));
                    ThirdThumbnail.Visibility  = Visibility.Visible;
                    break;

                case 4:
                    FourthThumbnailImage.Source = new BitmapImage(new Uri(getImageThumbnail.thumbnailPath));
                    FourthThumbnail.Visibility  = Visibility.Visible;
                    break;

                default:
                    Debug.WriteLine("bug at switch which template in ShowPhotoThumbnail = foreground 4 paski");
                    Debug.WriteLine("bug because photoNumberInTemplate = " + photoNumberInTemplate);
                    break;
                }
                break;

            default:
                Debug.WriteLine("bug at switch which template in showphotothumbnail");
                break;
            }
        }