static void CustomWallsAndFloor(Workbook workbook) { #region #CustomWallsAndFloor Worksheet worksheet = workbook.Worksheets["chartTask5"]; workbook.Worksheets.ActiveWorksheet = worksheet; // Create a chart and specify its location. Chart chart = worksheet.Charts.Add(ChartType.Column3DClustered, worksheet["B2:C8"]); chart.TopLeftCell = worksheet.Cells["F2"]; chart.BottomRightCell = worksheet.Cells["L15"]; // Specify that each data point in the series has a different color. chart.Views[0].VaryColors = true; // Specify the series outline. chart.Series[0].Outline.SetSolidFill(Color.AntiqueWhite); // Hide the legend. chart.Legend.Visible = false; // Specify the side wall color. chart.View3D.SideWall.Fill.SetSolidFill(Color.FromArgb(0xDC, 0xFA, 0xDD)); // Specify the pattern fill for the back wall. chart.View3D.BackWall.Fill.SetPatternFill(Color.FromArgb(0x9C, 0xFB, 0x9F), Color.WhiteSmoke, DevExpress.Spreadsheet.Drawings.ShapeFillPatternType.DiagonalBrick); SurfaceOptions floorOptions = chart.View3D.Floor; // Specify the floor color. floorOptions.Fill.SetSolidFill(Color.FromArgb(0xFA, 0xDC, 0xF9)); // Specify the floor border. floorOptions.Outline.SetSolidFill(Color.FromArgb(0xB4, 0x95, 0xDE)); floorOptions.Outline.Width = 1.25; #endregion #CustomWallsAndFloor }
public static PointInfo SelectPointColor(SurfaceOptions surfaceOptions = null) { if (surfaceOptions == null) { surfaceOptions = new SurfaceOptions(); } using (RectangleRegion surface = new RectangleRegion()) { surface.Config = surfaceOptions; surface.OneClickMode = true; surface.Prepare(); surface.ShowDialog(); if (surface.Result == SurfaceResult.Region) { PointInfo pointInfo = new PointInfo(); pointInfo.Position = CaptureHelpers.ClientToScreen(surface.OneClickPosition); pointInfo.Color = ((Bitmap)surface.SurfaceImage).GetPixel(surface.OneClickPosition.X, surface.OneClickPosition.Y); return(pointInfo); } } return(null); }
public ScreenColorPicker(TaskSettings taskSettings) { if (taskSettings != null) { surfaceOptions = taskSettings.CaptureSettings.SurfaceOptions; } else { surfaceOptions = new SurfaceOptions(); } InitializeComponent(); colorPicker.DrawCrosshair = true; colorTimer.Tick += colorTimer_Tick; colorTimer.Start(); UpdateColorPickerButtonText(); foreach (Control control in Controls) { if (control is NumericUpDown || control is TextBox) { control.DoubleClick += CopyToClipboard; } } }
public static PointInfo SelectPointColor(SurfaceOptions surfaceOptions = null) { using (Image fullscreen = Screenshot.CaptureFullscreen()) using (RectangleRegion surface = new RectangleRegion(fullscreen)) { if (surfaceOptions != null) { surface.Config = new SurfaceOptions { MagnifierPixelCount = surfaceOptions.MagnifierPixelCount, MagnifierPixelSize = surfaceOptions.MagnifierPixelSize }; } surface.OneClickMode = true; surface.Prepare(); surface.ShowDialog(); if (surface.Result == SurfaceResult.Region) { PointInfo pointInfo = new PointInfo(); pointInfo.Position = CaptureHelpers.ClientToScreen(surface.OneClickPosition); pointInfo.Color = ((Bitmap)fullscreen).GetPixel(surface.OneClickPosition.X, surface.OneClickPosition.Y); return(pointInfo); } } return(null); }
/* * Beautiful swiping functionality developed by Elvir and Nick of course, * It takes into consideration that a sweep wont be perfectly horizontal or * vertical. Oh, and yes it is a four way swipe. */ private void SwipeConfiguration() { int x1 = 0, x2 = 0, y1 = 0, y2 = 0, horizontal, vertical; ManipulationMode = ManipulationModes.TranslateX | ManipulationModes.TranslateY; ManipulationStarted += (s, e) => { x1 = (int)e.Position.X; y1 = (int)e.Position.Y; }; ManipulationCompleted += async(s, e) => { x2 = (int)e.Position.X; y2 = (int)e.Position.Y; horizontal = Math.Abs(x2 - x1); vertical = Math.Abs(y2 - y1); if (x1 > x2 && horizontal > vertical) { if (App.CurrSurface != 0) { App.CurrSurface--; } else { App.CurrSurface = 3; } } else if (x1 < x2 && horizontal > vertical) { if (App.CurrSurface < 3) { App.CurrSurface++; } else { App.CurrSurface = 0; } } else if (y1 > y2 && horizontal < vertical) { App.CurrSurface = 4; } else if (y1 < y2 && horizontal < vertical) { App.CurrSurface = 5; } // Surface name SwipeBlock.Text = SurfaceOptions.SurfaceSide(App.CurrSurface); // Update the current room _currentRoom = DatabaseRepository.GetRoom(_currentRoom.Title); // Converting from bytearray to BitmapImage and showing it. var img = await CameraServices.ToBitmapImage(_currentRoom.Surfaces[App.CurrSurface].SurfaceImage); SurfaceImage.Source = img; }; }
/// <summary> /// Creates a new instance of the <see cref="Surface2D"/> class. /// </summary> /// <param name="surface">The <see cref="PlatformNativeSurface"/> from which to create the surface.</param> /// <param name="options">The surface's configuration options.</param> /// <returns>The instance of <see cref="Surface2D"/> that was created.</returns> public static Surface2D Create(PlatformNativeSurface surface, SurfaceOptions options = SurfaceOptions.Default) { Contract.Require(surface, nameof(surface)); var uv = UltravioletContext.DemandCurrent(); return(uv.GetFactoryMethod <Surface2DFromNativeSurfaceFactory>()(uv, surface, options)); }
/// <summary> /// Creates a new instance of the <see cref="Surface2D"/> class. /// </summary> /// <param name="width">The surface's width in pixels.</param> /// <param name="height">The surface's height in pixels.</param> /// <param name="options">The surface's configuration options.</param> /// <returns>The instance of <see cref="Surface2D"/> that was created.</returns> public static Surface2D Create(Int32 width, Int32 height, SurfaceOptions options = SurfaceOptions.Default) { Contract.EnsureRange(width > 0, nameof(width)); Contract.EnsureRange(height > 0, nameof(height)); var uv = UltravioletContext.DemandCurrent(); return(uv.GetFactoryMethod <Surface2DFactory>()(uv, width, height, options)); }
public CreateSurfacesPage() { this.InitializeComponent(); this.NavigationCacheMode = NavigationCacheMode.Required; SwipeConfiguration(); SwipeBlock.Text = SurfaceOptions.SurfaceSide(App.CurrSurface); Application.Current.Suspending += new SuspendingEventHandler(App_Suspending); Application.Current.Resuming += new EventHandler <Object>(App_Resuming); }
/// <summary> /// Initializes a new instance of the <see cref="SDL2Surface2D"/> class. /// </summary> /// <param name="uv">The Ultraviolet context.</param> /// <param name="width">The width of the surface in pixels.</param> /// <param name="height">The height of the surface in pixels.</param> /// <param name="options">The surface's configuration options.</param> public SDL2Surface2D(UltravioletContext uv, Int32 width, Int32 height, SurfaceOptions options) : base(uv) { Contract.EnsureRange(width > 0, nameof(width)); Contract.EnsureRange(height > 0, nameof(height)); var isSrgb = (options & SurfaceOptions.SrgbColor) == SurfaceOptions.SrgbColor; var isLinear = (options & SurfaceOptions.LinearColor) == SurfaceOptions.LinearColor; if (isSrgb && isLinear) { throw new ArgumentException(UltravioletStrings.SurfaceCannotHaveMultipleEncodings); } this.nativesurf = new SDL2PlatformNativeSurface(width, height); this.SrgbEncoded = isLinear ? false : (isSrgb ? true : uv.Properties.SrgbDefaultForSurface2D); }
/// <summary> /// Initializes a new instance of the <see cref="SDL2Surface3D"/> class. /// </summary> /// <param name="uv">The Ultraviolet context.</param> /// <param name="width">The surface's width in pixels.</param> /// <param name="height">The surface's height in pixels.</param> /// <param name="depth">The surface's depth in pixels.</param> /// <param name="bytesPerPixel">The number of bytes used to represent a pixel on the surface.</param> /// <param name="options">The surface's configuration options.</param> public SDL2Surface3D(UltravioletContext uv, Int32 width, Int32 height, Int32 depth, Int32 bytesPerPixel, SurfaceOptions options) : base(uv) { Contract.EnsureRange(width > 0, nameof(width)); Contract.EnsureRange(height > 0, nameof(height)); Contract.EnsureRange(depth > 0, nameof(depth)); Contract.EnsureRange(bytesPerPixel == 3 || bytesPerPixel == 4, nameof(bytesPerPixel)); var isSrgb = (options & SurfaceOptions.SrgbColor) == SurfaceOptions.SrgbColor; var isLinear = (options & SurfaceOptions.LinearColor) == SurfaceOptions.LinearColor; if (isSrgb && isLinear) { throw new ArgumentException(UltravioletStrings.SurfaceCannotHaveMultipleEncodings); } this.width = width; this.height = height; this.bytesPerPixel = bytesPerPixel; this.layers = new Surface2D[depth]; this.layerOwnership = new Boolean[depth]; this.SrgbEncoded = isLinear ? false : (isSrgb ? true : uv.Properties.SrgbDefaultForSurface3D); }
/// <summary> /// Initializes a new instance of the <see cref="SDL2Surface2D"/> class. /// </summary> /// <param name="uv">The Ultraviolet context.</param> /// <param name="nativesurf">The native SDL surface that this object represents.</param> /// <param name="options">The surface's configuration options.</param> public SDL2Surface2D(UltravioletContext uv, PlatformNativeSurface nativesurf, SurfaceOptions options) : base(uv) { if (nativesurf == null) { throw new ArgumentNullException(nameof(nativesurf)); } var isSrgb = (options & SurfaceOptions.SrgbColor) == SurfaceOptions.SrgbColor; var isLinear = (options & SurfaceOptions.LinearColor) == SurfaceOptions.LinearColor; if (isSrgb && isLinear) { throw new ArgumentException(UltravioletStrings.SurfaceCannotHaveMultipleEncodings); } this.nativesurf = (SDL2PlatformNativeSurface)nativesurf; this.SrgbEncoded = isLinear ? false : (isSrgb ? true : uv.Properties.SrgbDefaultForSurface2D); }
/// <summary> /// Initializes a new instance of the <see cref="SDL2Surface2D"/> class. /// </summary> /// <param name="uv">The Ultraviolet context.</param> /// <param name="source">The surface source from which to create the surface.</param> /// <param name="options">The surface's configuration options.</param> public SDL2Surface2D(UltravioletContext uv, SurfaceSource source, SurfaceOptions options) : this(uv, new SDL2PlatformNativeSurface(source), options) { }
/// <summary> /// Creates a new instance of the <see cref="Surface3D"/> class. /// </summary> /// <param name="width">The surface's width in pixels.</param> /// <param name="height">The surface's height in pixels.</param> /// <param name="depth">The number of layers in the surface.</param> /// <param name="options">The surface's configuration options.</param> /// <returns>The instance of <see cref="Surface3D"/> which was created.</returns> public static Surface3D Create(Int32 width, Int32 height, Int32 depth, SurfaceOptions options = SurfaceOptions.Default) { return(Create(width, height, depth, 4, options)); }