public void SetBackground(string imagePath, ContentStretch stretch) { var imageView = ScrollView.BackgroundView as UIImageView; if (imageView == null) { ScrollView.BackgroundView = imageView = new UIImageView(View.Frame); } imageView.Image = new UIImage(imagePath); switch (stretch) { case iFactr.UI.ContentStretch.Fill: imageView.ContentMode = UIViewContentMode.ScaleToFill; break; case iFactr.UI.ContentStretch.None: imageView.ContentMode = UIViewContentMode.Center; break; case iFactr.UI.ContentStretch.Uniform: imageView.ContentMode = UIViewContentMode.ScaleAspectFit; break; case iFactr.UI.ContentStretch.UniformToFill: imageView.ContentMode = UIViewContentMode.ScaleAspectFill; break; } }
public override async void SetBackground(string imagePath, ContentStretch stretch) { System.Windows.Media.ImageBrush brush = null; BitmapImage bitmap = null; if (!string.IsNullOrWhiteSpace(imagePath)) { bitmap = await WpfFactory.LoadBitmapAsync(imagePath); brush = new System.Windows.Media.ImageBrush(bitmap); } if (brush == null || bitmap == null) { backCanvas.Background = null; backCanvas.Height = double.NaN; backCanvas.Width = double.NaN; } else { brush.Stretch = (System.Windows.Media.Stretch)stretch; backCanvas.Background = brush; backCanvas.Height = bitmap.Height; backCanvas.Width = bitmap.Width; } }
public async void SetBackground(string imagePath, ContentStretch stretch) { var brush = await imagePath.GetImageBrush(); brush.Stretch = (System.Windows.Media.Stretch)stretch; Background = brush; }
public virtual void SetBackground(string imagePath, ContentStretch stretch) { BackgroundHexCode = null; Backer = new ImageControl { Size = Size.ToSize(), Stretch = stretch, }; Backer.Loaded += (o, ev) => Redraw(); Backer.FilePath = imagePath; }
public void SetBackground(string imagePath, ContentStretch stretch) { TabBar.BackgroundImage = UIImage.FromBundle(imagePath); if (UIDevice.CurrentDevice.CheckSystemVersion(7, 0)) { TabBar.BarTintColor = null; } else { TabBar.TintColor = null; } }
public void SetBackground(string imagePath, ContentStretch stretch) { if (DroidFactory.MainActivity.ActionBar == null) { return; } ImageGetter.SetDrawable(imagePath, (bitmap, url) => { if (url == imagePath) { DroidFactory.MainActivity.ActionBar.SetBackgroundDrawable(bitmap); } }); }
public async virtual void SetBackground(string imagePath, ContentStretch stretch) { var brush = await imagePath.GetImageBrush(); if (brush == null) { Background = null; } else { brush.Stretch = (System.Windows.Media.Stretch)stretch; Background = brush; } }
public void SetBackground(string imagePath, ContentStretch stretch) { ImageGetter.SetDrawable(imagePath, (drawable, url) => { if (url != imagePath) { return; } if (drawable is BitmapDrawable bit) { SetBackground(bit.Bitmap); } else { SetBackground(null); _backgroundPath = imagePath; Invalidate(); } }); }
public void SetBackground(string imagePath, ContentStretch stretch) { drawingImageView.Image = new UIImage(imagePath); switch (stretch) { case iFactr.UI.ContentStretch.Fill: drawingImageView.ContentMode = UIViewContentMode.ScaleToFill; break; case iFactr.UI.ContentStretch.None: drawingImageView.ContentMode = UIViewContentMode.Center; break; case iFactr.UI.ContentStretch.Uniform: drawingImageView.ContentMode = UIViewContentMode.ScaleAspectFit; break; case iFactr.UI.ContentStretch.UniformToFill: drawingImageView.ContentMode = UIViewContentMode.ScaleAspectFill; break; } }
public void SetBackground(string imagePath, ContentStretch stretch) { var imageView = View as UIImageView; imageView.Image = UIImage.FromBundle(imagePath); switch (stretch) { case iFactr.UI.ContentStretch.Fill: imageView.ContentMode = UIViewContentMode.ScaleToFill; break; case iFactr.UI.ContentStretch.None: imageView.ContentMode = UIViewContentMode.Center; break; case iFactr.UI.ContentStretch.Uniform: imageView.ContentMode = UIViewContentMode.ScaleAspectFit; break; case iFactr.UI.ContentStretch.UniformToFill: imageView.ContentMode = UIViewContentMode.ScaleAspectFill; break; } }
public override void SetBackground(string imagePath, ContentStretch stretch) { _canvas.BackColor = System.Drawing.Color.Transparent; base.SetBackground(imagePath, stretch); }
public void SetBackground(string imagePath, ContentStretch stretch) { }
public void SetBackground(string imagePath, ContentStretch stretch) { _stretch = stretch; _background = imagePath; UpdateBackground(); }
void IView.SetBackground(string imagePath, ContentStretch stretch) { _canvas.SetBackground(imagePath, stretch); }