/// <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; }; }
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); }; } }
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); }
public ConvolutionVisitor( IConvolutionFactory factory, IConvolutionService convolution, IBitmapService service, ICacheService <Bitmap> cache) { _factory = factory; _convolution = convolution; _service = service; _cache = cache; }
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); }
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))); }
/// <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; }
/// <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; }
public ImageDrawingCombiner(IBitmapService service) { this.service = service; }
public PictureService(IAppConfiguration config, IBitmapService bitmapservice) { _config = config; _bitmapService = bitmapservice; }
public TileService(IBitmapService bitmapService) { this.bitmapService = bitmapService; }
public PictureRepository(IFileService fileService, IBitmapService bitmapService) { _fileService = fileService; _bitmapService = bitmapService; }