Exemplo n.º 1
0
        /// <summary>
        /// Ctor
        /// </summary>
        public TakePicturePage()
        {
            InitializeComponent();

            bitmapService       = DependencyService.Get <IBitmapService>();
            localStorageService = DependencyService.Get <ILocalStorageService>();

            PhotoCapturedEvent += (sender, source) =>
            {
                layoutCamera.IsVisible = false;
                layoutPhoto.IsVisible  = true;

                if (source is StreamImageSource streamSource && streamSource.Stream != null)
                {
                    var stream = streamSource.Stream(CancellationToken.None).Result;

                    using (var ms = new MemoryStream())
                    {
                        stream.CopyTo(ms);
                        originalPicture = ms.ToArray();

                        SetText(); //Установка текста поздравления
                    }
                }

                viewPhoto.Source = pictureSource;

                btnText.IsEnabled = !cameraOn;
                btnNext.IsEnabled = !cameraOn;
                btnTake.Text      = cameraOn ? takePicture : retakePicture;
            };
        }
Exemplo n.º 2
0
        public EditSchemeViewModel(
            IWindowManager windowManager,
            ISchemeStorageService schemeStorage,
            INavigationService navigationService,
            ISharingService sharingService,
            IBitmapService bitmapService)
        {
            this.windowManager     = windowManager;
            this.schemeStorage     = schemeStorage;
            this.navigationService = navigationService;
            this.sharingService    = sharingService;
            this.bitmapService     = bitmapService;

            Types = new BindableCollection <SchemeTypeViewModel>
            {
                new SchemeTypeViewModel(SchemeType.Complimentary, new ComplimentarySchemeEditorViewModel(windowManager)),
                new SchemeTypeViewModel(SchemeType.Analogous, new AnalogousSchemeEditorViewModel(windowManager)),
                new SchemeTypeViewModel(SchemeType.Triad, new TriadSchemeEditorViewModel(windowManager)),
                new SchemeTypeViewModel(SchemeType.Monochromatic, new MonochromeSchemeEditorViewModel(windowManager)),
                new SchemeTypeViewModel(SchemeType.Custom, new CustomSchemeEditorViewModel(windowManager))
            };

            SelectedType = Types[0];

            foreach (var type in Types)
            {
                type.Editor.PropertyChanged += (s, e) =>
                {
                    NotifyOfPropertyChange(() => CanSave);
                    NotifyOfPropertyChange(() => CanShare);
                };
            }
        }
Exemplo n.º 3
0
 public DistributionPresenter(
     IBitmapService service,
     IAsyncOperationLocker locker,
     IBitmapLuminanceProvider provider)
 {
     _locker   = locker;
     _service  = service;
     _provider = provider;
 }
        public DistributionPresenterWrapper(
            IBitmapService service,
            IAsyncOperationLocker locker,
            IBitmapLuminanceProvider provider)
        {
            Operation = locker;
            Provider  = provider;
            Service   = service;

            _presenter = new DistributionPresenter(service, locker, provider);
        }
Exemplo n.º 5
0
 public ConvolutionVisitor(
     IConvolutionFactory factory,
     IConvolutionService convolution,
     IBitmapService service,
     ICacheService <Bitmap> cache)
 {
     _factory     = factory;
     _convolution = convolution;
     _service     = service;
     _cache       = cache;
 }
Exemplo n.º 6
0
        public MainViewModel(IBitmapService bitmapService, IFilePicker filePicker)
        {
            BrowseFile = ReactiveCommand
                         .CreateFromObservable(() => filePicker.Pick("Select an image", new[] { ".png", ".jpg" })
                                               .Where(file => file != null)
                                               .SelectMany(x => Observable.FromAsync(() => ToBytes(x))));
            Rotate = ReactiveCommand.CreateFromTask(() => bitmapService.Create(Source, Angle), BrowseFile.Any());

            source      = BrowseFile.ToProperty(this, x => x.Source);
            destination = Rotate.ToProperty(this, x => x.Destination);
            Angle       = 90f;

            isLoading = Rotate.IsExecuting.ToProperty(this, x => x.IsLoading);
        }
Exemplo n.º 7
0
        public Section1ViewModel(IBitmapService bitmapService, IFilePicker filePicker, IDialogService dialogService)
        {
            BrowseFile = ReactiveCommand
                         .CreateFromObservable(() => Pick(filePicker));
            Rotate = ReactiveCommand.CreateFromTask(() => bitmapService.Create(Source, Angle), BrowseFile.Any());
            Rotate.ShowExceptions(dialogService);

            source      = BrowseFile.ToProperty(this, x => x.Source);
            destination = Rotate.ToProperty(this, x => x.Destination);
            Angle       = 90f;

            isLoading = Rotate.IsExecuting.ToProperty(this, x => x.IsLoading);

            this.WhenAnyValue(x => x.Url)
            .Subscribe(s => MessageBus.Current.SendMessage(new UrlMessage(s)));
        }
Exemplo n.º 8
0
        /// <summary>
        /// Initializes a new instance of the Form1 class.
        /// </summary>
        public Form1(IArcFileProvider arcFileProvider, IArzFileProvider arzFileProvider, IDBRecordCollectionProvider dBRecordCollectionProvider, IBitmapService bitmapService)
        {
            this.InitializeComponent();
            Assembly     a     = Assembly.GetExecutingAssembly();
            AssemblyName aname = a.GetName();

            this.arcProv = arcFileProvider;
            this.arzProv = arzFileProvider;
            this.DBRecordCollectionProvider = dBRecordCollectionProvider;
            this.BitmapService = bitmapService;
            this.titleText     = aname.Name;
            this.selectedFileToolStripMenuItem.Enabled = false;
            this.allFilesToolStripMenuItem.Enabled     = false;
            fileType         = CompressedFileType.Unknown;
            this.initialSize = this.Size;
            this.gutter      = this.initialSize.Width - this.textBox1.Width - this.treeView1.Width;
        }
Exemplo n.º 9
0
        /// <summary>
        /// Initializes a new instance of the Form1 class.
        /// </summary>
        public MainForm(ILogger <MainForm> log, IArcFileProvider arcFileProvider, IArzFileProvider arzFileProvider, IDBRecordCollectionProvider dBRecordCollectionProvider, IBitmapService bitmapService)
        {
            this.InitializeComponent();

            Assembly     a     = Assembly.GetExecutingAssembly();
            AssemblyName aname = a.GetName();

            this.Log     = log.Logger;
            this.arcProv = arcFileProvider;
            this.arzProv = arzFileProvider;
            this.DBRecordCollectionProvider = dBRecordCollectionProvider;
            this.BitmapService = bitmapService;
            this.titleText     = aname.Name;
            this.selectedFileToolStripMenuItem.Enabled = false;
            this.allFilesToolStripMenuItem.Enabled     = false;
            fileType         = CompressedFileType.Unknown;
            this.initialSize = this.Size;
        }
Exemplo n.º 10
0
 public ImageDrawingCombiner(IBitmapService service)
 {
     this.service = service;
 }
Exemplo n.º 11
0
 public PictureService(IAppConfiguration config, IBitmapService bitmapservice)
 {
     _config        = config;
     _bitmapService = bitmapservice;
 }
Exemplo n.º 12
0
 public TileService(IBitmapService bitmapService)
 {
     this.bitmapService = bitmapService;
 }
Exemplo n.º 13
0
 public PictureRepository(IFileService fileService, IBitmapService bitmapService)
 {
     _fileService   = fileService;
     _bitmapService = bitmapService;
 }