Ejemplo n.º 1
0
 internal ImageEditorViewModel(SKBitmap bitmap, ImageEditorConfig config)
 {
     Config        = config;
     cropperCanvas = new ImageCropperCanvasView(bitmap, config.CropAspectRatio);
     mainCanvas    = new TouchManipulationCanvasView(config);
     mainCanvas.AddBitmapToCanvas(bitmap.Copy(), BitmapType.Main);
     mainCanvas.TextBitmapClicked += MainCanvas_TextBitmapClicked;
     mainCanvas.TrashEnabled      += MainCanvas_TrashVisebled;
     ColorCollect = SkiaHelper.GetColors();
     CropCollect  = CropItem.GetCropItems(config.CanChangeCropAspectRatio);
     Message      = config?.LoadingText;
 }
 internal ImageEditorViewModel(SKBitmap bitmap, ImageEditorConfig config)
 {
     Config        = config;
     cropperCanvas = new ImageCropperCanvasView(bitmap, config.CropAspectRatio);
     mainCanvas    = new TouchManipulationCanvasView(config);
     mainCanvas.AddBitmapToCanvas(bitmap.Copy(), BitmapType.Main);
     mainCanvas.TextBitmapClicked += MainCanvas_TextBitmapClicked;
     mainCanvas.TrashEnabled      += MainCanvas_TrashVisebled;
     ColorCollect = SkiaHelper.GetColors();
     CropCollect  = CropItem.GetCropItems(config.CanChangeCropAspectRatio);
     Message      = config?.LoadingText;
     MessagingCenter.Subscribe <Xamarin.Forms.Application>(this, "BBDroidBackButton", (sender) => OnBackPressed());
 }