public void Neither_Method(Object sender, ExecutedRoutedEventArgs e) { _labelMode = LabelMode.NONE; ResetButtonColors(new Button[] { btn_Wash, btn_Contact }); btn_Neither.Background = Brushes.LightGreen; }
/// <Summary> /// GetOppositeSide finds the opposite side (ie if LabelMode is left it returns right) /// </Summary> /// <Param name="labelMode">The LabelMode for this control</Param> private string GetOppositeSide(LabelMode labelMode) { switch (labelMode) { case LabelMode.Left: { return("right"); } case LabelMode.Right: { return("left"); } case LabelMode.Top: { return("bottom"); } case LabelMode.Bottom: { return("top"); } } return(string.Empty); }
private void None_Click(object sender, RoutedEventArgs e) { _labelMode = LabelMode.NONE; ResetButtonColors(new Button[] { btn_Wash, btn_Contact }); Button button = sender as Button; button.Background = Brushes.LightGreen; }
private void Contact_Click(object sender, RoutedEventArgs e) { _labelMode = LabelMode.CONTACT; ResetButtonColors(new Button[] { btn_Neither, btn_Wash }); Button button = sender as Button; button.Background = Brushes.LightGreen; }
public TextElementWindow(LabelMode labelMode = LabelMode.Label) { InitializeComponent(); contentPresenter.Content = new FontUserControl(); textViewModel = new TextElementViewModel(); DataContext = textViewModel; HelpContainer.Content = HelpResourceHelper.GetHelpButton("PrintMapTextHelp", HelpButtonMode.NormalButton); if (labelMode == LabelMode.Signature) { SignatureNameGroupBox.Visibility = Visibility.Visible; } }
private static string LabelToFilePath(LabelMode label) { if (label == LabelMode.WASH) { return("Wash"); } else if (label == LabelMode.CONTACT) { return("Contact"); } else { return("None"); } }
/// <summary> /// Initializes a new instance of the LabelModeAttribute class. /// </summary> /// <param name="mode">The label mode to apply to the associated property</param> public LabelModeAttribute(LabelMode mode) { _Mode = mode; }
public Label(string text, LabelMode labelMode = LabelMode.OverwriteText) { Text = text; _LabelMode = labelMode; }
/// <Summary> /// Initializes a new instance of the LabelModeAttribute class. /// </Summary> /// <Param name="mode"> /// The label mode to apply to the associated property /// </Param> public LabelModeAttribute(LabelMode mode) { this._Mode = mode; }
/// <Summary> /// GetOppositeSide finds the opposite side (ie if LabelMode is left it returns right) /// </Summary> /// <Param name="labelMode">The LabelMode for this control</Param> private string GetOppositeSide( LabelMode labelMode ) { switch( labelMode ) { case LabelMode.Left: { return "right"; } case LabelMode.Right: { return "left"; } case LabelMode.Top: { return "bottom"; } case LabelMode.Bottom: { return "top"; } } return string.Empty; }
public static ImageSource ToBitmap(this DepthFrame frame, string pathToDepthFolder, LabelMode label, Boolean saveImage, int session) { int width = frameWidth != -1 ? frameWidth : frame.FrameDescription.Width; int height = frameHeight != -1 ? frameHeight : frame.FrameDescription.Height; PixelFormat format = PixelFormats.Bgr32; ushort minDepth = frame.DepthMinReliableDistance; ushort maxDepth = frame.DepthMaxReliableDistance; ushort[] pixelData = new ushort[width * height]; byte[] pixels = new byte[width * height * (format.BitsPerPixel + 7) / 8]; frame.CopyFrameDataToArray(pixelData); int colorIndex = 0; for (int depthIndex = 0; depthIndex < pixelData.Length; ++depthIndex) { ushort depth = pixelData[depthIndex]; byte intensity = (byte)(depth >= minDepth && depth <= maxDepth ? depth : 0); pixels[colorIndex++] = intensity; // Blue pixels[colorIndex++] = intensity; // Green pixels[colorIndex++] = intensity; // Red ++colorIndex; } int stride = width * format.BitsPerPixel / 8; BitmapSource image = BitmapSource.Create(width, height, 96, 96, format, null, pixels, stride); if (saveImage) { SaveImage(pathToDepthFolder + "\\" + session + "\\" + LabelToFilePath(label) + "\\" + depthImageCount, image); depthImageCount++; } return(image); }
public static ImageSource ToBitmap(this ColorFrame frame, string pathToRgbFolder, LabelMode label, Boolean saveImage, int session) { int width = frameWidth != -1 ? frameWidth : frame.FrameDescription.Width; int height = frameHeight != -1 ? frameHeight : frame.FrameDescription.Height; // Changing resolution is as simple as changing aspect PixelFormat format = PixelFormats.Bgr32; byte[] pixels = new byte[width * height * ((format.BitsPerPixel + 7) / 8)]; if (frame.RawColorImageFormat == ColorImageFormat.Bgra) { frame.CopyRawFrameDataToArray(pixels); } else { frame.CopyConvertedFrameDataToArray(pixels, ColorImageFormat.Bgra); } int stride = (int)width * format.BitsPerPixel / 8; BitmapSource image = BitmapSource.Create(width, height, 96, 96, format, null, pixels, stride); if (saveImage) { SaveImage(pathToRgbFolder + "\\" + session + "\\" + LabelToFilePath(label) + "\\" + rgbImageCount, image); rgbImageCount++; } return(image); }
public static ImageSource ToBitmap(this InfraredFrame frame, string pathToInfraredFolder, LabelMode label, Boolean saveImage, int session) { int width = frameWidth != -1 ? frameWidth : frame.FrameDescription.Width; int height = frameHeight != -1 ? frameHeight : frame.FrameDescription.Height; PixelFormat format = PixelFormats.Bgr32; ushort[] frameData = new ushort[width * height]; byte[] pixels = new byte[width * height * (format.BitsPerPixel + 7) / 8]; frame.CopyFrameDataToArray(frameData); int colorIndex = 0; for (int infraredIndex = 0; infraredIndex < frameData.Length; infraredIndex++) { ushort ir = frameData[infraredIndex]; byte intensity = (byte)(ir >> 7); pixels[colorIndex++] = (byte)(intensity / 1); // Blue pixels[colorIndex++] = (byte)(intensity / 1); // Green pixels[colorIndex++] = (byte)(intensity / 0.4); // Red colorIndex++; } int stride = width * format.BitsPerPixel / 8; BitmapSource image = BitmapSource.Create(width, height, 96, 96, format, null, pixels, stride); if (saveImage) { SaveImage(pathToInfraredFolder + "\\" + session + "\\" + LabelToFilePath(label) + "\\" + infraredImageCount, image); infraredImageCount++; } return(image); }
public CulvertView() { mCurrentSection = null; mViewMode = ViewMode.Section; mOutputMode = OutputMode.ServiceCombination; mLoadMode = LoadMode.EarthFill; mLabelMode = LabelMode.None; mEnvelopeMode = EnvelopeMode.Envelope; mDrawingPadding = 50; mDimensionOffset = 0.2f; mTextSize = 0.1f; mFormWorkColor = Color.DarkBlue; mShadingColor = Color.LightGray; mDimensionColor = Color.Black; mLoadColor = Color.Black; mNegativeForceColor = Color.Red; mPositiveForceColor = Color.Blue; mEnvelopeForceColor = Color.Purple; mFillTransparency = 0.65f; mLineThickness = 3.0f; mDimensionLineThickness = 1.0f; ResizeRedraw = true; InitializeComponent(); }