public void BindComponent(ref PictureBox manShape, SplitterPanel manPanel) { this.manImage = manShape; this.manPanel = manPanel; //set manImage size this.manImage.Width = (int)(3 / 4.0 * this.manImage.Height); manImageHeight = this.manImage.Height; manImageWidth = this.manImage.Width; this.manImage.SizeMode = PictureBoxSizeMode.StretchImage; //copy the manImage to barImage this.barImage = new PictureBox(); this.barImage.Parent = this.manImage; this.barImage.Location = new Point(0, 0); this.barImage.Size = this.manImage.Size; this.barImage.BackColor = Color.Transparent; this.barImage.SizeMode = PictureBoxSizeMode.StretchImage; barBrush = new TextureBrush(global::HitBrick_WinForm.Properties.Resources.bar); barImageBitmap = new Bitmap(barImage.Width, barImage.Height); barImage.Image = barImageBitmap; barImageGraphic = Graphics.FromImage(barImage.Image); type = BarWidth.NORMAL; }
public override void Draw(BaseScreen.Resources screenResources, SmartSpriteBatch spriteBatch, ScreenAbstractor screen, float opacity, FloatRectangle?clip = null, Texture2D bgTexture = null, Vector2?scrollOffset = null) { float width = ActualPosition.Width; float height = ActualPosition.Height; float barWidth = BarWidth.Value(); if (barWidth == 0) { barWidth = 0.001f; } float availableWidth = width - barWidth; float percentage = Value.Value() / MaxValue.Value(); float sliderHeight = SliderHeight.Value(); if (sliderHeight == 0) { sliderHeight = 0.001f; } float sliderTop = (height / 2f) - (sliderHeight / 2f); FloatRectangle sliderRect = new FloatRectangle(0 + ActualPosition.X, sliderTop + ActualPosition.Y, width, sliderHeight); FloatRectangle barRect = new FloatRectangle(availableWidth * percentage + ActualPosition.X, ActualPosition.Y, barWidth, height); if (SliderTexture.HasValue()) { using (new SmartSpriteBatchManager(Solids.Instance.SpriteBatch)) { spriteBatch.Draw(Solids.Instance.AssetLibrary.GetTexture(SliderTexture.Value(), true), screen.Translate(sliderRect).Value.ToRectangle, Color.White); } } else { spriteBatch.DrawSolidRectangle(screen.Translate(sliderRect).Value, SliderColor.Value().Value *opacity, clip); } if (BarTexture.HasValue()) { using (new SmartSpriteBatchManager(Solids.Instance.SpriteBatch)) { spriteBatch.Draw(Solids.Instance.AssetLibrary.GetTexture(BarTexture.Value(), true), screen.Translate(barRect).Value.ToRectangle, Color.White); } } else { spriteBatch.DrawSolidRectangle(screen.Translate(barRect).Value, BarColor.Value().Value *opacity, clip); } }
public byte[] SetBarWidth(BarWidth width) { return(new[] { Cmd.GS, Barcodes.SetBarWidth, (byte)width }); }
public byte[] SetBarWidth(BarWidth width) => new byte[] { Cmd.GS, Barcodes.SetBarWidth, (byte)width };
public DirectPrinter SetBarWidth(BarWidth width) { UpdateBuffer(this.Emitter.SetBarWidth(width)); return(this); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { int hashCode = 41; if (Uri != null) { hashCode = hashCode * 59 + Uri.GetHashCode(); } if (ChartId != null) { hashCode = hashCode * 59 + ChartId.GetHashCode(); } if (ServiceId != null) { hashCode = hashCode * 59 + ServiceId.GetHashCode(); } if (ItemId != null) { hashCode = hashCode * 59 + ItemId.GetHashCode(); } if (BarWidth != null) { hashCode = hashCode * 59 + BarWidth.GetHashCode(); } if (BorderWidth != null) { hashCode = hashCode * 59 + BorderWidth.GetHashCode(); } if (Angle != null) { hashCode = hashCode * 59 + Angle.GetHashCode(); } if (Rotate != null) { hashCode = hashCode * 59 + Rotate.GetHashCode(); } if (BarAngle != null) { hashCode = hashCode * 59 + BarAngle.GetHashCode(); } if (LineCap != null) { hashCode = hashCode * 59 + LineCap.GetHashCode(); } if (ScaleMin != null) { hashCode = hashCode * 59 + ScaleMin.GetHashCode(); } if (ScaleMax != null) { hashCode = hashCode * 59 + ScaleMax.GetHashCode(); } if (Title != null) { hashCode = hashCode * 59 + Title.GetHashCode(); } if (Units != null) { hashCode = hashCode * 59 + Units.GetHashCode(); } if (Group != null) { hashCode = hashCode * 59 + Group.GetHashCode(); } if (FloorplanId != null) { hashCode = hashCode * 59 + FloorplanId.GetHashCode(); } return(hashCode); } }
/// <summary> /// Returns true if DashboardWidgetOptionsBean instances are equal /// </summary> /// <param name="input">Instance of DashboardWidgetOptionsBean to be compared</param> /// <returns>Boolean</returns> public bool Equals(DashboardWidgetOptionsBean input) { if (input == null) { return(false); } return (( Uri == input.Uri || (Uri != null && Uri.Equals(input.Uri)) ) && ( ChartId == input.ChartId || (ChartId != null && ChartId.Equals(input.ChartId)) ) && ( ServiceId == input.ServiceId || (ServiceId != null && ServiceId.Equals(input.ServiceId)) ) && ( ItemId == input.ItemId || (ItemId != null && ItemId.Equals(input.ItemId)) ) && ( BarWidth == input.BarWidth || (BarWidth != null && BarWidth.Equals(input.BarWidth)) ) && ( BorderWidth == input.BorderWidth || (BorderWidth != null && BorderWidth.Equals(input.BorderWidth)) ) && ( Angle == input.Angle || (Angle != null && Angle.Equals(input.Angle)) ) && ( Rotate == input.Rotate || (Rotate != null && Rotate.Equals(input.Rotate)) ) && ( BarAngle == input.BarAngle || (BarAngle != null && BarAngle.Equals(input.BarAngle)) ) && ( LineCap == input.LineCap || (LineCap != null && LineCap.Equals(input.LineCap)) ) && ( ScaleMin == input.ScaleMin || (ScaleMin != null && ScaleMin.Equals(input.ScaleMin)) ) && ( ScaleMax == input.ScaleMax || (ScaleMax != null && ScaleMax.Equals(input.ScaleMax)) ) && ( Title == input.Title || (Title != null && Title.Equals(input.Title)) ) && ( Units == input.Units || (Units != null && Units.Equals(input.Units)) ) && ( Group == input.Group || (Group != null && Group.Equals(input.Group)) ) && ( FloorplanId == input.FloorplanId || (FloorplanId != null && FloorplanId.Equals(input.FloorplanId)) )); }
public void EventTest_CalculateWidthOfDateTime_SetBox_BoxStart( string id, DateTime dayStart, DateTime dayEnd, DateTime start, DateTime end, string text, int fontSize, int cellDuration, int cellWidth, BarWidth barWidth) { var ev = new DayPilot.Web.Ui.Event(id, dayStart, dayEnd, start, end,