static MyCanvasGL() { _stringFormat = new System.Drawing.StringFormat(System.Drawing.StringFormat.GenericDefault); _stringFormat.FormatFlags = System.Drawing.StringFormatFlags.NoClip | System.Drawing.StringFormatFlags.MeasureTrailingSpaces; //--------------------------- defaultFontInfo = CanvasGLPlatform.PlatformGetFont("Tahoma", 10, FontLoadTechnique.GdiBitmapFont); }
void PrintHeader(System.Drawing.Graphics g, System.Drawing.Rectangle bounds, ref int yPosition) { int xPosition = bounds.Left; System.Drawing.StringFormat sf = new System.Drawing.StringFormat(); sf.Alignment = System.Drawing.StringAlignment.Center; g.DrawString(StringTable.Wishlist, printFontHeader, System.Drawing.Brushes.Black, new System.Drawing.RectangleF(xPosition, yPosition, bounds.Width, printFontHeader.Height), sf); sf.Alignment = System.Drawing.StringAlignment.Far; // Seitennummer, rechtsbündig sf.LineAlignment = System.Drawing.StringAlignment.Far; g.DrawString(string.Format("{0} {1}", StringTable.Page, currentPage), printFont, System.Drawing.Brushes.Black, new System.Drawing.RectangleF(xPosition, yPosition, bounds.Width, printFontHeader.Height), sf); sf.Alignment = System.Drawing.StringAlignment.Near; // Datum, linkgsbündig g.DrawString(DateTime.Now.ToShortDateString(), printFont, System.Drawing.Brushes.Black, new System.Drawing.RectangleF(xPosition, yPosition, bounds.Width, printFontHeader.Height), sf); yPosition += printFontHeader.Height + printFont.Height; int xSize = bounds.Width / 4; g.DrawString(StringTable.Artist, printFont, System.Drawing.Brushes.Black, new System.Drawing.PointF(xPosition, yPosition)); xPosition += xSize; g.DrawString(StringTable.Title, printFont, System.Drawing.Brushes.Black, new System.Drawing.PointF(xPosition, yPosition)); xPosition += xSize; g.DrawString(StringTable.From, printFont, System.Drawing.Brushes.Black, new System.Drawing.PointF(xPosition, yPosition)); xPosition += xSize; g.DrawString(StringTable.Comment, printFont, System.Drawing.Brushes.Black, new System.Drawing.PointF(xPosition, yPosition)); xPosition += xSize; yPosition += printFont.Height; g.DrawLine(System.Drawing.Pens.Black, bounds.Left, yPosition, bounds.Right, yPosition); yPosition += printFont.Height / 3; }
private System.Drawing.Point GetCharSize(System.Drawing.Graphics CurGraphics) { //prntSome.printSome("GetCharSize"); // DrawString doesn't actually print where you tell it to but instead consistently prints // with an offset. This is annoying when the other draw commands do not print with an offset // this method returns a point defining the offset so we can take it off the printstring command. System.Drawing.CharacterRange[] characterRanges = { new System.Drawing.CharacterRange(0, 1) }; System.Drawing.RectangleF layoutRect = new System.Drawing.RectangleF(0, 0, 100, 100); System.Drawing.StringFormat stringFormat = new System.Drawing.StringFormat(); stringFormat.SetMeasurableCharacterRanges(characterRanges); System.Drawing.Region[] stringRegions = new System.Drawing.Region[1]; stringRegions = CurGraphics.MeasureCharacterRanges( "A", this.Font, layoutRect, stringFormat); System.Drawing.RectangleF measureRect1 = stringRegions[0].GetBounds(CurGraphics); return(new System.Drawing.Point((int)(measureRect1.Width + 0.5), (int)(measureRect1.Height + 0.5))); }
public override void Draw(System.Drawing.Graphics g) { System.Drawing.StringFormat format = new System.Drawing.StringFormat(); format.Alignment = this.m_HorizontalAlignment; format.LineAlignment = this.m_VerticalAlignment; System.Drawing.Drawing2D.GraphicsContainer gContainer = g.BeginContainer(); System.Drawing.Drawing2D.Matrix myMatrix = g.Transform; float X = (float)this.X; float Y = (float)this.Y; if (m_Rotation != 0) { myMatrix.RotateAt((float)(m_Rotation), new System.Drawing.PointF(X, Y), System.Drawing.Drawing2D.MatrixOrder.Append); g.Transform = myMatrix; } if (m_AutoSize) { System.Drawing.SizeF mySize = g.MeasureString(m_Text, m_Font); m_Size.Width = (int)mySize.Width; m_Size.Height = (int)mySize.Height; g.DrawString(m_Text, m_Font, new System.Drawing.SolidBrush(m_Color), X, Y, format); } else { System.Drawing.RectangleF rect = new System.Drawing.RectangleF(X, Y, (float)m_Size.Width, (float)m_Size.Height); g.DrawString(m_Text, m_Font, new System.Drawing.SolidBrush(m_Color), rect, format); } g.EndContainer(gContainer); }
public static int CharacterLength(char c, float fontSize, string fontName) { System.Drawing.Bitmap holderBmp = new System.Drawing.Bitmap(1, 1); System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(holderBmp); //bool needRF = needRefresh; if (c == ' ') { } string text = "" + c; System.Drawing.SizeF size = g.MeasureString(text, new System.Drawing.Font(fontName, fontSize)); System.Drawing.Font font = new System.Drawing.Font(fontName, fontSize); System.Drawing.StringFormat format = new System.Drawing.StringFormat(); format.FormatFlags = System.Drawing.StringFormatFlags.MeasureTrailingSpaces; System.Drawing.CharacterRange[] ranges = new System.Drawing.CharacterRange[] { new System.Drawing.CharacterRange(0, 1) }; format.SetMeasurableCharacterRanges(ranges); System.Drawing.Rectangle sdRect = new System.Drawing.Rectangle(0, 0, (int)(size.Width + 0.5), (int)(size.Height + 0.5)); System.Drawing.Region[] regions = g.MeasureCharacterRanges(text, font, sdRect, format); System.Drawing.RectangleF rectF = regions[0].GetBounds(g); //needRefresh = needRF; holderBmp.Dispose(); return((int)(rectF.Width * (c == ' ' ? 1.7 : 1) + 0.5)); }
private void Form1_Paint(object sender, PaintEventArgs e) { var formGraphics = e.Graphics; string drawString1 = "Windows Store Edition"; System.Drawing.Font drawFont1 = new System.Drawing.Font("Microsoft Sans Serif", 22, System.Drawing.FontStyle.Bold); System.Drawing.SolidBrush drawBrush1 = new System.Drawing.SolidBrush(System.Drawing.Color.White); float x1 = 34.0F; float y1 = 148.0F; System.Drawing.StringFormat drawFormat1 = new System.Drawing.StringFormat(); formGraphics.DrawString(drawString1, drawFont1, drawBrush1, x1, y1, drawFormat1); //377; 171 string drawString2 = "V22 21-01-2021"; System.Drawing.Font drawFont2 = new System.Drawing.Font("Microsoft Sans Serif", 8, System.Drawing.FontStyle.Bold); System.Drawing.SolidBrush drawBrush2 = new System.Drawing.SolidBrush(System.Drawing.Color.White); float x2 = 358.0F; float y2 = 164.0F; System.Drawing.StringFormat drawFormat2 = new System.Drawing.StringFormat(); formGraphics.DrawString(drawString2, drawFont2, drawBrush2, x2, y2, drawFormat2); drawFont1.Dispose(); drawBrush1.Dispose(); drawFont2.Dispose(); drawBrush2.Dispose(); formGraphics.Dispose(); }
private void DrawAuthor() { System.Drawing.Font font = new System.Drawing.Font("宋体", 42, System.Drawing.FontStyle.Bold); System.Drawing.Brush brush = new System.Drawing.SolidBrush(System.Drawing.Color.Black); System.Drawing.StringFormat format = new System.Drawing.StringFormat { Alignment = System.Drawing.StringAlignment.Center }; System.Drawing.RectangleF rect = new System.Drawing.RectangleF(0, 280, Constants.ImageWidth, 60); if (this.saveOption.ProductRegion == ProductRegionEnum.Region || (this.saveOption.ProductRegion == ProductRegionEnum.Country && this.isTemplate20 && (this.saveOption.ProductType == ProductTypeEnum.Disaster || this.saveOption.ProductType == ProductTypeEnum.Flood))) { rect = new System.Drawing.RectangleF(1600, 1453, Constants.ImageWidth - 1600, 60); font = new System.Drawing.Font("宋体", 28, System.Drawing.FontStyle.Bold); } string author = "中央气象台"; if (this.saveOption.ProductRegion == ProductRegionEnum.Country && this.isTemplate20 && this.saveOption.ProductType == ProductTypeEnum.Disaster) { author = "国土资源部 中国气象局"; } if (this.saveOption.ProductRegion == ProductRegionEnum.Country && this.isTemplate20 && this.saveOption.ProductType == ProductTypeEnum.Flood) { author = "水利部 中国气象局"; } this.graphics.DrawString(author, font, brush, rect, format); }
public void AddTextWatermark(string strOraginalPath) { if (string.IsNullOrEmpty(_strWatermarkText))//如果水印文字为空 { return; } System.Drawing.Image imgOraginal = System.Drawing.Image.FromFile(strOraginalPath); int iWidth = imgOraginal.Width; int iHeight = imgOraginal.Height; System.Drawing.Bitmap bitOraginal = new System.Drawing.Bitmap(imgOraginal, iWidth, iHeight); imgOraginal.Dispose(); System.Drawing.Graphics gOraginal = System.Drawing.Graphics.FromImage(bitOraginal); System.Drawing.Rectangle rectTextField = new System.Drawing.Rectangle(10, 10, iWidth - 20, iHeight - 20); System.Drawing.StringFormat sf = GetStringFormat(); System.Drawing.SolidBrush brush = new System.Drawing.SolidBrush(System.Drawing.Color.FromArgb(_btWatermarkTransparency /*文字的透明度*/, _fontWatermarkColor)); gOraginal.DrawString(_strWatermarkText, _fontWatermarkFont, brush, rectTextField, sf); sf.Dispose(); brush.Dispose(); bitOraginal.Save(strOraginalPath, System.Drawing.Imaging.ImageFormat.Jpeg); gOraginal.Dispose(); bitOraginal.Dispose(); }
public void ListeAusgabe(System.Drawing.Graphics zeichenflaeche, System.Drawing.RectangleF flaesche) { //ein Temporär Pinsel erzeugen System.Drawing.SolidBrush tempPinsle = new System.Drawing.SolidBrush(System.Drawing.Color.White); //die schriftart setzen System.Drawing.Font tempSchrift = new System.Drawing.Font("Arial", 12, System.Drawing.FontStyle.Bold); //für die zentrierte ausgabe System.Drawing.StringFormat ausrichtung = new System.Drawing.StringFormat(); //Koordinaten für die ausgabe float punkteX, nameX, y; punkteX = flaesche.Left + 50; nameX = flaesche.Left + 250; y = flaesche.Top + 50; //die ausrichtung ist zentriert ausrichtung.Alignment = System.Drawing.StringAlignment.Center; //die zeichenflaeche löschen zeichenflaeche.Clear(System.Drawing.Color.Black); //den Titel ausgeben zeichenflaeche.DrawString("Bestenliste", tempSchrift, tempPinsle, flaesche.Width / 2, y, ausrichtung); //und nun die liste selbst for (int i = 0; i < anzahl; i++) { y += 20; zeichenflaeche.DrawString(Convert.ToString(bestenListe[i].GetPunkte()), tempSchrift, tempPinsle, punkteX, y); zeichenflaeche.DrawString(Convert.ToString(bestenListe[i].GetName()), tempSchrift, tempPinsle, nameX, y); } }
private void Initialize() { this.Font = new System.Drawing.Font("MS ゴシック", 9); this.brush = System.Drawing.Brushes.Black; this.strPosition = new System.Drawing.PointF(0, 0); this.format = new System.Drawing.StringFormat(); }
protected static void DrawString(System.Drawing.Graphics graphics, string s, System.Drawing.Font font, System.Drawing.Brush brush, float x, float y) { System.Drawing.StringFormat stringFormat = new System.Drawing.StringFormat(System.Drawing.StringFormat.GenericTypographic); stringFormat.FormatFlags = stringFormat.FormatFlags | System.Drawing.StringFormatFlags.MeasureTrailingSpaces; stringFormat.SetMeasurableCharacterRanges(new System.Drawing.CharacterRange[] { new System.Drawing.CharacterRange(0, s.Length) }); stringFormat.SetTabStops(0, new float[] { 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80 }); graphics.DrawString(s, font, brush, x, y, stringFormat); }
static MyScreenCanvas() { _stringFormat = new System.Drawing.StringFormat(System.Drawing.StringFormat.GenericDefault); _stringFormat.FormatFlags = System.Drawing.StringFormatFlags.NoClip | System.Drawing.StringFormatFlags.MeasureTrailingSpaces; //--------------------------- defaultGdiFont = new System.Drawing.Font("tahoma", 10); defaultHFont = defaultGdiFont.ToHfont(); }
public abstract bool DrawString( System.Drawing.Graphics graphics, System.Drawing.FontFamily fontFamily, System.Drawing.FontStyle fontStyle, int fontSize, string strText, System.Drawing.Rectangle rtDraw, System.Drawing.StringFormat strFormat);
/// <summary> /// 处理水印文字位置 /// </summary> /// <returns></returns> private System.Drawing.StringFormat GetStringFormat() { System.Drawing.StringFormat sf = new System.Drawing.StringFormat(); switch (_enumWatermarkPosition) { case WatermarkPosition.TopLeft: sf.Alignment = System.Drawing.StringAlignment.Near; sf.LineAlignment = System.Drawing.StringAlignment.Near; break; case WatermarkPosition.TopCenter: sf.Alignment = System.Drawing.StringAlignment.Center; sf.LineAlignment = System.Drawing.StringAlignment.Near; break; case WatermarkPosition.TopRight: sf.Alignment = System.Drawing.StringAlignment.Far; sf.LineAlignment = System.Drawing.StringAlignment.Near; break; case WatermarkPosition.MiddleLeft: sf.Alignment = System.Drawing.StringAlignment.Near; sf.LineAlignment = System.Drawing.StringAlignment.Center; break; case WatermarkPosition.MiddleCenter: sf.Alignment = System.Drawing.StringAlignment.Center; sf.LineAlignment = System.Drawing.StringAlignment.Center; break; case WatermarkPosition.MiddleRight: sf.Alignment = System.Drawing.StringAlignment.Far; sf.LineAlignment = System.Drawing.StringAlignment.Center; break; case WatermarkPosition.BottomLeft: sf.Alignment = System.Drawing.StringAlignment.Near; sf.LineAlignment = System.Drawing.StringAlignment.Far; break; case WatermarkPosition.BottomCenter: sf.Alignment = System.Drawing.StringAlignment.Center; sf.LineAlignment = System.Drawing.StringAlignment.Far; break; case WatermarkPosition.BottomRight: sf.Alignment = System.Drawing.StringAlignment.Far; sf.LineAlignment = System.Drawing.StringAlignment.Far; break; default: sf.Alignment = System.Drawing.StringAlignment.Center; sf.LineAlignment = System.Drawing.StringAlignment.Far; break; } return(sf); }
public XnaDrawText(float x, float y) { //Font = new System.Drawing.Font(LastFontText.FontFamily, LastFontText.Size * Zoom); Font = XnaDrawing.defaultFont; Text = LastInputText; TextAnchor = new System.Drawing.StringFormat(XnaDrawText.LastStringFormat); Rectangle = new Rectangle((int)(x * Zoom), (int)(y * Zoom), 0, 0); Initialize(); }
public XnaDrawText() { //Font = new System.Drawing.Font("Microsoft Sans Serif", 9 * Zoom); Font = XnaDrawing.defaultFont; Text = ""; SetRectangle(0, 0, 1, 1); Initialize(); TextAnchor = new System.Drawing.StringFormat(); }
public static System.Drawing.SizeF MeasureString(System.Drawing.Graphics graphics, string s, System.Drawing.Font font) { System.Drawing.StringFormat stringFormat = new System.Drawing.StringFormat(System.Drawing.StringFormat.GenericTypographic); stringFormat.FormatFlags = stringFormat.FormatFlags | System.Drawing.StringFormatFlags.MeasureTrailingSpaces; stringFormat.SetMeasurableCharacterRanges(new System.Drawing.CharacterRange[] { new System.Drawing.CharacterRange(0, s.Length) }); stringFormat.SetTabStops(0, new float[] { 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80 }); System.Drawing.Region[] regions = graphics.MeasureCharacterRanges(s, font, new System.Drawing.RectangleF(0, 0, s.Length * font.Height, font.Height), stringFormat); System.Drawing.RectangleF rect = regions[0].GetBounds(graphics); return(rect.Size); }
public void Draw(IDrawingContext context) { System.Drawing.SolidBrush drawBrush = new System.Drawing.SolidBrush(System.Drawing.Color.FromName(context.Color)); System.Drawing.StringFormat drawFormat = new System.Drawing.StringFormat(); System.Drawing.Font drawFont = new System.Drawing.Font(context.FontStyle, context.FontSize); var graphics = context.Graphics; graphics.DrawString(text, drawFont, drawBrush, x, y, drawFormat); }
protected override void OnPaint(PaintEventArgs e) { base.OnPaint(e); Random rnd = new Random(); Rectangle bounds = new Rectangle(this.SIDE_GETTER, this.TOP_GETTER, this.MAX_WIDTH, this.MAX_HEIGHT); System.Drawing.SolidBrush c = new System.Drawing.SolidBrush(System.Drawing.Color.FromArgb(255, 255, 255, 255)); e.Graphics.FillRectangle(c, this.SIDE_GETTER, this.TOP_GETTER, this.MAX_WIDTH, this.MAX_HEIGHT); rectangles = new Collection <IRectangle>(); store = new RectanglesStore(); int[] tops = new int[] { 776, 435, 869, 141, 700, 791, 957, 66, 252, 450, 806, 48, 124, 384, 440, 693, 42, 301, 602, 519, 630, 597, 523 }; System.Drawing.Font drawFont = new System.Drawing.Font("Arial", 8); System.Drawing.StringFormat drawFormat = new System.Drawing.StringFormat(); System.Drawing.SolidBrush drawBrush = new System.Drawing.SolidBrush(System.Drawing.Color.Black); foreach (int top in tops) { int w = rnd.Next(20, this.MAX_WIDTH / 3); int h = rnd.Next(20, this.MAX_HEIGHT / 3); int x = rnd.Next(this.SIDE_GETTER, this.MAX_WIDTH); int y = top; // rnd.Next(this.TOP_GETTER, this.MAX_HEIGHT); #region rectangle size fixes if ((w + x) > this.MAX_WIDTH) { w -= ((w + x) - this.MAX_WIDTH); w += this.SIDE_GETTER; } if ((h + y) > this.MAX_HEIGHT) { h -= ((h + y) - this.MAX_HEIGHT); h += this.TOP_GETTER; } #endregion rectangles.Add(new Rectangle(x, y, w, h)); System.Drawing.SolidBrush color = new System.Drawing.SolidBrush(System.Drawing.Color.FromArgb(50, rnd.Next(256), rnd.Next(256), rnd.Next(256))); e.Graphics.DrawString(string.Format("X: {0}, Y: {1}", x, y), drawFont, drawBrush, x, y, drawFormat); e.Graphics.FillRectangle(color, x, y, w, h); } store.initialize(bounds: bounds, rectangles: rectangles); }
public static Size GetTextDimension( System.Drawing.Graphics g, System.Drawing.Font font, string text, System.Drawing.StringFormat stringFormat, System.Drawing.SizeF textSize) { var result = g.MeasureString(text, font, textSize, stringFormat); return(new Size(Math.Ceiling(result.Width), Math.Ceiling(result.Height))); }
private void gridView1_CustomDrawFooter(object sender, DevExpress.XtraGrid.Views.Base.RowObjectCustomDrawEventArgs e) { e.Graphics.FillRectangle(new System.Drawing.SolidBrush(System.Drawing.Color.FromArgb(225, 244, 255)), e.Bounds); var footerText = "已选择交易记录数:" + this.gridView1.GetSelectedRows().Where(x => x > -1).Count().ToString(); var outStringFormat = new System.Drawing.StringFormat(); outStringFormat.Alignment = System.Drawing.StringAlignment.Near; outStringFormat.LineAlignment = System.Drawing.StringAlignment.Center; e.Graphics.DrawString(footerText, new System.Drawing.Font("Arial", 11, System.Drawing.FontStyle.Bold), new System.Drawing.SolidBrush(System.Drawing.Color.Black), e.Bounds, outStringFormat); e.Handled = true; }
private void UpdateTextArea(System.Drawing.PointF origin) { using (System.Drawing.Graphics g = System.Drawing.Graphics.FromHwnd(System.IntPtr.Zero)) { System.Drawing.StringFormat sf = (System.Drawing.StringFormat)_format.Clone(); sf.FormatFlags |= System.Drawing.StringFormatFlags.MeasureTrailingSpaces; sf.Trimming = System.Drawing.StringTrimming.Character; sf.SetMeasurableCharacterRanges(new System.Drawing.CharacterRange[] { new System.Drawing.CharacterRange(0, _text.Length) }); g.PageUnit = System.Drawing.GraphicsUnit.Point; g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; System.Drawing.SizeF textSize = g.MeasureString(_text, _font, origin, sf); float x, y; switch (_format.Alignment) { case System.Drawing.StringAlignment.Far: x = origin.X - textSize.Width; break; case System.Drawing.StringAlignment.Center: x = origin.X - textSize.Width / 2; break; case System.Drawing.StringAlignment.Near: x = origin.X; break; default: throw new Aurigma.GraphicsMill.UnexpectedException(); } switch (_format.LineAlignment) { case System.Drawing.StringAlignment.Far: y = origin.Y - textSize.Height; break; case System.Drawing.StringAlignment.Center: y = origin.Y - textSize.Height / 2; break; case System.Drawing.StringAlignment.Near: y = origin.Y; break; default: throw new Aurigma.GraphicsMill.UnexpectedException(); } _textArea = new System.Drawing.RectangleF(x, y, textSize.Width, textSize.Height); } }
private void DrawPublishDate() { System.Drawing.Font font = new System.Drawing.Font("宋体", 28, System.Drawing.FontStyle.Bold); System.Drawing.Brush brush = new System.Drawing.SolidBrush(System.Drawing.Color.Black); System.Drawing.RectangleF rect = new System.Drawing.RectangleF(1600, 1513, Constants.ImageWidth - 1600, 60); System.Drawing.StringFormat format = new System.Drawing.StringFormat { Alignment = System.Drawing.StringAlignment.Center }; this.graphics.DrawString(this.publishDate, font, brush, rect, format); }
private void PaintTileInternal(MapLayer item, System.Drawing.Rectangle dest, int x, int y, System.Drawing.Graphics g) { short data = item.Data[x, y]; if (item.Type == MapLayerType.Tile) { g.DrawImage( this.tileset[data], dest ); } else if (item.Type == MapLayerType.HalfBlockShadow) { for (int shadow = 0; shadow < 4; shadow++) { if ((data & (1 << shadow)) != 0) { g.FillRectangle( shadowBrush, dest.X + (shadow % 2) * size.Width / 2, dest.Y + (shadow / 2) * size.Height / 2, size.Width / 2, size.Height / 2 ); } } } else if (item.Type == MapLayerType.TilesetLabel) { if (data == -1) { return; } if (data == -2) { g.FillRectangle(System.Drawing.Brushes.Black, dest); return; } if (data >= 0 && item.Storage.ContainsKey(data.ToString())) { g.FillRectangle(System.Drawing.Brushes.Black, dest); string s = item.Storage[data.ToString()] as string; System.Drawing.StringFormat sf = new System.Drawing.StringFormat(); sf.LineAlignment = System.Drawing.StringAlignment.Center; sf.Alignment = System.Drawing.StringAlignment.Center; g.DrawString(s, this.Font, System.Drawing.Brushes.White, dest, sf); } } }
private CharSize InternalMeasureChar(char ch) { Debug.Assert(CharUtil.CanDraw(ch)); using (var sf = new System.Drawing.StringFormat(System.Drawing.StringFormat.GenericTypographic)) { var g = _measureCharOffscreen.Graphics; sf.SetMeasurableCharacterRanges(new[] { new System.Drawing.CharacterRange(0, 1) }); var text = ch + "a"; // 文字がスペースの場合にサイズが0になってしまうので、その回避 var regions = g.MeasureCharacterRanges(text, _font, new System.Drawing.RectangleF(0, 0, 1000, 1000), sf); System.Drawing.RectangleF rect = regions[0].GetBounds(g); return(new CharSize(rect.Width, rect.Height)); } }
private bool showPadNumberOnPad(int i) { bool ret = false; //return false means everything went OK //Show number on the Pad try { if (isConnected()) { //Create bitmap wgssSTU.ICapability m_capability = m_tablet.getCapability(); wgssSTU.ProtocolHelper protocolHelper = new wgssSTU.ProtocolHelper(); System.Drawing.Bitmap m_bitmap = new System.Drawing.Bitmap(m_capability.screenWidth, m_capability.screenHeight); System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(m_bitmap); g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAlias; g.FillRectangle(System.Drawing.Brushes.White, 0, 0, m_bitmap.Width, m_bitmap.Height); System.Drawing.StringFormat strFormat = new System.Drawing.StringFormat(); strFormat.Alignment = System.Drawing.StringAlignment.Center; strFormat.LineAlignment = System.Drawing.StringAlignment.Center; double dpi = DpiInfo.GetDpi(); g.DrawString("" + i, new System.Drawing.Font("Tahoma", (int)(m_bitmap.Height / (1.2 * dpi))), System.Drawing.Brushes.Black, new System.Drawing.RectangleF(0, 0, m_bitmap.Width, m_bitmap.Height), strFormat); g.Dispose(); //Convert bitmap to device-native format System.IO.MemoryStream stream = new System.IO.MemoryStream(); m_bitmap.Save(stream, System.Drawing.Imaging.ImageFormat.Png); byte[] m_bitmapData = (byte[])protocolHelper.resizeAndFlatten(stream.ToArray(), 0, 0, (uint)m_bitmap.Width, (uint)m_bitmap.Height, m_capability.screenWidth, m_capability.screenHeight, (byte)m_encodingMode, wgssSTU.Scale.Scale_Fit, 0, 0); // Write image. note: There is no need to clear the tablet screen prior to writing an image. ret = writeImageB(i, (byte)m_encodingMode, m_bitmapData); protocolHelper = null; stream.Dispose(); } } catch (Exception) { ret = false; } return(ret); }
public void ListeAusgeben(System.Drawing.Graphics zeichenflaeche, System.Drawing.RectangleF flaeche) { System.Drawing.SolidBrush tempPinsel = new System.Drawing.SolidBrush(System.Drawing.Color.White); System.Drawing.Font tempSchrift = new System.Drawing.Font("Arial", 12, System.Drawing.FontStyle.Bold); System.Drawing.StringFormat ausrichtung = new System.Drawing.StringFormat(); float punktX, nameX, Y; punktX = (flaeche.Right / 2) + 150; nameX = (flaeche.Right / 2) - 150; Y = flaeche.Top + 50; ausrichtung.Alignment = System.Drawing.StringAlignment.Center; zeichenflaeche.Clear(System.Drawing.Color.Black); for (int i = 0; i < 10; i++) { SoundPlayer simpleSound = new SoundPlayer("C:\\Shared\\ILS_Hefte\\Pong\\Sound\\piano2.wav"); if ((i % 2) != 0) { tempPinsel.Color = System.Drawing.Color.Pink; } else { tempPinsel.Color = System.Drawing.Color.White; } zeichenflaeche.DrawString("/************************************Bestenliste************************************\\", tempSchrift, tempPinsel, flaeche.Width / 2, Y, ausrichtung); simpleSound.Play(); System.Threading.Thread.Sleep(250); zeichenflaeche.Clear(System.Drawing.Color.Black); } zeichenflaeche.Clear(System.Drawing.Color.Black); zeichenflaeche.DrawString("/************************************Bestenliste************************************\\", tempSchrift, tempPinsel, flaeche.Width / 2, Y, ausrichtung); Y = Y + 30; for (int i = 0; i < anzahl; i++) { Y = Y + 20; zeichenflaeche.DrawString(Convert.ToString(bestenliste[i].GetPunkte()), tempSchrift, tempPinsel, punktX, Y); zeichenflaeche.DrawString(Convert.ToString(bestenliste[i].GetName()), tempSchrift, tempPinsel, nameX, Y); System.Threading.Thread.Sleep(100); } zeichenflaeche.DrawString("\\************************************************************************************/", tempSchrift, tempPinsel, flaeche.Width / 2, (Y + 50), ausrichtung); }
public void Text(string str, double X, double Y) { System.Drawing.StringFormat format = new System.Drawing.StringFormat(); System.Drawing.FontFamily family = null; try { family = new System.Drawing.FontFamily(fontfamily[fontfamily.Count - 1]); } catch { family = System.Drawing.SystemFonts.DefaultFont.FontFamily; } path[path.Count - 1].AddString(str, family, 0, (float)fontsize[fontsize.Count - 1], new System.Drawing.Point((int)X, (int)Y), format); }
void _Applet_DeviceArrival(object sender, LcdDeviceTypeEventArgs e) { if (_Device == null) { Console.WriteLine("Device Arrived!"); _Device = _Applet.OpenDeviceByType(e.DeviceType); _Device.SoftButtonsChanged += new EventHandler <LcdSoftButtonsEventArgs>(_Device_SoftButtonsChanged); Pages.Add("NewMessage", new MyLcdGdiPage(_Device, this)); Pages["NewMessage"].SoftButtonsChanged += new EventHandler <LcdSoftButtonsEventArgs>(NewMessage_SoftButtonsChanged); Pages["NewMessage"].Updated += new EventHandler <UpdateEventArgs>(LCDHandler_Updated); Pages["NewMessage"].Add("BG", new LcdGdiRectangle()); Pages["NewMessage"].Get <LcdGdiRectangle>("BG").Size = new System.Drawing.SizeF(_Device.PixelWidth, _Device.PixelHeight); Pages["NewMessage"].Get <LcdGdiRectangle>("BG").Brush = System.Drawing.Brushes.Black; Pages["NewMessage"].Add("Time", new LcdGdiText()); Pages["NewMessage"].Get <LcdGdiText>("Time").Text = ""; Pages["NewMessage"].Get <LcdGdiText>("Time").VerticalAlignment = LcdGdiVerticalAlignment.Top; Pages["NewMessage"].Get <LcdGdiText>("Time").HorizontalAlignment = LcdGdiHorizontalAlignment.Left; textFont = new System.Drawing.Font(Pages["NewMessage"].Get <LcdGdiText>("Time").Font, System.Drawing.FontStyle.Bold); Pages["NewMessage"].Get <LcdGdiText>("Time").Font = textFont; Pages["NewMessage"].Get <LcdGdiText>("Time").Brush = System.Drawing.Brushes.White; Pages["NewMessage"].Add("Author", new LcdGdiText()); Pages["NewMessage"].Get <LcdGdiText>("Author").Text = ""; Pages["NewMessage"].Get <LcdGdiText>("Author").VerticalAlignment = LcdGdiVerticalAlignment.Top; Pages["NewMessage"].Get <LcdGdiText>("Author").HorizontalAlignment = LcdGdiHorizontalAlignment.Right; Pages["NewMessage"].Get <LcdGdiText>("Author").Font = textFont; Pages["NewMessage"].Get <LcdGdiText>("Author").Brush = System.Drawing.Brushes.White; System.Drawing.StringFormat MessageFormat = new System.Drawing.StringFormat(); MessageFormat.Alignment = System.Drawing.StringAlignment.Center; MessageFormat.LineAlignment = System.Drawing.StringAlignment.Center; Pages["NewMessage"].Add("Message", new LcdGdiText()); Pages["NewMessage"].Get <LcdGdiText>("Message").Text = ""; Pages["NewMessage"].Get <LcdGdiText>("Message").Margin = new MarginF(0, 0, 0, 0); Pages["NewMessage"].Get <LcdGdiText>("Message").StringFormat = MessageFormat; Pages["NewMessage"].Get <LcdGdiText>("Message").VerticalAlignment = LcdGdiVerticalAlignment.Stretch; Pages["NewMessage"].Get <LcdGdiText>("Message").HorizontalAlignment = LcdGdiHorizontalAlignment.Stretch; Pages["NewMessage"].Get <LcdGdiText>("Message").Font = textFont; Pages["NewMessage"].Get <LcdGdiText>("Message").Brush = System.Drawing.Brushes.White; Pages["NewMessage"].SetAsCurrentDevicePage(); } }
private void DrawCheckTitle() { System.Drawing.Font font = new System.Drawing.Font("宋体", 30, System.Drawing.FontStyle.Bold); var size = this.graphics.MeasureString(this.title, font); float startX = (Constants.ImageWidth - size.Width) / 2; System.Drawing.Brush brush = new System.Drawing.SolidBrush(System.Drawing.Color.Black); System.Drawing.RectangleF rect = new System.Drawing.RectangleF(startX, 110, size.Width, 80); System.Drawing.StringFormat format = new System.Drawing.StringFormat { Alignment = System.Drawing.StringAlignment.Center }; System.Drawing.RectangleF rectBg = new System.Drawing.RectangleF(startX, 110 - 10, size.Width, 80 + 10); this.graphics.FillRectangle(new System.Drawing.SolidBrush(System.Drawing.Color.White), rectBg); this.graphics.DrawString(this.title, font, brush, rect, format); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Drawing.StringFormat stringFormat1 = new System.Drawing.StringFormat(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DeskLrcFrm)); this.deskLrcControl1 = new MediaPlayer.DeskLrcControl(); this.SuspendLayout(); // // deskLrcControl1 // this.deskLrcControl1.BackColor = System.Drawing.Color.Black; this.deskLrcControl1.BackColors = System.Drawing.Color.Black; this.deskLrcControl1.CurrentPosition = null; this.deskLrcControl1.Cursor = System.Windows.Forms.Cursors.Hand; this.deskLrcControl1.Dock = System.Windows.Forms.DockStyle.Fill; this.deskLrcControl1.FontSty = new System.Drawing.Font("幼圆", 34F); this.deskLrcControl1.Location = new System.Drawing.Point(0, 0); this.deskLrcControl1.MinimumSize = new System.Drawing.Size(200, 20); this.deskLrcControl1.Name = "deskLrcControl1"; this.deskLrcControl1.Size = new System.Drawing.Size(492, 88); stringFormat1.Alignment = System.Drawing.StringAlignment.Center; stringFormat1.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.None; stringFormat1.LineAlignment = System.Drawing.StringAlignment.Center; stringFormat1.Trimming = System.Drawing.StringTrimming.Character; this.deskLrcControl1.StringFormatter = stringFormat1; this.deskLrcControl1.TabIndex = 0; this.deskLrcControl1.MouseMove += new System.Windows.Forms.MouseEventHandler(this.deskLrcControl1_MouseMove); this.deskLrcControl1.MouseDown += new System.Windows.Forms.MouseEventHandler(this.deskLrcControl1_MouseDown); // // DeskLrcFrm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.Black; this.ClientSize = new System.Drawing.Size(492, 88); this.Controls.Add(this.deskLrcControl1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "DeskLrcFrm"; this.ShowInTaskbar = false; this.Text = "土豆桌面歌词 V1.0.0"; this.Load += new System.EventHandler(this.DeskLrcFrm_Load); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.DeskLrcFrm_FormClosing); this.ResumeLayout(false); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.Drawing.StringFormat stringFormat1 = new System.Drawing.StringFormat(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LrcFrm)); this.lrcPanel1 = new MediaPlayer.LrcPanel(); this.SuspendLayout(); // // lrcPanel1 // this.lrcPanel1.BackColors = System.Drawing.Color.Black; this.lrcPanel1.CurrentPosition = null; this.lrcPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.lrcPanel1.FontSty = new System.Drawing.Font("幼圆", 14F); this.lrcPanel1.Location = new System.Drawing.Point(0, 0); this.lrcPanel1.MinimumSize = new System.Drawing.Size(100, 20); this.lrcPanel1.Name = "lrcPanel1"; this.lrcPanel1.Size = new System.Drawing.Size(324, 324); stringFormat1.Alignment = System.Drawing.StringAlignment.Center; stringFormat1.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.None; stringFormat1.LineAlignment = System.Drawing.StringAlignment.Center; stringFormat1.Trimming = System.Drawing.StringTrimming.Character; this.lrcPanel1.StringFormatter = stringFormat1; this.lrcPanel1.TabIndex = 0; // // LrcFrm // this.BackColor = System.Drawing.Color.Black; this.ClientSize = new System.Drawing.Size(324, 324); this.Controls.Add(this.lrcPanel1); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "LrcFrm"; this.ShowInTaskbar = false; this.Text = "土豆歌词 V1.0.0"; this.Load += new System.EventHandler(this.LrcFrm_Load); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.LrcFrm_FormClosing); this.Resize += new System.EventHandler(this.LrcFrm_Resize); this.ResumeLayout(false); }
private byte[] RandomSymbol(int number) { number = number%360; string text =""; System.Drawing.Brush brush = null; if (number < 60) return null; if (number < 120) { text = "<120"; brush = System.Drawing.Brushes.DarkGreen; } else if(number < 240) { text = number.ToString(); brush = System.Drawing.Brushes.Orange; } else { text = ">240"; brush = System.Drawing.Brushes.Red; } System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(120, 60); System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bmp); System.Drawing.RectangleF size = new System.Drawing.RectangleF(0f, 0f, 120f, 60f); g.FillRectangle(System.Drawing.Brushes.White, size); var sf = new System.Drawing.StringFormat(System.Drawing.StringFormatFlags.NoWrap) {Alignment = System.Drawing.StringAlignment.Center}; g.DrawString(text, new System.Drawing.Font("Arial", 24), brush, size, sf); g.Flush(); g.Dispose(); var ms = new System.IO.MemoryStream(); bmp.MakeTransparent(System.Drawing.Color.White); bmp.Save(ms, System.Drawing.Imaging.ImageFormat.Png); return ms.ToArray(); }
//Does it work with column name? public static int AutoSizeCol(System.Windows.Forms.DataGrid dataGrid, System.Windows.Forms.DataGridColumnStyle columnStyle, int aNumRows) { float width = 0; int numRows = aNumRows; System.Windows.Forms.DataGridTableStyle dgStyle = columnStyle.DataGridTableStyle; int col = dgStyle.GridColumnStyles.IndexOf(columnStyle); System.Drawing.Graphics g = System.Drawing.Graphics.FromHwnd(dataGrid.Handle); System.Drawing.StringFormat sf = new System.Drawing.StringFormat(System.Drawing.StringFormat.GenericTypographic); System.Drawing.SizeF size = new System.Drawing.SizeF(0,0); //Calculate the largest width in the column and set the column width to that value for(int i = 0; i < numRows; ++ i) { try { size = g.MeasureString(dataGrid[i, col].ToString(), dataGrid.Font, 500, sf); } catch { Debug.WriteLine("AutoSizeCol: Exception thrown"); } if(size.Width > width) width = size.Width; } //Measure the header text as well size = g.MeasureString(columnStyle.HeaderText, dataGrid.HeaderFont, 500, sf); if(size.Width > width) width = size.Width; g.Dispose(); columnStyle.Width = (int) width + 12; // 8 is for leading and trailing padding return columnStyle.Width; }
public void Text(string str, double X, double Y) { System.Drawing.StringFormat format = new System.Drawing.StringFormat(); System.Drawing.FontFamily family = null; try { family = new System.Drawing.FontFamily(fontfamily[fontfamily.Count - 1]); } catch { family = System.Drawing.SystemFonts.DefaultFont.FontFamily; } path[path.Count - 1].AddString(str, family, 0, (float)fontsize[fontsize.Count - 1], new System.Drawing.Point((int)X, (int)Y), format); }
/// <summary> /// Gets the rectangle taken up by the rendered text. /// </summary> /// <param name="text">The text to render</param> /// <param name="font">The font to render the text in</param> /// <returns>The rectangle taken up by rendering the text</returns> private static SysSystem.Drawing.RectangleF GetTextRectangle(string text, SysSystem.Drawing.Font font) { // Create a small bitmap just to get a device context SysSystem.Drawing.Bitmap tmpBitmap = new SysSystem.Drawing.Bitmap(1, 1); using (SysSystem.Drawing.Graphics g = SysSystem.Drawing.Graphics.FromImage(tmpBitmap)) using (SysSystem.Drawing.StringFormat stringFormat = new SysSystem.Drawing.StringFormat()) { stringFormat.Alignment = SysSystem.Drawing.StringAlignment.Near; stringFormat.Trimming = SysSystem.Drawing.StringTrimming.None; stringFormat.FormatFlags = SysSystem.Drawing.StringFormatFlags.NoClip | SysSystem.Drawing.StringFormatFlags.NoWrap; // Do a small rectangle. The size will be ignored with the flags being used SysSystem.Drawing.RectangleF rectangle = new SysSystem.Drawing.RectangleF(0, 0, 1, 1); // Set the stringFormat for measuring the first character SysSystem.Drawing.CharacterRange[] characterRanges ={ new SysSystem.Drawing.CharacterRange(0, text.Length) }; stringFormat.SetMeasurableCharacterRanges(characterRanges); SysSystem.Drawing.Region[] stringRegions = g.MeasureCharacterRanges(text, font, rectangle, stringFormat); // Draw rectangle for first measured range. return stringRegions[0].GetBounds(g); } }
void ForwardListView_DrawItem(object sender, DrawListViewItemEventArgs e) { if (this.View == View.Tile) { int checkBoxAreaWidth = CHECKBOX_PADDING + CHECKBOX_SIZE + CHECKBOX_PADDING; System.Drawing.Rectangle bounds = new System.Drawing.Rectangle(e.Bounds.X + checkBoxAreaWidth, e.Bounds.Top, e.Bounds.Width - checkBoxAreaWidth, e.Bounds.Height); // update information DestinationBase fc = (DestinationBase)e.Item.Tag; string display = Escape(fc.Display); string address = Escape(fc.AddressDisplay); string additional = Escape(fc.AdditionalDisplayInfo); string tooltip = String.Format("{0}\r\n{1}{2}", fc.Display, fc.AddressDisplay, (!String.IsNullOrEmpty(fc.AdditionalDisplayInfo) ? String.Format("\r\n{0}", fc.AdditionalDisplayInfo) : null)); e.Item.ToolTipText = tooltip; // NOTE: dont set the .Text or .SubItem properties here - it causes an erratic exception bool drawEnabled = ShouldDrawEnabled(fc); bool selected = this.SelectedIndices.Contains(e.ItemIndex); // draw the background for selected states if(drawEnabled && selected) { e.Graphics.FillRectangle(System.Drawing.Brushes.LightGray, e.Bounds); } else { e.DrawBackground(); } // draw the focus rectangle if (selected) ControlPaint.DrawFocusRectangle(e.Graphics, e.Bounds); // draw icon int newX = bounds.X; DestinationBase db = e.Item.Tag as DestinationBase; if (db != null) { System.Drawing.Image img = db.GetIcon(); // size if (img.Width > IMAGE_SIZE) { System.Drawing.Image resized = new System.Drawing.Bitmap(IMAGE_SIZE, IMAGE_SIZE); System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(resized); using (g) { g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; g.DrawImage(img, 0, 0, IMAGE_SIZE, IMAGE_SIZE); } img = resized; } if (img != null) { int x = bounds.X; int y = bounds.Top; if (drawEnabled) e.Graphics.DrawImage(img, new System.Drawing.Rectangle(x, y, img.Width, img.Height)); else ControlPaint.DrawImageDisabled(e.Graphics, img, x, y, System.Drawing.Color.Transparent); newX += IMAGE_SIZE + this.Margin.Right; } } // offset the text vertically a bit so it lines up with the icon better System.Drawing.RectangleF rect = new System.Drawing.RectangleF(newX, bounds.Top, bounds.Right - newX, e.Item.Font.Height); rect.Offset(0, 4); // draw main text System.Drawing.Color textColor = (drawEnabled ? e.Item.ForeColor : System.Drawing.Color.FromArgb(System.Drawing.SystemColors.GrayText.ToArgb())); System.Drawing.StringFormat sf = new System.Drawing.StringFormat(); sf.Trimming = System.Drawing.StringTrimming.EllipsisCharacter; sf.FormatFlags = System.Drawing.StringFormatFlags.NoClip; System.Drawing.SolidBrush textBrush = new System.Drawing.SolidBrush(textColor); using (textBrush) { e.Graphics.DrawString(display, e.Item.Font, textBrush, rect, sf); } // draw additional information text System.Drawing.Color subColor = System.Drawing.Color.FromArgb(System.Drawing.SystemColors.GrayText.ToArgb()); System.Drawing.SolidBrush subBrush = new System.Drawing.SolidBrush(subColor); using (subBrush) { // draw address display (line 2) rect.Offset(0, e.Item.Font.Height); e.Graphics.DrawString(address, e.Item.Font, subBrush, rect, sf); // draw additional display (line 3) rect.Offset(0, e.Item.Font.Height); e.Graphics.DrawString(additional, e.Item.Font, subBrush, rect, sf); } // draw checkbox System.Windows.Forms.VisualStyles.CheckBoxState state = System.Windows.Forms.VisualStyles.CheckBoxState.UncheckedNormal; if (fc.Enabled) state = System.Windows.Forms.VisualStyles.CheckBoxState.CheckedNormal; else state = System.Windows.Forms.VisualStyles.CheckBoxState.UncheckedNormal; CheckBoxRenderer.DrawCheckBox(e.Graphics, new System.Drawing.Point(e.Bounds.Left + CHECKBOX_PADDING, e.Bounds.Top + CHECKBOX_PADDING), state); } else { e.DrawDefault = true; } }
/// <summary> /// 处理水印文字位置 /// </summary> /// <returns></returns> private System.Drawing.StringFormat GetStringFormat() { System.Drawing.StringFormat sf = new System.Drawing.StringFormat(); switch (_enumWatermarkPosition) { case WatermarkPosition.TopLeft: sf.Alignment = System.Drawing.StringAlignment.Near; sf.LineAlignment = System.Drawing.StringAlignment.Near; break; case WatermarkPosition.TopCenter: sf.Alignment = System.Drawing.StringAlignment.Center; sf.LineAlignment = System.Drawing.StringAlignment.Near; break; case WatermarkPosition.TopRight: sf.Alignment = System.Drawing.StringAlignment.Far; sf.LineAlignment = System.Drawing.StringAlignment.Near; break; case WatermarkPosition.MiddleLeft: sf.Alignment = System.Drawing.StringAlignment.Near; sf.LineAlignment = System.Drawing.StringAlignment.Center; break; case WatermarkPosition.MiddleCenter: sf.Alignment = System.Drawing.StringAlignment.Center; sf.LineAlignment = System.Drawing.StringAlignment.Center; break; case WatermarkPosition.MiddleRight: sf.Alignment = System.Drawing.StringAlignment.Far; sf.LineAlignment = System.Drawing.StringAlignment.Center; break; case WatermarkPosition.BottomLeft: sf.Alignment = System.Drawing.StringAlignment.Near; sf.LineAlignment = System.Drawing.StringAlignment.Far; break; case WatermarkPosition.BottomCenter: sf.Alignment = System.Drawing.StringAlignment.Center; sf.LineAlignment = System.Drawing.StringAlignment.Far; break; case WatermarkPosition.BottomRight: sf.Alignment = System.Drawing.StringAlignment.Far; sf.LineAlignment = System.Drawing.StringAlignment.Far; break; default: sf.Alignment = System.Drawing.StringAlignment.Center; sf.LineAlignment = System.Drawing.StringAlignment.Far; break; } return sf; }
private byte[] GenerateCaptchaImage(string text, int width, int height) { Random random = new Random(int.Parse(Guid.NewGuid().ToString().Substring(0, 8), System.Globalization.NumberStyles.HexNumber)); System.Drawing.Font font; System.Drawing.Bitmap bmp = new System.Drawing.Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format32bppArgb); System.Drawing.Graphics graphics = System.Drawing.Graphics.FromImage(bmp); graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; System.Drawing.Rectangle rect = new System.Drawing.Rectangle(0, 0, width, height); System.Drawing.Drawing2D.HatchBrush brush = new System.Drawing.Drawing2D.HatchBrush(System.Drawing.Drawing2D.HatchStyle.SmallConfetti, System.Drawing.Color.LightGray, System.Drawing.Color.White); graphics.FillRectangle(brush, rect); float emSize = rect.Height + 1; do { emSize--; font = new System.Drawing.Font(System.Drawing.FontFamily.GenericSansSerif, emSize, System.Drawing.FontStyle.Bold); } while (graphics.MeasureString(text, font).Width > rect.Width); System.Drawing.StringFormat format = new System.Drawing.StringFormat { Alignment = System.Drawing.StringAlignment.Center, LineAlignment = System.Drawing.StringAlignment.Center }; System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath(); path.AddString(text, font.FontFamily, (int)font.Style, 75f, rect, format); float num2 = 4f; System.Drawing.PointF[] destPoints = new System.Drawing.PointF[] { new System.Drawing.PointF(((float)random.Next(rect.Width)) / num2, ((float)random.Next(rect.Height)) / num2), new System.Drawing.PointF(rect.Width - (((float)random.Next(rect.Width)) / num2), ((float)random.Next(rect.Height)) / num2), new System.Drawing.PointF(((float)random.Next(rect.Width)) / num2, rect.Height - (((float)random.Next(rect.Height)) / num2)), new System.Drawing.PointF(rect.Width - (((float)random.Next(rect.Width)) / num2), rect.Height - (((float)random.Next(rect.Height)) / num2)) }; System.Drawing.Drawing2D.Matrix matrix = new System.Drawing.Drawing2D.Matrix(); matrix.Translate(0f, 0f); path.Warp(destPoints, rect, matrix, System.Drawing.Drawing2D.WarpMode.Perspective, 0f); brush = new System.Drawing.Drawing2D.HatchBrush(System.Drawing.Drawing2D.HatchStyle.Percent10, System.Drawing.Color.Black, System.Drawing.Color.SkyBlue); graphics.FillPath(brush, path); int num3 = Math.Max(rect.Width, rect.Height); for (int i = 0; i < ((int)(((float)(rect.Width * rect.Height)) / 30f)); i++) { int x = random.Next(rect.Width); int y = random.Next(rect.Height); int w = random.Next(num3 / 50); int h = random.Next(num3 / 50); graphics.FillEllipse(brush, x, y, w, h); } font.Dispose(); brush.Dispose(); graphics.Dispose(); System.IO.MemoryStream imageStream = new System.IO.MemoryStream(); bmp.Save(imageStream, System.Drawing.Imaging.ImageFormat.Jpeg); byte[] imageContent = new Byte[imageStream.Length]; imageStream.Position = 0; imageStream.Read(imageContent, 0, (int)imageStream.Length); return imageContent; }
/// <summary> /// Обязательный метод для поддержки конструктора - не изменяйте /// содержимое данного метода при помощи редактора кода. /// </summary> private void InitializeComponent() { System.Drawing.StringFormat stringFormat1 = new System.Drawing.StringFormat(); AglonaReader.ParallelText parallelText1 = new AglonaReader.ParallelText(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); this.mainMenu = new System.Windows.Forms.MenuStrip(); this.fileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.newToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); this.openToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.openRecentToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator6 = new System.Windows.Forms.ToolStripSeparator(); this.saveToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.saveAsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripSeparator(); this.exportToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exportLeftTextToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.exportRightTextToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.hTMLToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator5 = new System.Windows.Forms.ToolStripSeparator(); this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.bookToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.informationToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.reverseToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.reverseContentsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator2 = new System.Windows.Forms.ToolStripSeparator(); this.structureleftToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.structurerightToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator3 = new System.Windows.Forms.ToolStripSeparator(); this.findToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator(); this.editModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.pairToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.importToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem4 = new System.Windows.Forms.ToolStripSeparator(); this.insertBeforeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.insertPairToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.deletePairToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.statsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.startpauseStopwatchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.resetStopwatchToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.settingsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.normalModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.alternatingModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.advancedModeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem5 = new System.Windows.Forms.ToolStripSeparator(); this.showGoogleTranslatorToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem6 = new System.Windows.Forms.ToolStripSeparator(); this.optionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.helpToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.aglonaReaderSiteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.paraBooksMakerSiteToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripMenuItem3 = new System.Windows.Forms.ToolStripSeparator(); this.aboutToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.statusStrip = new System.Windows.Forms.StatusStrip(); this.ssPosition = new System.Windows.Forms.ToolStripStatusLabel(); this.ssPositionPercent = new System.Windows.Forms.ToolStripStatusLabel(); this.vScrollBar = new System.Windows.Forms.VScrollBar(); this.splitContainer = new System.Windows.Forms.SplitContainer(); this.webBrowser = new System.Windows.Forms.WebBrowser(); this.splitScreenVerticallyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.pTC = new AglonaReader.ParallelTextControl(); this.mainMenu.SuspendLayout(); this.statusStrip.SuspendLayout(); this.splitContainer.Panel1.SuspendLayout(); this.splitContainer.Panel2.SuspendLayout(); this.splitContainer.SuspendLayout(); this.SuspendLayout(); // // mainMenu // this.mainMenu.ImageScalingSize = new System.Drawing.Size(20, 20); this.mainMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.fileToolStripMenuItem, this.bookToolStripMenuItem, this.pairToolStripMenuItem, this.statsToolStripMenuItem, this.settingsToolStripMenuItem, this.helpToolStripMenuItem}); this.mainMenu.Location = new System.Drawing.Point(0, 0); this.mainMenu.Name = "mainMenu"; this.mainMenu.Padding = new System.Windows.Forms.Padding(11, 2, 0, 2); this.mainMenu.Size = new System.Drawing.Size(917, 28); this.mainMenu.TabIndex = 0; this.mainMenu.Text = "menuStrip1"; // // fileToolStripMenuItem // this.fileToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.newToolStripMenuItem, this.toolStripSeparator4, this.openToolStripMenuItem, this.openRecentToolStripMenuItem, this.toolStripSeparator6, this.saveToolStripMenuItem, this.saveAsToolStripMenuItem, this.toolStripMenuItem2, this.exportToolStripMenuItem, this.toolStripSeparator5, this.exitToolStripMenuItem}); this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; this.fileToolStripMenuItem.Size = new System.Drawing.Size(44, 24); this.fileToolStripMenuItem.Text = "File"; // // newToolStripMenuItem // this.newToolStripMenuItem.Name = "newToolStripMenuItem"; this.newToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); this.newToolStripMenuItem.Size = new System.Drawing.Size(252, 24); this.newToolStripMenuItem.Text = "New"; this.newToolStripMenuItem.Click += new System.EventHandler(this.newToolStripMenuItem_Click); // // toolStripSeparator4 // this.toolStripSeparator4.Name = "toolStripSeparator4"; this.toolStripSeparator4.Size = new System.Drawing.Size(249, 6); // // openToolStripMenuItem // this.openToolStripMenuItem.Name = "openToolStripMenuItem"; this.openToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); this.openToolStripMenuItem.Size = new System.Drawing.Size(252, 24); this.openToolStripMenuItem.Text = "Open"; this.openToolStripMenuItem.Click += new System.EventHandler(this.openToolStripMenuItem_Click); // // openRecentToolStripMenuItem // this.openRecentToolStripMenuItem.Name = "openRecentToolStripMenuItem"; this.openRecentToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) | System.Windows.Forms.Keys.O))); this.openRecentToolStripMenuItem.Size = new System.Drawing.Size(252, 24); this.openRecentToolStripMenuItem.Text = "Open recent"; this.openRecentToolStripMenuItem.Click += new System.EventHandler(this.openRecentToolStripMenuItem_Click); // // toolStripSeparator6 // this.toolStripSeparator6.Name = "toolStripSeparator6"; this.toolStripSeparator6.Size = new System.Drawing.Size(249, 6); // // saveToolStripMenuItem // this.saveToolStripMenuItem.Name = "saveToolStripMenuItem"; this.saveToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); this.saveToolStripMenuItem.Size = new System.Drawing.Size(252, 24); this.saveToolStripMenuItem.Text = "Save"; this.saveToolStripMenuItem.Click += new System.EventHandler(this.saveToolStripMenuItem_Click); // // saveAsToolStripMenuItem // this.saveAsToolStripMenuItem.Name = "saveAsToolStripMenuItem"; this.saveAsToolStripMenuItem.Size = new System.Drawing.Size(252, 24); this.saveAsToolStripMenuItem.Text = "Save as"; this.saveAsToolStripMenuItem.Click += new System.EventHandler(this.saveAsToolStripMenuItem_Click); // // toolStripMenuItem2 // this.toolStripMenuItem2.Name = "toolStripMenuItem2"; this.toolStripMenuItem2.Size = new System.Drawing.Size(249, 6); // // exportToolStripMenuItem // this.exportToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.exportLeftTextToolStripMenuItem, this.exportRightTextToolStripMenuItem, this.hTMLToolStripMenuItem}); this.exportToolStripMenuItem.Name = "exportToolStripMenuItem"; this.exportToolStripMenuItem.Size = new System.Drawing.Size(252, 24); this.exportToolStripMenuItem.Text = "Export"; // // exportLeftTextToolStripMenuItem // this.exportLeftTextToolStripMenuItem.Name = "exportLeftTextToolStripMenuItem"; this.exportLeftTextToolStripMenuItem.Size = new System.Drawing.Size(189, 24); this.exportLeftTextToolStripMenuItem.Text = "Left text to TXT"; this.exportLeftTextToolStripMenuItem.Click += new System.EventHandler(this.exportLeftTextToolStripMenuItem_Click); // // exportRightTextToolStripMenuItem // this.exportRightTextToolStripMenuItem.Name = "exportRightTextToolStripMenuItem"; this.exportRightTextToolStripMenuItem.Size = new System.Drawing.Size(189, 24); this.exportRightTextToolStripMenuItem.Text = "Right text to TXT"; this.exportRightTextToolStripMenuItem.Click += new System.EventHandler(this.exportRightTextToolStripMenuItem_Click); // // hTMLToolStripMenuItem // this.hTMLToolStripMenuItem.Name = "hTMLToolStripMenuItem"; this.hTMLToolStripMenuItem.Size = new System.Drawing.Size(189, 24); this.hTMLToolStripMenuItem.Text = "Book to HTML"; this.hTMLToolStripMenuItem.Click += new System.EventHandler(this.hTMLToolStripMenuItem_Click); // // toolStripSeparator5 // this.toolStripSeparator5.Name = "toolStripSeparator5"; this.toolStripSeparator5.Size = new System.Drawing.Size(249, 6); // // exitToolStripMenuItem // this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; this.exitToolStripMenuItem.Size = new System.Drawing.Size(252, 24); this.exitToolStripMenuItem.Text = "Exit"; this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); // // bookToolStripMenuItem // this.bookToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.informationToolStripMenuItem, this.toolStripSeparator1, this.reverseToolStripMenuItem, this.reverseContentsToolStripMenuItem, this.toolStripSeparator2, this.structureleftToolStripMenuItem, this.structurerightToolStripMenuItem, this.toolStripSeparator3, this.findToolStripMenuItem, this.toolStripMenuItem1, this.editModeToolStripMenuItem}); this.bookToolStripMenuItem.Name = "bookToolStripMenuItem"; this.bookToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F2))); this.bookToolStripMenuItem.Size = new System.Drawing.Size(55, 24); this.bookToolStripMenuItem.Text = "Book"; // // informationToolStripMenuItem // this.informationToolStripMenuItem.Name = "informationToolStripMenuItem"; this.informationToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F1))); this.informationToolStripMenuItem.Size = new System.Drawing.Size(235, 24); this.informationToolStripMenuItem.Text = "Information"; this.informationToolStripMenuItem.Click += new System.EventHandler(this.informationToolStripMenuItem_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Size = new System.Drawing.Size(232, 6); // // reverseToolStripMenuItem // this.reverseToolStripMenuItem.CheckOnClick = true; this.reverseToolStripMenuItem.Name = "reverseToolStripMenuItem"; this.reverseToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.R))); this.reverseToolStripMenuItem.Size = new System.Drawing.Size(235, 24); this.reverseToolStripMenuItem.Text = "Reverse"; this.reverseToolStripMenuItem.Click += new System.EventHandler(this.reverseToolStripMenuItem_Click); // // reverseContentsToolStripMenuItem // this.reverseContentsToolStripMenuItem.Name = "reverseContentsToolStripMenuItem"; this.reverseContentsToolStripMenuItem.Size = new System.Drawing.Size(235, 24); this.reverseContentsToolStripMenuItem.Text = "Reverse contents"; this.reverseContentsToolStripMenuItem.Click += new System.EventHandler(this.reverseContentsToolStripMenuItem_Click); // // toolStripSeparator2 // this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Size = new System.Drawing.Size(232, 6); // // structureleftToolStripMenuItem // this.structureleftToolStripMenuItem.Name = "structureleftToolStripMenuItem"; this.structureleftToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F1))); this.structureleftToolStripMenuItem.Size = new System.Drawing.Size(235, 24); this.structureleftToolStripMenuItem.Text = "Structure (left)"; this.structureleftToolStripMenuItem.Click += new System.EventHandler(this.structureleftToolStripMenuItem_Click); // // structurerightToolStripMenuItem // this.structurerightToolStripMenuItem.Name = "structurerightToolStripMenuItem"; this.structurerightToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F2))); this.structurerightToolStripMenuItem.Size = new System.Drawing.Size(235, 24); this.structurerightToolStripMenuItem.Text = "Structure (right)"; this.structurerightToolStripMenuItem.Click += new System.EventHandler(this.structurerightToolStripMenuItem_Click); // // toolStripSeparator3 // this.toolStripSeparator3.Name = "toolStripSeparator3"; this.toolStripSeparator3.Size = new System.Drawing.Size(232, 6); // // findToolStripMenuItem // this.findToolStripMenuItem.Name = "findToolStripMenuItem"; this.findToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F))); this.findToolStripMenuItem.Size = new System.Drawing.Size(235, 24); this.findToolStripMenuItem.Text = "Find..."; this.findToolStripMenuItem.Click += new System.EventHandler(this.findToolStripMenuItem_Click); // // toolStripMenuItem1 // this.toolStripMenuItem1.Name = "toolStripMenuItem1"; this.toolStripMenuItem1.Size = new System.Drawing.Size(232, 6); // // editModeToolStripMenuItem // this.editModeToolStripMenuItem.CheckOnClick = true; this.editModeToolStripMenuItem.Name = "editModeToolStripMenuItem"; this.editModeToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.E))); this.editModeToolStripMenuItem.Size = new System.Drawing.Size(235, 24); this.editModeToolStripMenuItem.Text = "Edit mode"; this.editModeToolStripMenuItem.Click += new System.EventHandler(this.editModeToolStripMenuItem_Click); // // pairToolStripMenuItem // this.pairToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.importToolStripMenuItem, this.editToolStripMenuItem, this.toolStripMenuItem4, this.insertBeforeToolStripMenuItem, this.insertPairToolStripMenuItem, this.deletePairToolStripMenuItem}); this.pairToolStripMenuItem.Name = "pairToolStripMenuItem"; this.pairToolStripMenuItem.Size = new System.Drawing.Size(46, 24); this.pairToolStripMenuItem.Text = "Pair"; // // importToolStripMenuItem // this.importToolStripMenuItem.Name = "importToolStripMenuItem"; this.importToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.I))); this.importToolStripMenuItem.Size = new System.Drawing.Size(229, 24); this.importToolStripMenuItem.Text = "Import..."; this.importToolStripMenuItem.Click += new System.EventHandler(this.importToolStripMenuItem_Click); // // editToolStripMenuItem // this.editToolStripMenuItem.Name = "editToolStripMenuItem"; this.editToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F2; this.editToolStripMenuItem.Size = new System.Drawing.Size(229, 24); this.editToolStripMenuItem.Text = "Edit"; this.editToolStripMenuItem.Click += new System.EventHandler(this.editToolStripMenuItem_Click); // // toolStripMenuItem4 // this.toolStripMenuItem4.Name = "toolStripMenuItem4"; this.toolStripMenuItem4.Size = new System.Drawing.Size(226, 6); // // insertBeforeToolStripMenuItem // this.insertBeforeToolStripMenuItem.Name = "insertBeforeToolStripMenuItem"; this.insertBeforeToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Shift | System.Windows.Forms.Keys.Insert))); this.insertBeforeToolStripMenuItem.Size = new System.Drawing.Size(229, 24); this.insertBeforeToolStripMenuItem.Text = "Insert before"; this.insertBeforeToolStripMenuItem.Click += new System.EventHandler(this.insertBeforeToolStripMenuItem_Click); // // insertPairToolStripMenuItem // this.insertPairToolStripMenuItem.Name = "insertPairToolStripMenuItem"; this.insertPairToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Insert; this.insertPairToolStripMenuItem.Size = new System.Drawing.Size(229, 24); this.insertPairToolStripMenuItem.Text = "Insert after"; this.insertPairToolStripMenuItem.Click += new System.EventHandler(this.insertPairToolStripMenuItem_Click); // // deletePairToolStripMenuItem // this.deletePairToolStripMenuItem.Name = "deletePairToolStripMenuItem"; this.deletePairToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.Delete; this.deletePairToolStripMenuItem.Size = new System.Drawing.Size(229, 24); this.deletePairToolStripMenuItem.Text = "Delete"; this.deletePairToolStripMenuItem.Click += new System.EventHandler(this.deletePairToolStripMenuItem_Click); // // statsToolStripMenuItem // this.statsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.startpauseStopwatchToolStripMenuItem, this.resetStopwatchToolStripMenuItem}); this.statsToolStripMenuItem.Name = "statsToolStripMenuItem"; this.statsToolStripMenuItem.Size = new System.Drawing.Size(53, 24); this.statsToolStripMenuItem.Text = "Stats"; // // startpauseStopwatchToolStripMenuItem // this.startpauseStopwatchToolStripMenuItem.Name = "startpauseStopwatchToolStripMenuItem"; this.startpauseStopwatchToolStripMenuItem.ShortcutKeys = System.Windows.Forms.Keys.F5; this.startpauseStopwatchToolStripMenuItem.Size = new System.Drawing.Size(250, 24); this.startpauseStopwatchToolStripMenuItem.Text = "Start/pause stopwatch"; this.startpauseStopwatchToolStripMenuItem.Click += new System.EventHandler(this.startpauseStopwatchToolStripMenuItem_Click); // // resetStopwatchToolStripMenuItem // this.resetStopwatchToolStripMenuItem.Name = "resetStopwatchToolStripMenuItem"; this.resetStopwatchToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.F5))); this.resetStopwatchToolStripMenuItem.Size = new System.Drawing.Size(250, 24); this.resetStopwatchToolStripMenuItem.Text = "Reset stopwatch"; this.resetStopwatchToolStripMenuItem.Click += new System.EventHandler(this.resetStopwatchToolStripMenuItem_Click); // // settingsToolStripMenuItem // this.settingsToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.normalModeToolStripMenuItem, this.alternatingModeToolStripMenuItem, this.advancedModeToolStripMenuItem, this.toolStripMenuItem5, this.showGoogleTranslatorToolStripMenuItem, this.splitScreenVerticallyToolStripMenuItem, this.toolStripMenuItem6, this.optionsToolStripMenuItem}); this.settingsToolStripMenuItem.Name = "settingsToolStripMenuItem"; this.settingsToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Shift | System.Windows.Forms.Keys.F10))); this.settingsToolStripMenuItem.ShowShortcutKeys = false; this.settingsToolStripMenuItem.Size = new System.Drawing.Size(74, 24); this.settingsToolStripMenuItem.Text = "Settings"; // // normalModeToolStripMenuItem // this.normalModeToolStripMenuItem.Name = "normalModeToolStripMenuItem"; this.normalModeToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D1))); this.normalModeToolStripMenuItem.Size = new System.Drawing.Size(289, 24); this.normalModeToolStripMenuItem.Text = "Normal mode"; this.normalModeToolStripMenuItem.Click += new System.EventHandler(this.normalModeToolStripMenuItem_Click); // // alternatingModeToolStripMenuItem // this.alternatingModeToolStripMenuItem.Name = "alternatingModeToolStripMenuItem"; this.alternatingModeToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D2))); this.alternatingModeToolStripMenuItem.Size = new System.Drawing.Size(289, 24); this.alternatingModeToolStripMenuItem.Text = "Alternating mode"; this.alternatingModeToolStripMenuItem.Click += new System.EventHandler(this.alternatingModeToolStripMenuItem_Click); // // advancedModeToolStripMenuItem // this.advancedModeToolStripMenuItem.Name = "advancedModeToolStripMenuItem"; this.advancedModeToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.D3))); this.advancedModeToolStripMenuItem.Size = new System.Drawing.Size(289, 24); this.advancedModeToolStripMenuItem.Text = "Advanced mode"; this.advancedModeToolStripMenuItem.Click += new System.EventHandler(this.advancedModeToolStripMenuItem_Click); // // toolStripMenuItem5 // this.toolStripMenuItem5.Name = "toolStripMenuItem5"; this.toolStripMenuItem5.Size = new System.Drawing.Size(286, 6); // // showGoogleTranslatorToolStripMenuItem // this.showGoogleTranslatorToolStripMenuItem.CheckOnClick = true; this.showGoogleTranslatorToolStripMenuItem.Name = "showGoogleTranslatorToolStripMenuItem"; this.showGoogleTranslatorToolStripMenuItem.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.G))); this.showGoogleTranslatorToolStripMenuItem.Size = new System.Drawing.Size(289, 24); this.showGoogleTranslatorToolStripMenuItem.Text = "Show Google Translator"; this.showGoogleTranslatorToolStripMenuItem.Click += new System.EventHandler(this.showGoogleTranslatorToolStripMenuItem_Click); // // toolStripMenuItem6 // this.toolStripMenuItem6.Name = "toolStripMenuItem6"; this.toolStripMenuItem6.Size = new System.Drawing.Size(286, 6); // // optionsToolStripMenuItem // this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; this.optionsToolStripMenuItem.Size = new System.Drawing.Size(289, 24); this.optionsToolStripMenuItem.Text = "Options"; this.optionsToolStripMenuItem.Click += new System.EventHandler(this.settingsToolStripMenuItem_Click); // // helpToolStripMenuItem // this.helpToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.aglonaReaderSiteToolStripMenuItem, this.paraBooksMakerSiteToolStripMenuItem, this.toolStripMenuItem3, this.aboutToolStripMenuItem}); this.helpToolStripMenuItem.Name = "helpToolStripMenuItem"; this.helpToolStripMenuItem.Size = new System.Drawing.Size(53, 24); this.helpToolStripMenuItem.Text = "Help"; // // aglonaReaderSiteToolStripMenuItem // this.aglonaReaderSiteToolStripMenuItem.Name = "aglonaReaderSiteToolStripMenuItem"; this.aglonaReaderSiteToolStripMenuItem.Size = new System.Drawing.Size(215, 24); this.aglonaReaderSiteToolStripMenuItem.Text = "Aglona Reader site"; this.aglonaReaderSiteToolStripMenuItem.Click += new System.EventHandler(this.aglonaReaderSiteToolStripMenuItem_Click); // // paraBooksMakerSiteToolStripMenuItem // this.paraBooksMakerSiteToolStripMenuItem.Name = "paraBooksMakerSiteToolStripMenuItem"; this.paraBooksMakerSiteToolStripMenuItem.Size = new System.Drawing.Size(215, 24); this.paraBooksMakerSiteToolStripMenuItem.Text = "ParaBooksMaker site"; this.paraBooksMakerSiteToolStripMenuItem.Click += new System.EventHandler(this.paraBooksMakerSiteToolStripMenuItem_Click); // // toolStripMenuItem3 // this.toolStripMenuItem3.Name = "toolStripMenuItem3"; this.toolStripMenuItem3.Size = new System.Drawing.Size(212, 6); // // aboutToolStripMenuItem // this.aboutToolStripMenuItem.Name = "aboutToolStripMenuItem"; this.aboutToolStripMenuItem.Size = new System.Drawing.Size(215, 24); this.aboutToolStripMenuItem.Text = "About"; this.aboutToolStripMenuItem.Click += new System.EventHandler(this.aboutToolStripMenuItem_Click); // // statusStrip // this.statusStrip.ImageScalingSize = new System.Drawing.Size(20, 20); this.statusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.ssPosition, this.ssPositionPercent}); this.statusStrip.Location = new System.Drawing.Point(0, 300); this.statusStrip.Name = "statusStrip"; this.statusStrip.Padding = new System.Windows.Forms.Padding(1, 0, 25, 0); this.statusStrip.Size = new System.Drawing.Size(917, 25); this.statusStrip.TabIndex = 4; this.statusStrip.Text = "statusStrip1"; // // ssPosition // this.ssPosition.Name = "ssPosition"; this.ssPosition.Size = new System.Drawing.Size(39, 20); this.ssPosition.Text = "0 / 0"; // // ssPositionPercent // this.ssPositionPercent.Name = "ssPositionPercent"; this.ssPositionPercent.Size = new System.Drawing.Size(52, 20); this.ssPositionPercent.Text = "0,00 %"; // // vScrollBar // this.vScrollBar.Dock = System.Windows.Forms.DockStyle.Right; this.vScrollBar.LargeChange = 1; this.vScrollBar.Location = new System.Drawing.Point(899, 0); this.vScrollBar.Name = "vScrollBar"; this.vScrollBar.Size = new System.Drawing.Size(18, 230); this.vScrollBar.TabIndex = 5; this.vScrollBar.Scroll += new System.Windows.Forms.ScrollEventHandler(this.vScrollBar_Scroll); // // splitContainer // this.splitContainer.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.splitContainer.Location = new System.Drawing.Point(0, 31); this.splitContainer.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.splitContainer.Name = "splitContainer"; this.splitContainer.Orientation = System.Windows.Forms.Orientation.Horizontal; // // splitContainer.Panel1 // this.splitContainer.Panel1.Controls.Add(this.pTC); this.splitContainer.Panel1.Controls.Add(this.vScrollBar); // // splitContainer.Panel2 // this.splitContainer.Panel2.Controls.Add(this.webBrowser); this.splitContainer.Size = new System.Drawing.Size(917, 266); this.splitContainer.SplitterDistance = 230; this.splitContainer.SplitterWidth = 11; this.splitContainer.TabIndex = 6; this.splitContainer.SplitterMoved += new System.Windows.Forms.SplitterEventHandler(this.splitContainer_SplitterMoved); // // webBrowser // this.webBrowser.Dock = System.Windows.Forms.DockStyle.Fill; this.webBrowser.Location = new System.Drawing.Point(0, 0); this.webBrowser.Margin = new System.Windows.Forms.Padding(3, 2, 3, 2); this.webBrowser.MinimumSize = new System.Drawing.Size(20, 20); this.webBrowser.Name = "webBrowser"; this.webBrowser.ScriptErrorsSuppressed = true; this.webBrowser.Size = new System.Drawing.Size(917, 25); this.webBrowser.TabIndex = 0; this.webBrowser.WebBrowserShortcutsEnabled = false; // // splitScreenVerticallyToolStripMenuItem // this.splitScreenVerticallyToolStripMenuItem.CheckOnClick = true; this.splitScreenVerticallyToolStripMenuItem.Name = "splitScreenVerticallyToolStripMenuItem"; this.splitScreenVerticallyToolStripMenuItem.Size = new System.Drawing.Size(289, 24); this.splitScreenVerticallyToolStripMenuItem.Text = "Split screen vertically"; this.splitScreenVerticallyToolStripMenuItem.Click += new System.EventHandler(this.splitScreenVerticallyToolStripMenuItem_Click); // // pTC // this.pTC.AlternatingColorScheme = 0; this.pTC.BackColor = System.Drawing.SystemColors.InactiveBorder; this.pTC.Brightness = 0.97D; this.pTC.CurrentPair = 0; this.pTC.DebugString = null; this.pTC.Dock = System.Windows.Forms.DockStyle.Fill; this.pTC.EditMode = false; this.pTC.EditWhenNipped = false; this.pTC.FirstRenderedPair = 0; stringFormat1.Alignment = System.Drawing.StringAlignment.Near; stringFormat1.FormatFlags = ((System.Drawing.StringFormatFlags)(((System.Drawing.StringFormatFlags.FitBlackBox | System.Drawing.StringFormatFlags.LineLimit) | System.Drawing.StringFormatFlags.NoClip))); stringFormat1.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.None; stringFormat1.LineAlignment = System.Drawing.StringAlignment.Near; stringFormat1.Trimming = System.Drawing.StringTrimming.None; this.pTC.GT = stringFormat1; this.pTC.HighlightedPair = 0; this.pTC.HighlightFirstWords = true; this.pTC.HighlightFragments = true; this.pTC.LastFullScreenLine = 0; this.pTC.LastMouseX = -1; this.pTC.LastMouseY = -1; this.pTC.LastRenderedPair = 0; this.pTC.Location = new System.Drawing.Point(0, 0); this.pTC.Margin = new System.Windows.Forms.Padding(5); this.pTC.MinimumSize = new System.Drawing.Size(13, 12); this.pTC.Modified = false; this.pTC.MouseCurrentWord = null; this.pTC.MousePressed = false; this.pTC.MouseStatus = ((byte)(0)); this.pTC.Name = "pTC"; this.pTC.NaturalDividerPosition1 = 0; this.pTC.NaturalDividerPosition1W = null; this.pTC.NaturalDividerPosition2 = 0; this.pTC.NaturalDividerPosition2W = null; this.pTC.NumberOfScreenLines = 0; this.pTC.PanelMargin = 10; this.pTC.PrimaryBG = null; parallelText1.Author1 = null; parallelText1.Author2 = null; parallelText1.FileName = null; parallelText1.Info = null; parallelText1.Info1 = null; parallelText1.Info2 = null; parallelText1.Lang1 = null; parallelText1.Lang2 = null; parallelText1.Title1 = null; parallelText1.Title2 = null; parallelText1.WithAudio = false; this.pTC.PText = parallelText1; this.pTC.ReadingMode = 0; this.pTC.Reversed = false; this.pTC.RightPosition = 445; this.pTC.SecondaryBG = null; this.pTC.Selection1Pair = 0; this.pTC.Selection1Position = 0; this.pTC.Selection2Pair = 0; this.pTC.Selection2Position = 0; this.pTC.SelectionFinished = true; this.pTC.SelectionSide = ((byte)(0)); this.pTC.Side1Set = false; this.pTC.Side2Set = false; this.pTC.Size = new System.Drawing.Size(899, 230); this.pTC.SpaceLength = 6; this.pTC.SplitterMoveOffset = 0; this.pTC.SplitterPosition = 445; this.pTC.SplitterRatio = 0F; this.pTC.SplitterWidth = 4; this.pTC.TabIndex = 3; this.pTC.VMargin = 3; this.pTC.KeyDown += new System.Windows.Forms.KeyEventHandler(this.pTC_KeyDown); this.pTC.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.pTC_KeyPress); this.pTC.KeyUp += new System.Windows.Forms.KeyEventHandler(this.pTC_KeyUp); this.pTC.MouseDown += new System.Windows.Forms.MouseEventHandler(this.parallelTextControl_MouseDown); this.pTC.MouseLeave += new System.EventHandler(this.parallelTextControl_MouseLeave); this.pTC.MouseMove += new System.Windows.Forms.MouseEventHandler(this.parallelTextControl_MouseMove); this.pTC.MouseUp += new System.Windows.Forms.MouseEventHandler(this.parallelTextControl_MouseUp); // // MainForm // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(917, 325); this.Controls.Add(this.mainMenu); this.Controls.Add(this.statusStrip); this.Controls.Add(this.splitContainer); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.KeyPreview = true; this.MainMenuStrip = this.mainMenu; this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4); this.Name = "MainForm"; this.Text = "Aglona Reader"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); this.Load += new System.EventHandler(this.MainForm_Load); this.Resize += new System.EventHandler(this.MainForm_Resize); this.mainMenu.ResumeLayout(false); this.mainMenu.PerformLayout(); this.statusStrip.ResumeLayout(false); this.statusStrip.PerformLayout(); this.splitContainer.Panel1.ResumeLayout(false); this.splitContainer.Panel2.ResumeLayout(false); this.splitContainer.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Drawing.StringFormat stringFormat1 = new System.Drawing.StringFormat(); this.lblStatusHeader = new System.Windows.Forms.Label(); this.lblStatus = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.lblDate = new System.Windows.Forms.Label(); this.lblTime = new System.Windows.Forms.Label(); this.btnQue = new System.Windows.Forms.Button(); this.btnCustomerData = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.txtCustomerPhone = new System.Windows.Forms.TextBox(); this.txtCustomerName = new System.Windows.Forms.TextBox(); this.txtEngineSize = new System.Windows.Forms.TextBox(); this.txtModel = new System.Windows.Forms.TextBox(); this.txtMake = new System.Windows.Forms.TextBox(); this.txtYear = new System.Windows.Forms.TextBox(); this.txtTagNumber = new System.Windows.Forms.TextBox(); this.btnOpen = new System.Windows.Forms.Button(); this.btnTender = new System.Windows.Forms.Button(); this.lstbxServices = new CustomControls.CustomListbox(); this.label4 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.label8 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); this.ucKeypadHome1 = new JandJPOS.ucKeypadHome(); this.SuspendLayout(); // // lblStatusHeader // this.lblStatusHeader.AutoSize = true; this.lblStatusHeader.Location = new System.Drawing.Point(184, 590); this.lblStatusHeader.Name = "lblStatusHeader"; this.lblStatusHeader.Size = new System.Drawing.Size(48, 16); this.lblStatusHeader.TabIndex = 16; this.lblStatusHeader.Text = "Status:"; // // lblStatus // this.lblStatus.Location = new System.Drawing.Point(243, 590); this.lblStatus.Name = "lblStatus"; this.lblStatus.Size = new System.Drawing.Size(521, 16); this.lblStatus.TabIndex = 17; this.lblStatus.Text = "[Status]"; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(192, 620); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(40, 16); this.label2.TabIndex = 18; this.label2.Text = "Date:"; // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(192, 650); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(45, 16); this.label3.TabIndex = 19; this.label3.Text = "Time: "; // // lblDate // this.lblDate.Location = new System.Drawing.Point(243, 620); this.lblDate.Name = "lblDate"; this.lblDate.Size = new System.Drawing.Size(521, 16); this.lblDate.TabIndex = 20; this.lblDate.Text = "[Date]"; // // lblTime // this.lblTime.Location = new System.Drawing.Point(243, 650); this.lblTime.Name = "lblTime"; this.lblTime.Size = new System.Drawing.Size(521, 16); this.lblTime.TabIndex = 21; this.lblTime.Text = "[Time]"; // // btnQue // this.btnQue.Location = new System.Drawing.Point(13, 475); this.btnQue.Name = "btnQue"; this.btnQue.Size = new System.Drawing.Size(165, 119); this.btnQue.TabIndex = 32; this.btnQue.Text = "Place Ticket in Que"; this.btnQue.UseVisualStyleBackColor = true; // // btnCustomerData // this.btnCustomerData.Location = new System.Drawing.Point(13, 344); this.btnCustomerData.Name = "btnCustomerData"; this.btnCustomerData.Size = new System.Drawing.Size(165, 119); this.btnCustomerData.TabIndex = 31; this.btnCustomerData.Tag = "0"; this.btnCustomerData.Text = "Customer Data"; this.btnCustomerData.UseVisualStyleBackColor = true; // // label1 // this.label1.Location = new System.Drawing.Point(14, 221); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(164, 24); this.label1.TabIndex = 30; this.label1.Text = "____________________________________"; // // txtCustomerPhone // this.txtCustomerPhone.BackColor = System.Drawing.Color.LightGray; this.txtCustomerPhone.Enabled = false; this.txtCustomerPhone.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtCustomerPhone.Location = new System.Drawing.Point(13, 287); this.txtCustomerPhone.Margin = new System.Windows.Forms.Padding(4); this.txtCustomerPhone.Multiline = true; this.txtCustomerPhone.Name = "txtCustomerPhone"; this.txtCustomerPhone.ReadOnly = true; this.txtCustomerPhone.Size = new System.Drawing.Size(165, 38); this.txtCustomerPhone.TabIndex = 29; this.txtCustomerPhone.Text = "Phone"; this.txtCustomerPhone.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // // txtCustomerName // this.txtCustomerName.BackColor = System.Drawing.Color.LightGray; this.txtCustomerName.Enabled = false; this.txtCustomerName.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtCustomerName.Location = new System.Drawing.Point(13, 249); this.txtCustomerName.Margin = new System.Windows.Forms.Padding(4); this.txtCustomerName.Multiline = true; this.txtCustomerName.Name = "txtCustomerName"; this.txtCustomerName.ReadOnly = true; this.txtCustomerName.Size = new System.Drawing.Size(165, 38); this.txtCustomerName.TabIndex = 28; this.txtCustomerName.Text = "Customer Name"; this.txtCustomerName.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // // txtEngineSize // this.txtEngineSize.BackColor = System.Drawing.Color.LightGray; this.txtEngineSize.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtEngineSize.Location = new System.Drawing.Point(13, 179); this.txtEngineSize.Margin = new System.Windows.Forms.Padding(4); this.txtEngineSize.Multiline = true; this.txtEngineSize.Name = "txtEngineSize"; this.txtEngineSize.ReadOnly = true; this.txtEngineSize.Size = new System.Drawing.Size(165, 38); this.txtEngineSize.TabIndex = 27; this.txtEngineSize.Text = "Engine"; this.txtEngineSize.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.txtEngineSize.Click += new System.EventHandler(this.VehicleTextBox_MouseClick); // // txtModel // this.txtModel.BackColor = System.Drawing.Color.LightGray; this.txtModel.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtModel.Location = new System.Drawing.Point(13, 141); this.txtModel.Margin = new System.Windows.Forms.Padding(4); this.txtModel.Multiline = true; this.txtModel.Name = "txtModel"; this.txtModel.ReadOnly = true; this.txtModel.Size = new System.Drawing.Size(165, 38); this.txtModel.TabIndex = 26; this.txtModel.Text = "Model"; this.txtModel.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.txtModel.Click += new System.EventHandler(this.VehicleTextBox_MouseClick); // // txtMake // this.txtMake.BackColor = System.Drawing.Color.LightGray; this.txtMake.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtMake.Location = new System.Drawing.Point(13, 103); this.txtMake.Margin = new System.Windows.Forms.Padding(4); this.txtMake.Multiline = true; this.txtMake.Name = "txtMake"; this.txtMake.ReadOnly = true; this.txtMake.Size = new System.Drawing.Size(165, 38); this.txtMake.TabIndex = 25; this.txtMake.Text = "Make"; this.txtMake.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.txtMake.Click += new System.EventHandler(this.VehicleTextBox_MouseClick); // // txtYear // this.txtYear.BackColor = System.Drawing.Color.LightGray; this.txtYear.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtYear.Location = new System.Drawing.Point(13, 65); this.txtYear.Margin = new System.Windows.Forms.Padding(4); this.txtYear.Multiline = true; this.txtYear.Name = "txtYear"; this.txtYear.ReadOnly = true; this.txtYear.Size = new System.Drawing.Size(165, 38); this.txtYear.TabIndex = 24; this.txtYear.Text = "Year"; this.txtYear.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; this.txtYear.Click += new System.EventHandler(this.VehicleTextBox_MouseClick); // // txtTagNumber // this.txtTagNumber.CharacterCasing = System.Windows.Forms.CharacterCasing.Upper; this.txtTagNumber.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.txtTagNumber.Location = new System.Drawing.Point(13, 15); this.txtTagNumber.Margin = new System.Windows.Forms.Padding(4); this.txtTagNumber.Multiline = true; this.txtTagNumber.Name = "txtTagNumber"; this.txtTagNumber.ReadOnly = true; this.txtTagNumber.Size = new System.Drawing.Size(165, 50); this.txtTagNumber.TabIndex = 23; this.txtTagNumber.Text = "TAG"; this.txtTagNumber.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; // // btnOpen // this.btnOpen.Location = new System.Drawing.Point(13, 604); this.btnOpen.Name = "btnOpen"; this.btnOpen.Size = new System.Drawing.Size(165, 119); this.btnOpen.TabIndex = 33; this.btnOpen.Text = "Open Ticket"; this.btnOpen.UseVisualStyleBackColor = true; // // btnTender // this.btnTender.Location = new System.Drawing.Point(798, 583); this.btnTender.Name = "btnTender"; this.btnTender.Size = new System.Drawing.Size(204, 140); this.btnTender.TabIndex = 34; this.btnTender.Text = "Tender"; this.btnTender.UseVisualStyleBackColor = true; // // lstbxServices // this.lstbxServices.CheckedBoxListItem = true; this.lstbxServices.CheckedItemImage = null; this.lstbxServices.DetailsFont = new System.Drawing.Font("Arial", 9F); this.lstbxServices.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable; this.lstbxServices.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); stringFormat1.Alignment = System.Drawing.StringAlignment.Near; stringFormat1.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.None; stringFormat1.LineAlignment = System.Drawing.StringAlignment.Near; stringFormat1.Trimming = System.Drawing.StringTrimming.Character; this.lstbxServices.Format = stringFormat1; this.lstbxServices.FormattingEnabled = true; this.lstbxServices.ImageSize = new System.Drawing.Size(0, 0); this.lstbxServices.ItemHeight = 43; this.lstbxServices.ItemImage = null; this.lstbxServices.Location = new System.Drawing.Point(798, 13); this.lstbxServices.Margin = new System.Windows.Forms.Padding(4, 4, 4, 0); this.lstbxServices.Name = "lstbxServices"; this.lstbxServices.Size = new System.Drawing.Size(197, 435); this.lstbxServices.TabIndex = 35; this.lstbxServices.TitleFont = new System.Drawing.Font("Arial", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); // // label4 // this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(802, 458); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(66, 16); this.label4.TabIndex = 36; this.label4.Text = "SubTotal:"; // // label5 // this.label5.AutoSize = true; this.label5.Location = new System.Drawing.Point(834, 483); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(34, 16); this.label5.TabIndex = 37; this.label5.Text = "Tax:"; // // label6 // this.label6.AutoSize = true; this.label6.Location = new System.Drawing.Point(826, 508); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(42, 16); this.label6.TabIndex = 38; this.label6.Text = "Total:"; // // label7 // this.label7.Location = new System.Drawing.Point(874, 458); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(121, 16); this.label7.TabIndex = 39; this.label7.Tag = ""; this.label7.Text = "[SubTotal]"; this.label7.TextAlign = System.Drawing.ContentAlignment.TopRight; // // label8 // this.label8.Location = new System.Drawing.Point(874, 483); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(121, 16); this.label8.TabIndex = 40; this.label8.Tag = ""; this.label8.Text = "[Tax]"; this.label8.TextAlign = System.Drawing.ContentAlignment.TopRight; // // label9 // this.label9.Location = new System.Drawing.Point(874, 508); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(121, 16); this.label9.TabIndex = 41; this.label9.Tag = ""; this.label9.Text = "[Total]"; this.label9.TextAlign = System.Drawing.ContentAlignment.TopRight; // // ucKeypadHome1 // this.ucKeypadHome1.Location = new System.Drawing.Point(186, 13); this.ucKeypadHome1.Margin = new System.Windows.Forms.Padding(4); this.ucKeypadHome1.Name = "ucKeypadHome1"; this.ucKeypadHome1.Size = new System.Drawing.Size(604, 553); this.ucKeypadHome1.TabIndex = 15; this.ucKeypadHome1.OilChangeClicked += new System.EventHandler(this.ucKeypadHome1_OilChangeClicked); this.ucKeypadHome1.AirFilterClicked += new System.EventHandler(this.ucKeypadHome1_AirFilterClicked); this.ucKeypadHome1.TireRotationClicked += new System.EventHandler(this.ucKeypadHome1_TireRotationClicked); this.ucKeypadHome1.BatteryReplacementClicked += new System.EventHandler(this.ucKeypadHome1_BatteryReplacementClicked); this.ucKeypadHome1.WiperBladesClicked += new System.EventHandler(this.ucKeypadHome1_WiperBladesClicked); this.ucKeypadHome1.CustomClicked += new System.EventHandler(this.ucKeypadHome1_CustomClicked); // // frmTicket // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1008, 729); this.Controls.Add(this.label9); this.Controls.Add(this.label8); this.Controls.Add(this.label7); this.Controls.Add(this.label6); this.Controls.Add(this.label5); this.Controls.Add(this.label4); this.Controls.Add(this.lstbxServices); this.Controls.Add(this.btnTender); this.Controls.Add(this.btnOpen); this.Controls.Add(this.btnQue); this.Controls.Add(this.btnCustomerData); this.Controls.Add(this.label1); this.Controls.Add(this.txtCustomerPhone); this.Controls.Add(this.txtCustomerName); this.Controls.Add(this.txtEngineSize); this.Controls.Add(this.txtModel); this.Controls.Add(this.txtMake); this.Controls.Add(this.txtYear); this.Controls.Add(this.txtTagNumber); this.Controls.Add(this.lblTime); this.Controls.Add(this.lblDate); this.Controls.Add(this.label3); this.Controls.Add(this.label2); this.Controls.Add(this.lblStatus); this.Controls.Add(this.lblStatusHeader); this.Controls.Add(this.ucKeypadHome1); this.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.Margin = new System.Windows.Forms.Padding(4); this.Name = "frmTicket"; this.Text = "frmTicket"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.frmTicket_FormClosing); this.Load += new System.EventHandler(this.frmTicket_Load); this.ResumeLayout(false); this.PerformLayout(); }
/// <summary> /// Changes the cursor for this control to show the coordinates /// </summary> /// <param name="uiElement"></param> private void SetCoordinatesOnCursor(FrameworkElement uiElement) { Point coordinate = locked ? lockPoint : lastCoordinate; Cursor newCursor = null; SysSystem.Drawing.Font cursorFont = new SysSystem.Drawing.Font("Arial", 8f); try { // Lets get the string to be printed string coordinateText = coordinate.X.ToString(xFormat) + "," + coordinate.Y.ToString(yFormat); // Calculate the rectangle required to draw the string SysSystem.Drawing.SizeF textSize = GetTextSize(coordinateText, cursorFont); // ok, so here's the minimum 1/4 size of the bitmap we need, as the // Hotspot for the cursor will be in the centre of the bitmap. int minWidth = 8 + (int)SysSystem.Math.Ceiling(textSize.Width); int minHeight = 8 + (int)SysSystem.Math.Ceiling(textSize.Height); // If the bitmap needs to be resized, then resize it, else just clear it if (cursorBitmap.Width < minWidth * 2 || cursorBitmap.Height < minHeight * 2) { SysSystem.Drawing.Bitmap oldBitmap = cursorBitmap; cursorBitmap = new SysSystem.Drawing.Bitmap(SysSystem.Math.Max(cursorBitmap.Width, minWidth * 2), SysSystem.Math.Max(cursorBitmap.Height, minHeight * 2)); oldBitmap.Dispose(); } // Get the centre of the bitmap which will be the Hotspot SysSystem.Drawing.Point centre = new SysSystem.Drawing.Point(cursorBitmap.Width / 2, cursorBitmap.Height / 2); /// Calculate the text rectangle SysSystem.Drawing.Rectangle textRectangle = new SysSystem.Drawing.Rectangle(centre.X + 8, centre.Y + 8, minWidth - 8, minHeight - 8); int diff = (int)cursorPosition.X + textRectangle.Right / 2 - 3 - (int)uiElement.ActualWidth; if (diff > 0) { textRectangle.Location = new SysSystem.Drawing.Point(textRectangle.Left - diff, textRectangle.Top); } // Draw the target symbol, and the coordinate text on the bitmap using (SysSystem.Drawing.Graphics g = SysSystem.Drawing.Graphics.FromImage(cursorBitmap)) { g.SmoothingMode = SysSystem.Drawing.Drawing2D.SmoothingMode.AntiAlias; // This line causes a crash on laptops when you render a string // g.CompositingMode = CompositingMode.SourceCopy; g.Clear(SysSystem.Drawing.Color.Transparent); float targetX = centre.X; float targetY = centre.Y; float radius = 30; if (!locked) { SysSystem.Drawing.Pen blackPen = new SysSystem.Drawing.Pen(SysSystem.Drawing.Color.FromArgb(255, 0, 0, 0), 1.4f); g.DrawEllipse(blackPen, targetX - radius * .5f, targetY - radius * .5f, radius, radius); g.DrawLine(blackPen, targetX - radius * .8f, targetY, targetX - 2f, targetY); g.DrawLine(blackPen, targetX + 2f, targetY, targetX + radius * .8f, targetY); g.DrawLine(blackPen, targetX, targetY - radius * .8f, targetX, targetY - 2f); g.DrawLine(blackPen, targetX, targetY + 2f, targetX, targetY + radius * .8f); } else { SysSystem.Drawing.Pen blackPen = new SysSystem.Drawing.Pen(SysSystem.Drawing.Color.FromArgb(255, 0, 0, 0), 3f); SysSystem.Drawing.Pen yellowPen = new SysSystem.Drawing.Pen(SysSystem.Drawing.Color.FromArgb(255, 255, 255, 0), 2f); g.DrawEllipse(blackPen, targetX - radius * .5f, targetY - radius * .5f, radius, radius); g.DrawEllipse(yellowPen, targetX - radius * .5f, targetY - radius * .5f, radius, radius); } if (!locked) g.FillRectangle(new SysSystem.Drawing.SolidBrush(SysSystem.Drawing.Color.FromArgb(127, 255, 255, 255)), textRectangle); else g.FillRectangle(new SysSystem.Drawing.SolidBrush(SysSystem.Drawing.Color.FromArgb(170, 255, 255, 0)), textRectangle); // Setup the text format for drawing the subnotes using (SysSystem.Drawing.StringFormat stringFormat = new SysSystem.Drawing.StringFormat()) { stringFormat.Trimming = SysSystem.Drawing.StringTrimming.None; stringFormat.FormatFlags = SysSystem.Drawing.StringFormatFlags.NoClip | SysSystem.Drawing.StringFormatFlags.NoWrap; stringFormat.Alignment = SysSystem.Drawing.StringAlignment.Near; // Draw the string left aligned g.DrawString( coordinateText, cursorFont, new SysSystem.Drawing.SolidBrush(SysSystem.Drawing.Color.Black), textRectangle, stringFormat); } } // Now copy the bitmap to the cursor newCursor = WPFCursorFromBitmap.CreateCursor(cursorBitmap); } catch (SysSystem.Exception) { } finally { // After the new cursor has been set, the unmanaged resources can be // cleaned up that were being used by the old cursor if (newCursor != null) { uiElement.Cursor = newCursor; } if (lastCursor != null) { lastCursor.Dispose(); } lastCursor = newCursor; // Save the new values for cleaning up on the next pass } }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Drawing.StringFormat stringFormat1 = new System.Drawing.StringFormat(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LrcFrm)); this.btnmin = new System.Windows.Forms.Button(); this.btnmini = new System.Windows.Forms.Button(); this.btnClose = new System.Windows.Forms.Button(); this.lrcPanel1 = new MediaPlayer.LrcPanel(); this.SuspendLayout(); // // btnmin // this.btnmin.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnmin.BackColor = System.Drawing.Color.Transparent; this.btnmin.FlatAppearance.BorderSize = 0; this.btnmin.FlatAppearance.CheckedBackColor = System.Drawing.Color.Transparent; this.btnmin.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; this.btnmin.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; this.btnmin.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnmin.Image = global::MediaPlayer.Properties.Resources.Wmin1; this.btnmin.Location = new System.Drawing.Point(328, 5); this.btnmin.Name = "btnmin"; this.btnmin.Size = new System.Drawing.Size(18, 18); this.btnmin.TabIndex = 14; this.btnmin.UseVisualStyleBackColor = false; this.btnmin.Click += new System.EventHandler(this.btnmin_Click); // // btnmini // this.btnmini.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnmini.BackColor = System.Drawing.Color.Transparent; this.btnmini.FlatAppearance.BorderSize = 0; this.btnmini.FlatAppearance.CheckedBackColor = System.Drawing.Color.Transparent; this.btnmini.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; this.btnmini.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; this.btnmini.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnmini.Image = global::MediaPlayer.Properties.Resources.Wmini; this.btnmini.Location = new System.Drawing.Point(352, 5); this.btnmini.Name = "btnmini"; this.btnmini.Size = new System.Drawing.Size(18, 18); this.btnmini.TabIndex = 12; this.btnmini.UseVisualStyleBackColor = false; this.btnmini.Click += new System.EventHandler(this.btnmini_Click); // // btnClose // this.btnClose.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.btnClose.BackColor = System.Drawing.Color.Transparent; this.btnClose.FlatAppearance.BorderSize = 0; this.btnClose.FlatAppearance.CheckedBackColor = System.Drawing.Color.Transparent; this.btnClose.FlatAppearance.MouseDownBackColor = System.Drawing.Color.Transparent; this.btnClose.FlatAppearance.MouseOverBackColor = System.Drawing.Color.Transparent; this.btnClose.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnClose.Image = global::MediaPlayer.Properties.Resources.Wclose; this.btnClose.Location = new System.Drawing.Point(376, 5); this.btnClose.Name = "btnClose"; this.btnClose.Size = new System.Drawing.Size(18, 18); this.btnClose.TabIndex = 11; this.btnClose.UseVisualStyleBackColor = false; this.btnClose.Click += new System.EventHandler(this.btnClose_Click); // // lrcPanel1 // this.lrcPanel1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.lrcPanel1.BackColors = System.Drawing.Color.FromArgb(((int)(((byte)(250)))), ((int)(((byte)(245)))), ((int)(((byte)(254))))); this.lrcPanel1.CurrentPosition = null; this.lrcPanel1.FontSty = new System.Drawing.Font("幼圆", 14F); this.lrcPanel1.Location = new System.Drawing.Point(4, 29); this.lrcPanel1.MinimumSize = new System.Drawing.Size(100, 20); this.lrcPanel1.Name = "lrcPanel1"; this.lrcPanel1.Size = new System.Drawing.Size(392, 467); stringFormat1.Alignment = System.Drawing.StringAlignment.Center; stringFormat1.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.None; stringFormat1.LineAlignment = System.Drawing.StringAlignment.Center; stringFormat1.Trimming = System.Drawing.StringTrimming.Character; this.lrcPanel1.StringFormatter = stringFormat1; this.lrcPanel1.TabIndex = 0; // // LrcFrm // this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(141)))), ((int)(((byte)(193)))), ((int)(((byte)(36))))); this.ClientSize = new System.Drawing.Size(400, 500); this.Controls.Add(this.btnmin); this.Controls.Add(this.btnmini); this.Controls.Add(this.btnClose); this.Controls.Add(this.lrcPanel1); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Name = "LrcFrm"; this.ShowInTaskbar = false; this.Text = "MyPlayer"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.LrcFrm_FormClosing); this.Load += new System.EventHandler(this.LrcFrm_Load); this.Resize += new System.EventHandler(this.LrcFrm_Resize); this.ResumeLayout(false); }
/// <summary> /// Initializes a new instance of the <see cref="ThumbnailPage"/> class. /// </summary> /// <param name="creator">The <see cref="ThumbnailCreator"/> /// (only used to get a jpeg compression encoder).</param> /// <param name="tgrid">The <see cref="ThumbnailGrid"/> that specifies /// the page layout.</param> /// <param name="displayFilename">The display name of the <see cref="AVFileSet"/> /// from which the thumbnails are generated.</param> /// <param name="filename">The fullpath of thumbnail page to create.</param> /// <param name="nFiles">The number of files in set (>0 for multi-part videos).</param> /// <param name="time">The time of first thumbnail on page.</param> /// <param name="pageNum">The page number (0 for overview page).</param> /// <param name="duration">The duration of the <see cref="AVFileSet"/>.</param> /// <param name="nPages">The total number of thumbnail pages.</param> /// <param name="stats">The stats of the <see cref="AVFileSet"/> to display /// in header.</param> public ThumbnailPage(ThumbnailCreator creator, ThumbnailGrid tgrid, string displayFilename, string filename, int nFiles, TimeSpan time, int pageNum, TimeSpan duration, int nPages, string stats) { this._creator = creator; this._tgrid = tgrid; this._filename = filename; _pageBitmap = new System.Drawing.Bitmap (tgrid.Layout.Width, tgrid.Layout.Height); _graphics = System.Drawing.Graphics.FromImage (_pageBitmap); _graphics.PageUnit = System.Drawing.GraphicsUnit.Pixel; _graphics.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceOver; //_graphics.CompositingMode = System.Drawing.Drawing2D.CompositingMode.SourceCopy; _graphics.CompositingQuality = System.Drawing.Drawing2D.CompositingQuality.HighQuality; //_graphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.HighQuality; _graphics.PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode.None; // can't use TextRenderingHint.ClearTypeGridFit with CompositingMode.SourceCopy //_graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit; //_graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit; _graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.AntiAliasGridFit; // Affects image resizing _graphics.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; // Affects anti-aliasing of filled edges //_graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; _graphics.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; _font = new System.Drawing.Font ("Arial", (float) (7 * creator.TNSettings.ScaleFactor), System.Drawing.FontStyle.Bold); _brushWhite = new System.Drawing.SolidBrush (System.Drawing.Color.White); _brushBlack = new System.Drawing.SolidBrush (System.Drawing.Color.Black); _borderPen = new System.Drawing.Pen (System.Drawing.Color.Wheat, tgrid.Layout.Border <= 1 ? 0 : tgrid.Layout.Border); _borderHilightPen = new System.Drawing.Pen (System.Drawing.Color.Red, tgrid.Layout.Border <= 1 ? 0 : tgrid.Layout.Border); //_borderPen.Alignment = System.Drawing.Drawing2D.PenAlignment.Inset; //_borderPen.LineJoin = System.Drawing.Drawing2D.LineJoin.Miter; _graphics.FillRectangle (_brushBlack, 0, 0, tgrid.Layout.Width, tgrid.Layout.Height); _thumbFormat = new System.Drawing.StringFormat (); switch (creator.TNSettings.LabelPosition) { case ThumbnailSettings.LabelPositions.None: case ThumbnailSettings.LabelPositions.LowerRight: { _thumbFormat.LineAlignment = System.Drawing.StringAlignment.Far; _thumbFormat.Alignment = System.Drawing.StringAlignment.Far; break; } case ThumbnailSettings.LabelPositions.LowerLeft: { _thumbFormat.LineAlignment = System.Drawing.StringAlignment.Far; _thumbFormat.Alignment = System.Drawing.StringAlignment.Near; break; } case ThumbnailSettings.LabelPositions.UpperRight: { _thumbFormat.LineAlignment = System.Drawing.StringAlignment.Near; _thumbFormat.Alignment = System.Drawing.StringAlignment.Far; break; } case ThumbnailSettings.LabelPositions.UpperLeft: { _thumbFormat.LineAlignment = System.Drawing.StringAlignment.Near; _thumbFormat.Alignment = System.Drawing.StringAlignment.Near; break; } } _headerFormat = new System.Drawing.StringFormat (); _headerFormat.LineAlignment = System.Drawing.StringAlignment.Center; _headerFormat.Alignment = System.Drawing.StringAlignment.Near; float inset = 2*tgrid.Layout.Margin; System.Drawing.RectangleF headerRectF = new System.Drawing.RectangleF (inset, 0, this._tgrid.Layout.Width - 2*inset, this._tgrid.Layout.HeaderHeight); //_graphics.DrawRectangle (_borderPen, // headerRectF.X, // headerRectF.Y, // headerRectF.Width, // headerRectF.Height); string leftSide; string timeformat = @"h\:mm\:ss"; if (time.Milliseconds > 0 && creator.TNSettings.AlwaysShowMilliseconds) timeformat = @"h\:mm\:ss\.ffff"; if (pageNum > 0) leftSide = String.Format ("{0} / {1} ({2} of {3})", time.ToString (timeformat), duration.ToString (@"h\:mm\:ss"), pageNum, nPages); else leftSide = String.Format ("{0}", duration.ToString (@"h\:mm\:ss")); if (nFiles > 0) leftSide += String.Format (" {0} files", nFiles); using (System.Drawing.Font headerFont = new System.Drawing.Font ( ThumbnailPageLayout.FONT_NAME, (float) (ThumbnailPageLayout.FONT_SIZE * creator.TNSettings.ScaleFactor), System.Drawing.FontStyle.Bold)) { _graphics.DrawString (leftSide, headerFont, _brushWhite, headerRectF, _headerFormat); _headerFormat.Alignment = System.Drawing.StringAlignment.Far; _graphics.DrawString (stats, headerFont, _brushWhite, headerRectF, _headerFormat); float left = headerRectF.Left + _graphics.MeasureString(leftSide, headerFont).Width; float right = headerRectF.Right - _graphics.MeasureString (stats, headerFont).Width; headerRectF = new System.Drawing.RectangleF ( left, headerRectF.Top, right - left, headerRectF.Height); _headerFormat.Alignment = System.Drawing.StringAlignment.Center; _graphics.DrawString (displayFilename, headerFont, _brushWhite, headerRectF, _headerFormat); } _pageNum = pageNum; _currentCol = 0; _currentRow = 0; }
public System.Drawing.Bitmap GenerateMap( System.Drawing.Bitmap background = null ) { int minx = int.MaxValue; int maxx = int.MinValue; int miny = int.MaxValue; int maxy = int.MinValue; int minz = int.MaxValue; int maxz = int.MinValue; foreach ( var spd in SearchPointDefinitions ) { minx = Math.Min( minx, spd.CoordX ); miny = Math.Min( miny, spd.CoordY ); minz = Math.Min( minz, spd.CoordZ ); maxx = Math.Max( maxx, spd.CoordX ); maxy = Math.Max( maxy, spd.CoordY ); maxz = Math.Max( maxz, spd.CoordZ ); } int extentx = maxx - minx; int extenty = maxy - miny; int extentz = maxz - minz; double factor = 0.05115; int padx = 222; int pady = 185; System.Drawing.Bitmap bmp; if ( background == null ) { bmp = new System.Drawing.Bitmap( (int)( extentx * factor + 1 + padx * 2 ), (int)( extentz * factor + 1 + pady * 2 ) ); } else { bmp = new System.Drawing.Bitmap( background ); } int idx = 1; foreach ( var spd in SearchPointDefinitions ) { if ( spd.Unknown11 != 1 ) { continue; } // not sure what these mean exactly but only the ones with an '1' here show up in game System.Drawing.Color color = System.Drawing.Color.Black; System.Drawing.Color border = System.Drawing.Color.White; switch ( spd.SearchPointType ) { case 0: color = System.Drawing.Color.SpringGreen; border = System.Drawing.Color.Black; break; // tree stump case 1: // shells if ( spd.CoordY < 0 ) { color = System.Drawing.Color.Red; // in water border = System.Drawing.Color.White; } else { color = System.Drawing.Color.Aqua; // on beach border = System.Drawing.Color.Black; } break; case 2: color = System.Drawing.Color.FromArgb( 212, 212, 0 ); border = System.Drawing.Color.Black; break; // bones case 3: color = System.Drawing.Color.DarkBlue; border = System.Drawing.Color.White; break; // seagulls } //SetPixelArea( bmp, (int)( ( spd.CoordX - minx ) * factor + padx ), (int)( ( extentz - ( spd.CoordZ - minz ) ) * factor + pady ), color, border ); System.Drawing.Graphics g = System.Drawing.Graphics.FromImage( bmp ); g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic; g.TextRenderingHint = System.Drawing.Text.TextRenderingHint.ClearTypeGridFit; System.Drawing.StringFormat fmt = new System.Drawing.StringFormat( System.Drawing.StringFormatFlags.NoClip ) { Alignment = System.Drawing.StringAlignment.Center, LineAlignment = System.Drawing.StringAlignment.Center }; //System.Drawing.Font font = new System.Drawing.Font( "Gentium Book", 32.0f, System.Drawing.GraphicsUnit.Pixel ); int x = (int)( ( spd.CoordX - minx ) * factor + padx ); int y = (int)( ( extentz - ( spd.CoordZ - minz ) ) * factor + pady ); System.Drawing.Drawing2D.GraphicsPath path = new System.Drawing.Drawing2D.GraphicsPath(); path.AddString( idx.ToString(), new System.Drawing.FontFamily( "Gentium Book" ), (int)System.Drawing.FontStyle.Regular, 80.0f, new System.Drawing.Point( x, y + 4 ), fmt ); g.DrawPath( new System.Drawing.Pen( border, 8 ), path ); g.FillPath( new System.Drawing.SolidBrush( color ), path ); g.Flush(); ++idx; } return bmp; }
private void PaintTabText(System.Drawing.Graphics graph, int index) { Rectangle rect = this.GetTabRect(index); Rectangle rect2 = new Rectangle(rect.Left + 8, rect.Top + 1, rect.Width - 6, rect.Height); if (index == 0) { rect2 = new Rectangle(rect.Left + rect.Height, rect.Top + 1, rect.Width - rect.Height, rect.Height); } string tabtext = this.TabPages[index].Text; System.Drawing.StringFormat format = new System.Drawing.StringFormat(); format.Alignment = StringAlignment.Near; format.LineAlignment = StringAlignment.Center; format.Trimming = StringTrimming.EllipsisCharacter; Brush forebrush = null; if (this.TabPages[index].Enabled == false) { forebrush = SystemBrushes.ControlDark; } else { forebrush = SystemBrushes.ControlText; } Font tabFont = this.Font; if (index == this.SelectedIndex) { tabFont = new Font(this.Font, FontStyle.Bold); if (index == 0) { rect2 = new Rectangle(rect.Left + rect.Height, rect.Top + 1, rect.Width - rect.Height + 5, rect.Height); } } graph.DrawString(tabtext, tabFont, forebrush, rect2, format); }
void FeedListView_DrawItem(object sender, DrawListViewItemEventArgs e) { if (this.View == View.Tile) { Feed feed = (Feed) e.Item.Tag; // draw the background and focus rectangle for selected and non-selected states e.DrawBackground(); if (e.Item.Selected) { e.Graphics.FillRectangle(System.Drawing.Brushes.LightGray, e.Bounds); ControlPaint.DrawFocusRectangle(e.Graphics, e.Bounds); } // draw icon int newX = e.Bounds.Left; /* System.Drawing.Image img = this.imageList.Images[e.Item.ImageKey]; if (img != null) { int x = e.Bounds.Left; int y = e.Bounds.Top; e.Graphics.DrawImage(img, x, y); newX = e.Bounds.Left + img.Width + this.Margin.Right; img.Dispose(); } * */ // draw main text System.Drawing.RectangleF rect = new System.Drawing.RectangleF(newX, e.Bounds.Top, e.Bounds.Right - newX, e.Item.Font.Height); System.Drawing.StringFormat sf = new System.Drawing.StringFormat(); sf.Trimming = System.Drawing.StringTrimming.EllipsisCharacter; sf.FormatFlags = System.Drawing.StringFormatFlags.NoClip; System.Drawing.SolidBrush foreBrush = new System.Drawing.SolidBrush(e.Item.ForeColor); using (foreBrush) { e.Graphics.DrawString(feed.Name, e.Item.Font, foreBrush, rect, sf); } // draw subitems System.Drawing.Color subColor = System.Drawing.Color.FromArgb(System.Drawing.SystemColors.GrayText.ToArgb()); System.Drawing.SolidBrush subBrush = new System.Drawing.SolidBrush(subColor); using (subBrush) { for (int i = 1; i < this.Columns.Count; i++) { if (i < e.Item.SubItems.Count) { rect.Offset(0, e.Item.Font.Height); e.Graphics.DrawString(e.Item.SubItems[i].Text, e.Item.Font, subBrush, rect, sf); } } } } else { e.DrawDefault = true; } }
/// <summary> /// 设计器支持所需的方法 - 不要修改 /// 使用代码编辑器修改此方法的内容。 /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.Drawing.StringFormat stringFormat1 = new System.Drawing.StringFormat(); this.MainStripMenu = new System.Windows.Forms.MenuStrip(); this.FileMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.CreateMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.OpenMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.SaveMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ExitMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.HelpMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.AboutMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.SelectedColorButton = new System.Windows.Forms.Button(); this.MainTopTab = new System.Windows.Forms.TabControl(); this.ThumbMenuStrip = new System.Windows.Forms.ContextMenuStrip(this.components); this.OpenToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.MainStatusStrip = new System.Windows.Forms.StatusStrip(); this.CurrPathStatusLabel = new System.Windows.Forms.ToolStripStatusLabel(); this.ColorList = new CozyPixel.Controls.ColorListView(); this.MainLeftTab = new CozyPixel.Controls.VerticalTabControl(); this.GridOpeionPage = new System.Windows.Forms.TabPage(); this.GridWidthLabel = new System.Windows.Forms.Label(); this.GridWidthBox = new System.Windows.Forms.TextBox(); this.ShowGridCheckBox = new System.Windows.Forms.CheckBox(); this.GridColorButton = new System.Windows.Forms.Button(); this.ColorLabel = new System.Windows.Forms.Label(); this.FileSelectPage = new System.Windows.Forms.TabPage(); this.RefreshThumbListButton = new System.Windows.Forms.Button(); this.ThumbListView = new CozyPixel.Controls.ImageListView(); this.DirectorySelectButton = new System.Windows.Forms.Button(); this.PixelPainter = new CozyPixel.Controls.PixelPaintControl(); this.ColorPage = new System.Windows.Forms.TabPage(); this.CozyColorPage = new System.Windows.Forms.TabPage(); this.button1 = new System.Windows.Forms.Button(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.MainStripMenu.SuspendLayout(); this.MainTopTab.SuspendLayout(); this.ThumbMenuStrip.SuspendLayout(); this.MainStatusStrip.SuspendLayout(); this.MainLeftTab.SuspendLayout(); this.GridOpeionPage.SuspendLayout(); this.FileSelectPage.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.PixelPainter)).BeginInit(); this.ColorPage.SuspendLayout(); this.MainTopTab.SuspendLayout(); this.CozyColorPage.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit(); this.SuspendLayout(); // // MainStripMenu // this.MainStripMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.FileMenuItem, this.HelpMenuItem}); this.MainStripMenu.Location = new System.Drawing.Point(0, 0); this.MainStripMenu.Name = "MainStripMenu"; this.MainStripMenu.Size = new System.Drawing.Size(1008, 25); this.MainStripMenu.TabIndex = 1; this.MainStripMenu.Text = "menuStrip1"; // // FileMenuItem // this.FileMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.CreateMenuItem, this.OpenMenuItem, this.SaveMenuItem, this.ExitMenuItem}); this.FileMenuItem.Name = "FileMenuItem"; this.FileMenuItem.Size = new System.Drawing.Size(44, 21); this.FileMenuItem.Text = "文件"; // // CreateMenuItem // this.CreateMenuItem.Name = "CreateMenuItem"; this.CreateMenuItem.Size = new System.Drawing.Size(100, 22); this.CreateMenuItem.Text = "新建"; this.CreateMenuItem.Click += new System.EventHandler(this.CreateMenuItem_Click); // // OpenMenuItem // this.OpenMenuItem.Name = "OpenMenuItem"; this.OpenMenuItem.Size = new System.Drawing.Size(100, 22); this.OpenMenuItem.Text = "打开"; this.OpenMenuItem.Click += new System.EventHandler(this.OpenMenuItem_Click); // // SaveMenuItem // this.SaveMenuItem.Name = "SaveMenuItem"; this.SaveMenuItem.Size = new System.Drawing.Size(100, 22); this.SaveMenuItem.Text = "保存"; this.SaveMenuItem.Click += new System.EventHandler(this.SaveMenuItem_Click); // // ExitMenuItem // this.ExitMenuItem.Name = "ExitMenuItem"; this.ExitMenuItem.Size = new System.Drawing.Size(100, 22); this.ExitMenuItem.Text = "退出"; this.ExitMenuItem.Click += new System.EventHandler(this.ExitMenuItem_Click); // // HelpMenuItem // this.HelpMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] { this.AboutMenuItem}); this.HelpMenuItem.Name = "HelpMenuItem"; this.HelpMenuItem.Size = new System.Drawing.Size(44, 21); this.HelpMenuItem.Text = "帮助"; // // AboutMenuItem // this.AboutMenuItem.Name = "AboutMenuItem"; this.AboutMenuItem.Size = new System.Drawing.Size(100, 22); this.AboutMenuItem.Text = "关于"; this.AboutMenuItem.Click += new System.EventHandler(this.AboutMenuItem_Click); // // ThumbMenuStrip // this.ThumbMenuStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.OpenToolStripMenuItem}); this.ThumbMenuStrip.Name = "contextMenuStrip1"; this.ThumbMenuStrip.Size = new System.Drawing.Size(101, 26); // // OpenToolStripMenuItem // this.OpenToolStripMenuItem.Name = "OpenToolStripMenuItem"; this.OpenToolStripMenuItem.Size = new System.Drawing.Size(100, 22); this.OpenToolStripMenuItem.Text = "打开"; this.OpenToolStripMenuItem.Click += new System.EventHandler(this.OpenToolStripMenuItem_Click); // // MainStatusStrip // this.MainStatusStrip.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.CurrPathStatusLabel}); this.MainStatusStrip.Location = new System.Drawing.Point(0, 707); this.MainStatusStrip.Name = "MainStatusStrip"; this.MainStatusStrip.Size = new System.Drawing.Size(1008, 22); this.MainStatusStrip.TabIndex = 8; this.MainStatusStrip.Text = "statusStrip1"; // // CurrPathStatusLabel // this.CurrPathStatusLabel.Name = "CurrPathStatusLabel"; this.CurrPathStatusLabel.Size = new System.Drawing.Size(88, 17); this.CurrPathStatusLabel.Text = "当前文件 : 无"; // // MainLeftTab // this.MainLeftTab.Alignment = System.Windows.Forms.TabAlignment.Left; this.MainLeftTab.Controls.Add(this.GridOpeionPage); this.MainLeftTab.Controls.Add(this.FileSelectPage); this.MainLeftTab.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed; this.MainLeftTab.ItemSize = new System.Drawing.Size(18, 20); stringFormat1.Alignment = System.Drawing.StringAlignment.Center; stringFormat1.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.None; stringFormat1.LineAlignment = System.Drawing.StringAlignment.Center; stringFormat1.Trimming = System.Drawing.StringTrimming.Character; this.MainLeftTab.ItemTextFormat = stringFormat1; this.MainLeftTab.Location = new System.Drawing.Point(12, 28); this.MainLeftTab.Multiline = true; this.MainLeftTab.Name = "MainLeftTab"; this.MainLeftTab.SelectedIndex = 0; this.MainLeftTab.Size = new System.Drawing.Size(243, 672); this.MainLeftTab.TabIndex = 6; // // GridOpeionPage // this.GridOpeionPage.Controls.Add(this.GridWidthLabel); this.GridOpeionPage.Controls.Add(this.GridWidthBox); this.GridOpeionPage.Controls.Add(this.ShowGridCheckBox); this.GridOpeionPage.Controls.Add(this.GridColorButton); this.GridOpeionPage.Controls.Add(this.ColorLabel); this.GridOpeionPage.ForeColor = System.Drawing.SystemColors.ControlText; this.GridOpeionPage.Location = new System.Drawing.Point(24, 4); this.GridOpeionPage.Name = "GridOpeionPage"; this.GridOpeionPage.Padding = new System.Windows.Forms.Padding(3); this.GridOpeionPage.Size = new System.Drawing.Size(215, 664); this.GridOpeionPage.TabIndex = 0; this.GridOpeionPage.Text = "网格选项"; this.GridOpeionPage.UseVisualStyleBackColor = true; // // GridWidthLabel // this.GridWidthLabel.AutoSize = true; this.GridWidthLabel.Location = new System.Drawing.Point(63, 235); this.GridWidthLabel.Name = "GridWidthLabel"; this.GridWidthLabel.Size = new System.Drawing.Size(53, 12); this.GridWidthLabel.TabIndex = 4; this.GridWidthLabel.Text = "网格宽度"; // // GridWidthBox // this.GridWidthBox.Location = new System.Drawing.Point(63, 250); this.GridWidthBox.Name = "GridWidthBox"; this.GridWidthBox.Size = new System.Drawing.Size(100, 21); this.GridWidthBox.TabIndex = 3; this.GridWidthBox.Text = "2"; this.GridWidthBox.TextChanged += new System.EventHandler(this.GridWidthBox_TextChanged); // // ShowGridCheckBox // this.ShowGridCheckBox.AutoSize = true; this.ShowGridCheckBox.Checked = true; this.ShowGridCheckBox.CheckState = System.Windows.Forms.CheckState.Checked; this.ShowGridCheckBox.Location = new System.Drawing.Point(65, 69); this.ShowGridCheckBox.Name = "ShowGridCheckBox"; this.ShowGridCheckBox.Size = new System.Drawing.Size(72, 16); this.ShowGridCheckBox.TabIndex = 2; this.ShowGridCheckBox.Text = "显示网格"; this.ShowGridCheckBox.UseVisualStyleBackColor = true; this.ShowGridCheckBox.CheckedChanged += new System.EventHandler(this.ShowGridCheckBox_CheckedChanged); // // GridColorButton // this.GridColorButton.BackColor = System.Drawing.Color.Black; this.GridColorButton.FlatAppearance.BorderSize = 0; this.GridColorButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.GridColorButton.Location = new System.Drawing.Point(65, 152); this.GridColorButton.Name = "GridColorButton"; this.GridColorButton.Size = new System.Drawing.Size(48, 48); this.GridColorButton.TabIndex = 1; this.GridColorButton.UseVisualStyleBackColor = false; this.GridColorButton.Click += new System.EventHandler(this.GridColorButton_Click); // // ColorLabel // this.ColorLabel.AutoSize = true; this.ColorLabel.Location = new System.Drawing.Point(63, 124); this.ColorLabel.Name = "ColorLabel"; this.ColorLabel.Size = new System.Drawing.Size(53, 12); this.ColorLabel.TabIndex = 0; this.ColorLabel.Text = "网格颜色"; // // FileSelectPage // this.FileSelectPage.Controls.Add(this.RefreshThumbListButton); this.FileSelectPage.Controls.Add(this.ThumbListView); this.FileSelectPage.Controls.Add(this.DirectorySelectButton); this.FileSelectPage.Location = new System.Drawing.Point(24, 4); this.FileSelectPage.Name = "FileSelectPage"; this.FileSelectPage.Padding = new System.Windows.Forms.Padding(3); this.FileSelectPage.Size = new System.Drawing.Size(215, 664); this.FileSelectPage.TabIndex = 1; this.FileSelectPage.Text = "文件选择"; this.FileSelectPage.UseVisualStyleBackColor = true; // // RefreshThumbListButton // this.RefreshThumbListButton.Location = new System.Drawing.Point(26, 47); this.RefreshThumbListButton.Name = "RefreshThumbListButton"; this.RefreshThumbListButton.Size = new System.Drawing.Size(155, 23); this.RefreshThumbListButton.TabIndex = 3; this.RefreshThumbListButton.Text = "刷新"; this.RefreshThumbListButton.UseVisualStyleBackColor = true; this.RefreshThumbListButton.Click += new System.EventHandler(this.RefreshThumbListButton_Click); // // ThumbListView // this.ThumbListView.ContextMenuStrip = this.ThumbMenuStrip; this.ThumbListView.Location = new System.Drawing.Point(26, 76); this.ThumbListView.Name = "ThumbListView"; this.ThumbListView.Size = new System.Drawing.Size(155, 553); this.ThumbListView.TabIndex = 2; this.ThumbListView.UseCompatibleStateImageBehavior = false; // // DirectorySelectButton // this.DirectorySelectButton.Location = new System.Drawing.Point(26, 18); this.DirectorySelectButton.Name = "DirectorySelectButton"; this.DirectorySelectButton.Size = new System.Drawing.Size(155, 23); this.DirectorySelectButton.TabIndex = 0; this.DirectorySelectButton.Text = "更换当前目录"; this.DirectorySelectButton.UseVisualStyleBackColor = true; this.DirectorySelectButton.Click += new System.EventHandler(this.DirectorySelectButton_Click); // // PixelPainter // this.PixelPainter.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.PixelPainter.Cursor = System.Windows.Forms.Cursors.Cross; this.PixelPainter.Location = new System.Drawing.Point(316, 188); this.PixelPainter.Name = "PixelPainter"; this.PixelPainter.Size = new System.Drawing.Size(640, 512); this.PixelPainter.SourceImage = null; this.PixelPainter.TabIndex = 3; this.PixelPainter.TabStop = false; this.PixelPainter.MouseDown += new System.Windows.Forms.MouseEventHandler(this.PictureBox_MouseDown); // // ColorPage // this.ColorPage.Controls.Add(this.ColorList); this.ColorPage.Controls.Add(this.SelectedColorButton); this.ColorPage.Location = new System.Drawing.Point(4, 22); this.ColorPage.Name = "ColorPage"; this.ColorPage.Padding = new System.Windows.Forms.Padding(3); this.ColorPage.Size = new System.Drawing.Size(632, 114); this.ColorPage.TabIndex = 0; this.ColorPage.Text = "24色"; this.ColorPage.UseVisualStyleBackColor = true; // // ColorList // this.ColorList.ColorItemMargin = new System.Windows.Forms.Padding(2); this.ColorList.ColorItemSize = new System.Drawing.Size(46, 20); this.ColorList.Location = new System.Drawing.Point(195, 22); this.ColorList.Name = "ColorList"; this.ColorList.SelectedColor = System.Drawing.Color.Empty; this.ColorList.Size = new System.Drawing.Size(400, 72); this.ColorList.TabIndex = 2; // // SelectedColorButton // this.SelectedColorButton.FlatAppearance.BorderSize = 0; this.SelectedColorButton.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.SelectedColorButton.Location = new System.Drawing.Point(67, 22); this.SelectedColorButton.Name = "SelectedColorButton"; this.SelectedColorButton.Size = new System.Drawing.Size(72, 72); this.SelectedColorButton.TabIndex = 5; this.SelectedColorButton.UseVisualStyleBackColor = true; // // MainTopTab // this.MainTopTab.Controls.Add(this.ColorPage); this.MainTopTab.Controls.Add(this.CozyColorPage); this.MainTopTab.Location = new System.Drawing.Point(316, 28); this.MainTopTab.Name = "MainTopTab"; this.MainTopTab.SelectedIndex = 0; this.MainTopTab.Size = new System.Drawing.Size(640, 140); this.MainTopTab.TabIndex = 7; // // CozyColorPage // this.CozyColorPage.Controls.Add(this.pictureBox1); this.CozyColorPage.Controls.Add(this.button1); this.CozyColorPage.Location = new System.Drawing.Point(4, 22); this.CozyColorPage.Name = "CozyColorPage"; this.CozyColorPage.Size = new System.Drawing.Size(632, 114); this.CozyColorPage.TabIndex = 1; this.CozyColorPage.Text = "CozyColor"; this.CozyColorPage.UseVisualStyleBackColor = true; // // button1 // this.button1.Location = new System.Drawing.Point(15, 17); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(87, 80); this.button1.TabIndex = 0; this.button1.Text = "生成"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // // pictureBox1 // this.pictureBox1.Location = new System.Drawing.Point(108, 17); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(500, 80); this.pictureBox1.TabIndex = 1; this.pictureBox1.TabStop = false; // // CozyPixelForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(1008, 729); this.Controls.Add(this.MainStatusStrip); this.Controls.Add(this.MainTopTab); this.Controls.Add(this.MainLeftTab); this.Controls.Add(this.PixelPainter); this.Controls.Add(this.MainStripMenu); this.MaximizeBox = false; this.MinimizeBox = false; this.Name = "CozyPixelForm"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; this.Text = "CozyPixel 0.5"; this.Load += new System.EventHandler(this.FormMain_Load); this.MainStripMenu.ResumeLayout(false); this.MainStripMenu.PerformLayout(); this.ColorPage.ResumeLayout(false); this.MainTopTab.ResumeLayout(false); this.ThumbMenuStrip.ResumeLayout(false); this.MainStatusStrip.ResumeLayout(false); this.MainStatusStrip.PerformLayout(); this.MainLeftTab.ResumeLayout(false); this.GridOpeionPage.ResumeLayout(false); this.GridOpeionPage.PerformLayout(); this.FileSelectPage.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.PixelPainter)).EndInit(); this.ColorPage.ResumeLayout(false); this.MainTopTab.ResumeLayout(false); this.CozyColorPage.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); }
void HistoryListView_DrawItem(object sender, DrawListViewItemEventArgs e) { if (e.ItemIndex < 0) return; if (this.View == View.Tile) { // draw the background and focus rectangle for selected and non-selected states if (this.SelectedIndices.Contains(e.ItemIndex)) { e.Graphics.FillRectangle(System.Drawing.Brushes.LightGray, e.Bounds); ControlPaint.DrawFocusRectangle(e.Graphics, e.Bounds); } else { e.DrawBackground(); } // draw icon PastNotification pn = (PastNotification)e.Item.Tag; int newX = e.Bounds.Left; if (pn != null) { System.Drawing.Image img = PastNotificationManager.GetImage(pn); using (img) { if (img != null) { int x = e.Bounds.Left + 1; int y = e.Bounds.Top + 1; e.Graphics.DrawImage(img, x, y); newX = e.Bounds.Left + img.Width + this.Margin.Right; } } } // draw main text System.Drawing.RectangleF rect = new System.Drawing.RectangleF(newX, e.Bounds.Top, e.Bounds.Right - newX, e.Item.Font.Height); System.Drawing.StringFormat sf = new System.Drawing.StringFormat(); sf.Trimming = System.Drawing.StringTrimming.EllipsisCharacter; sf.FormatFlags = System.Drawing.StringFormatFlags.NoClip; System.Drawing.SolidBrush foreBrush = new System.Drawing.SolidBrush(e.Item.ForeColor); string text = e.Item.Text.Replace("\r", " - "); using (foreBrush) { e.Graphics.DrawString(text, e.Item.Font, foreBrush, rect, sf); } // draw subitems System.Drawing.Color subColor = System.Drawing.Color.FromArgb(System.Drawing.SystemColors.GrayText.ToArgb()); System.Drawing.SolidBrush subBrush = new System.Drawing.SolidBrush(subColor); using (subBrush) { for (int i = 1; i < this.Columns.Count; i++) { if (i < e.Item.SubItems.Count) { text = e.Item.SubItems[i].Text.Replace("\r", " - "); rect.Offset(0, e.Item.Font.Height); e.Graphics.DrawString(text, e.Item.Font, subBrush, rect, sf); } } } } else { // DO NOT call e.DrawDefault or the DrawSubItem event will not be fired //e.DrawDefault = true; } }
/// <summary></summary> /// <param name="graphics"></param> protected virtual void PaintUsingSystemDrawing(System.Drawing.Graphics graphics) { graphics.Clear(System.Drawing.Color.CornflowerBlue); if (DesignMode) { using (System.Drawing.Brush brush = new System.Drawing.SolidBrush(System.Drawing.Color.WhiteSmoke)) { using (System.Drawing.StringFormat format = new System.Drawing.StringFormat()) { format.Alignment = System.Drawing.StringAlignment.Center; format.LineAlignment = System.Drawing.StringAlignment.Center; graphics.DrawString("Xen WinForms Host Control", Font, brush, ClientRectangle, format); } } } }
public static void PaintUsingSystemDrawing(GdiGraphics graphics, string text, GdiRectangle clientRectangle) { graphics.Clear(GdiColor.CornflowerBlue); using (var brush = new GdiSolidBrush(GdiColor.Black)) using (var format = new GdiStringFormat()) { format.Alignment = GdiStringAlignment.Center; format.LineAlignment = GdiStringAlignment.Center; graphics.DrawString(text, GdiSystemFonts.MessageBoxFont, brush, clientRectangle, format); } }
protected FontManager3D() { _stringFormat = (System.Drawing.StringFormat)System.Drawing.StringFormat.GenericTypographic.Clone(); _stringFormat.FormatFlags |= System.Drawing.StringFormatFlags.MeasureTrailingSpaces; }
private System.Drawing.Point GetDrawStringOffset(System.Drawing.Graphics CurGraphics, System.Int32 X, System.Int32 Y, System.Char CurChar) { //prntSome.printSome("GetDrawStringOffset"); // DrawString doesn't actually print where you tell it to but instead consistently prints // with an offset. This is annoying when the other draw commands do not print with an offset // this method returns a point defining the offset so we can take it off the printstring command. System.Drawing.CharacterRange[] characterRanges = { new System.Drawing.CharacterRange(0, 1) }; System.Drawing.RectangleF layoutRect = new System.Drawing.RectangleF (X, Y, 100, 100); System.Drawing.StringFormat stringFormat = new System.Drawing.StringFormat(); stringFormat.SetMeasurableCharacterRanges(characterRanges); System.Drawing.Region[] stringRegions = new System.Drawing.Region[1]; stringRegions = CurGraphics.MeasureCharacterRanges( CurChar.ToString (), this.Font, layoutRect, stringFormat); System.Drawing.RectangleF measureRect1 = stringRegions[0].GetBounds (CurGraphics); return new System.Drawing.Point ((int) (measureRect1.X + 0.5), (int) (measureRect1.Y + 0.5)); }
private void printHeader(System.Drawing.Printing.PrintPageEventArgs e) { e.Graphics.FillRectangle( System.Drawing.Brushes.Black, new System.Drawing.Rectangle(e.MarginBounds.Location, new System.Drawing.Size(e.MarginBounds.Right - e.MarginBounds.Left, headerHeight))); e.Graphics.DrawString("THE PRINT MINT", headerFont, System.Drawing.Brushes.White, e.MarginBounds.X + 10, e.MarginBounds.Top + headerHeight / 2 - headerFont.Height / 2); System.Drawing.StringFormat drawFormat = new System.Drawing.StringFormat(); drawFormat.FormatFlags = System.Drawing.StringFormatFlags.DirectionRightToLeft; e.Graphics.DrawString(title, headerFont, System.Drawing.Brushes.White, e.MarginBounds.Right -10, e.MarginBounds.Top + headerHeight / 2 - headerFont.Height / 2, drawFormat); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Drawing.StringFormat stringFormat1 = new System.Drawing.StringFormat(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.ownerDrawFixed = new System.Windows.Forms.CheckBox(); this.hotTrack = new System.Windows.Forms.CheckBox(); this.removeTab = new System.Windows.Forms.Button(); this.addTab = new System.Windows.Forms.Button(); this.enableRightClickMenu = new System.Windows.Forms.CheckBox(); this.highlightTextInSelected = new System.Windows.Forms.CheckBox(); this.drawButtonBoxes = new System.Windows.Forms.CheckBox(); this.showOptionsButton = new System.Windows.Forms.CheckBox(); this.showQuitButton = new System.Windows.Forms.CheckBox(); this.tabPage6 = new System.Windows.Forms.TabPage(); this.tabPage1 = new System.Windows.Forms.TabPage(); this.tabPage2 = new System.Windows.Forms.TabPage(); this.tabPage3 = new System.Windows.Forms.TabPage(); this.tabPage4 = new System.Windows.Forms.TabPage(); this.tabPage5 = new System.Windows.Forms.TabPage(); this.tabPage7 = new System.Windows.Forms.TabPage(); this.lazzyTab1 = new WinTild.LazzyTab(); this.tabPage8 = new System.Windows.Forms.TabPage(); this.tabPage9 = new System.Windows.Forms.TabPage(); this.tabPage10 = new System.Windows.Forms.TabPage(); this.tabPage11 = new System.Windows.Forms.TabPage(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); this.groupBox1.SuspendLayout(); this.lazzyTab1.SuspendLayout(); this.SuspendLayout(); // // splitContainer1 // this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; this.splitContainer1.IsSplitterFixed = true; this.splitContainer1.Location = new System.Drawing.Point(0, 0); this.splitContainer1.Name = "splitContainer1"; this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal; // // splitContainer1.Panel1 // this.splitContainer1.Panel1.Controls.Add(this.lazzyTab1); // // splitContainer1.Panel2 // this.splitContainer1.Panel2.Controls.Add(this.groupBox1); this.splitContainer1.Size = new System.Drawing.Size(456, 359); this.splitContainer1.SplitterDistance = 196; this.splitContainer1.TabIndex = 0; this.splitContainer1.Resize += new System.EventHandler(this.splitContainer1_Resize); // // groupBox1 // this.groupBox1.Controls.Add(this.ownerDrawFixed); this.groupBox1.Controls.Add(this.hotTrack); this.groupBox1.Controls.Add(this.removeTab); this.groupBox1.Controls.Add(this.addTab); this.groupBox1.Controls.Add(this.enableRightClickMenu); this.groupBox1.Controls.Add(this.highlightTextInSelected); this.groupBox1.Controls.Add(this.drawButtonBoxes); this.groupBox1.Controls.Add(this.showOptionsButton); this.groupBox1.Controls.Add(this.showQuitButton); this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; this.groupBox1.Location = new System.Drawing.Point(0, 0); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(456, 159); this.groupBox1.TabIndex = 0; this.groupBox1.TabStop = false; this.groupBox1.Text = "Commands"; // // ownerDrawFixed // this.ownerDrawFixed.AutoSize = true; this.ownerDrawFixed.Checked = true; this.ownerDrawFixed.CheckState = System.Windows.Forms.CheckState.Checked; this.ownerDrawFixed.Location = new System.Drawing.Point(203, 20); this.ownerDrawFixed.Name = "ownerDrawFixed"; this.ownerDrawFixed.Size = new System.Drawing.Size(113, 17); this.ownerDrawFixed.TabIndex = 8; this.ownerDrawFixed.Text = "Owner Draw Fixed"; this.ownerDrawFixed.UseVisualStyleBackColor = true; this.ownerDrawFixed.CheckedChanged += new System.EventHandler(this.ownerDrawFixed_CheckedChanged); // // hotTrack // this.hotTrack.AutoSize = true; this.hotTrack.Checked = true; this.hotTrack.CheckState = System.Windows.Forms.CheckState.Checked; this.hotTrack.Location = new System.Drawing.Point(7, 139); this.hotTrack.Name = "hotTrack"; this.hotTrack.Size = new System.Drawing.Size(71, 17); this.hotTrack.TabIndex = 7; this.hotTrack.Text = "HotTrack"; this.hotTrack.UseVisualStyleBackColor = true; this.hotTrack.CheckedChanged += new System.EventHandler(this.hotTrack_CheckedChanged); // // removeTab // this.removeTab.Location = new System.Drawing.Point(336, 49); this.removeTab.Name = "removeTab"; this.removeTab.Size = new System.Drawing.Size(111, 23); this.removeTab.TabIndex = 6; this.removeTab.Text = "Remove Tab"; this.removeTab.UseVisualStyleBackColor = true; this.removeTab.Click += new System.EventHandler(this.removeTab_Click); // // addTab // this.addTab.Location = new System.Drawing.Point(336, 20); this.addTab.Name = "addTab"; this.addTab.Size = new System.Drawing.Size(111, 23); this.addTab.TabIndex = 5; this.addTab.Text = "Add Tab"; this.addTab.UseVisualStyleBackColor = true; this.addTab.Click += new System.EventHandler(this.addTab_Click); // // enableRightClickMenu // this.enableRightClickMenu.AutoSize = true; this.enableRightClickMenu.Checked = true; this.enableRightClickMenu.CheckState = System.Windows.Forms.CheckState.Checked; this.enableRightClickMenu.Location = new System.Drawing.Point(7, 116); this.enableRightClickMenu.Name = "enableRightClickMenu"; this.enableRightClickMenu.Size = new System.Drawing.Size(143, 17); this.enableRightClickMenu.TabIndex = 4; this.enableRightClickMenu.Text = "Enable Right Click Menu"; this.enableRightClickMenu.UseVisualStyleBackColor = true; this.enableRightClickMenu.CheckedChanged += new System.EventHandler(this.enableContextMenu_CheckedChanged); // // highlightTextInSelected // this.highlightTextInSelected.AutoSize = true; this.highlightTextInSelected.Location = new System.Drawing.Point(7, 92); this.highlightTextInSelected.Name = "highlightTextInSelected"; this.highlightTextInSelected.Size = new System.Drawing.Size(147, 17); this.highlightTextInSelected.TabIndex = 3; this.highlightTextInSelected.Text = "Highlight Text in Selected"; this.highlightTextInSelected.UseVisualStyleBackColor = true; this.highlightTextInSelected.CheckedChanged += new System.EventHandler(this.highlightTextInSelected_CheckedChanged); // // drawButtonBoxes // this.drawButtonBoxes.AutoSize = true; this.drawButtonBoxes.Checked = true; this.drawButtonBoxes.CheckState = System.Windows.Forms.CheckState.Checked; this.drawButtonBoxes.Location = new System.Drawing.Point(7, 68); this.drawButtonBoxes.Name = "drawButtonBoxes"; this.drawButtonBoxes.Size = new System.Drawing.Size(117, 17); this.drawButtonBoxes.TabIndex = 2; this.drawButtonBoxes.Text = "Draw Button Boxes"; this.drawButtonBoxes.UseVisualStyleBackColor = true; this.drawButtonBoxes.CheckedChanged += new System.EventHandler(this.drawButtonBoxes_CheckedChanged); // // showOptionsButton // this.showOptionsButton.AutoSize = true; this.showOptionsButton.Checked = true; this.showOptionsButton.CheckState = System.Windows.Forms.CheckState.Checked; this.showOptionsButton.Location = new System.Drawing.Point(7, 44); this.showOptionsButton.Name = "showOptionsButton"; this.showOptionsButton.Size = new System.Drawing.Size(126, 17); this.showOptionsButton.TabIndex = 1; this.showOptionsButton.Text = "Show Options Button"; this.showOptionsButton.UseVisualStyleBackColor = true; this.showOptionsButton.CheckedChanged += new System.EventHandler(this.showOptionsButton_CheckedChanged); // // showQuitButton // this.showQuitButton.AutoSize = true; this.showQuitButton.Checked = true; this.showQuitButton.CheckState = System.Windows.Forms.CheckState.Checked; this.showQuitButton.Location = new System.Drawing.Point(7, 20); this.showQuitButton.Name = "showQuitButton"; this.showQuitButton.Size = new System.Drawing.Size(109, 17); this.showQuitButton.TabIndex = 0; this.showQuitButton.Text = "Show Quit Button"; this.showQuitButton.UseVisualStyleBackColor = true; this.showQuitButton.CheckedChanged += new System.EventHandler(this.showCloseButton_CheckedChanged); // // tabPage6 // this.tabPage6.Location = new System.Drawing.Point(4, 22); this.tabPage6.Name = "tabPage6"; this.tabPage6.Padding = new System.Windows.Forms.Padding(3); this.tabPage6.Size = new System.Drawing.Size(858, 170); this.tabPage6.TabIndex = 5; this.tabPage6.Text = "tabPage6"; this.tabPage6.UseVisualStyleBackColor = true; // // tabPage1 // this.tabPage1.Location = new System.Drawing.Point(4, 22); this.tabPage1.Name = "tabPage1"; this.tabPage1.Padding = new System.Windows.Forms.Padding(3); this.tabPage1.Size = new System.Drawing.Size(858, 170); this.tabPage1.TabIndex = 0; this.tabPage1.Text = "tabPage1"; this.tabPage1.UseVisualStyleBackColor = true; // // tabPage2 // this.tabPage2.Location = new System.Drawing.Point(4, 22); this.tabPage2.Name = "tabPage2"; this.tabPage2.Padding = new System.Windows.Forms.Padding(3); this.tabPage2.Size = new System.Drawing.Size(858, 170); this.tabPage2.TabIndex = 1; this.tabPage2.Text = "tabPage2"; this.tabPage2.UseVisualStyleBackColor = true; // // tabPage3 // this.tabPage3.Location = new System.Drawing.Point(4, 22); this.tabPage3.Name = "tabPage3"; this.tabPage3.Padding = new System.Windows.Forms.Padding(3); this.tabPage3.Size = new System.Drawing.Size(858, 170); this.tabPage3.TabIndex = 2; this.tabPage3.Text = "tabPage3"; this.tabPage3.UseVisualStyleBackColor = true; // // tabPage4 // this.tabPage4.Location = new System.Drawing.Point(4, 22); this.tabPage4.Name = "tabPage4"; this.tabPage4.Padding = new System.Windows.Forms.Padding(3); this.tabPage4.Size = new System.Drawing.Size(858, 170); this.tabPage4.TabIndex = 3; this.tabPage4.Text = "tabPage4"; this.tabPage4.UseVisualStyleBackColor = true; // // tabPage5 // this.tabPage5.Location = new System.Drawing.Point(4, 22); this.tabPage5.Name = "tabPage5"; this.tabPage5.Padding = new System.Windows.Forms.Padding(3); this.tabPage5.Size = new System.Drawing.Size(858, 170); this.tabPage5.TabIndex = 4; this.tabPage5.Text = "tabPage5"; this.tabPage5.UseVisualStyleBackColor = true; // // tabPage7 // this.tabPage7.Location = new System.Drawing.Point(4, 22); this.tabPage7.Name = "tabPage7"; this.tabPage7.Padding = new System.Windows.Forms.Padding(3); this.tabPage7.Size = new System.Drawing.Size(858, 170); this.tabPage7.TabIndex = 5; this.tabPage7.Text = "tabPage7"; this.tabPage7.UseVisualStyleBackColor = true; // // lazzyTab1 // this.lazzyTab1.AllowDrop = true; this.lazzyTab1.Controls.Add(this.tabPage8); this.lazzyTab1.Controls.Add(this.tabPage9); this.lazzyTab1.Controls.Add(this.tabPage10); this.lazzyTab1.Controls.Add(this.tabPage11); this.lazzyTab1.Dock = System.Windows.Forms.DockStyle.Fill; this.lazzyTab1.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed; this.lazzyTab1.DrawTabButtonBox = true; this.lazzyTab1.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.5F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lazzyTab1.HighlightTextInSelectedTab = false; this.lazzyTab1.HotTrack = true; this.lazzyTab1.ItemSize = new System.Drawing.Size(150, 18); this.lazzyTab1.Location = new System.Drawing.Point(0, 0); this.lazzyTab1.Name = "lazzyTab1"; this.lazzyTab1.OptionsButtonColour = System.Drawing.Color.LightGreen; this.lazzyTab1.QuitButtonColour = System.Drawing.Color.LightPink; this.lazzyTab1.SelectedIndex = 0; this.lazzyTab1.ShowButtons = WinTild.LazzyTab.ShowButtonEnum.All; this.lazzyTab1.ShowRightClickMenu = true; this.lazzyTab1.Size = new System.Drawing.Size(456, 196); this.lazzyTab1.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; stringFormat1.Alignment = System.Drawing.StringAlignment.Near; stringFormat1.FormatFlags = System.Drawing.StringFormatFlags.NoWrap; stringFormat1.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.None; stringFormat1.LineAlignment = System.Drawing.StringAlignment.Center; stringFormat1.Trimming = System.Drawing.StringTrimming.EllipsisCharacter; this.lazzyTab1.StringFlags = stringFormat1; this.lazzyTab1.TabIndex = 0; // // tabPage8 // this.tabPage8.Location = new System.Drawing.Point(4, 22); this.tabPage8.Name = "tabPage8"; this.tabPage8.Padding = new System.Windows.Forms.Padding(3); this.tabPage8.Size = new System.Drawing.Size(448, 170); this.tabPage8.TabIndex = 0; this.tabPage8.Text = "tabPage8"; this.tabPage8.UseVisualStyleBackColor = true; // // tabPage9 // this.tabPage9.Location = new System.Drawing.Point(4, 22); this.tabPage9.Name = "tabPage9"; this.tabPage9.Padding = new System.Windows.Forms.Padding(3); this.tabPage9.Size = new System.Drawing.Size(192, 74); this.tabPage9.TabIndex = 1; this.tabPage9.Text = "tabPage9"; this.tabPage9.UseVisualStyleBackColor = true; // // tabPage10 // this.tabPage10.Location = new System.Drawing.Point(4, 22); this.tabPage10.Name = "tabPage10"; this.tabPage10.Padding = new System.Windows.Forms.Padding(3); this.tabPage10.Size = new System.Drawing.Size(448, 170); this.tabPage10.TabIndex = 2; this.tabPage10.Text = "tabPage10"; this.tabPage10.UseVisualStyleBackColor = true; // // tabPage11 // this.tabPage11.Location = new System.Drawing.Point(4, 22); this.tabPage11.Name = "tabPage11"; this.tabPage11.Padding = new System.Windows.Forms.Padding(3); this.tabPage11.Size = new System.Drawing.Size(448, 170); this.tabPage11.TabIndex = 3; this.tabPage11.Text = "tabPage11"; this.tabPage11.UseVisualStyleBackColor = true; // // TestForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(456, 359); this.Controls.Add(this.splitContainer1); this.Name = "TestForm"; this.Text = "LazzyTab TestForm"; this.TransparencyKey = System.Drawing.Color.GreenYellow; this.splitContainer1.Panel1.ResumeLayout(false); this.splitContainer1.Panel2.ResumeLayout(false); this.splitContainer1.ResumeLayout(false); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); this.lazzyTab1.ResumeLayout(false); this.ResumeLayout(false); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { System.Drawing.StringFormat stringFormat1 = new System.Drawing.StringFormat(); this.pnl_Header = new System.Windows.Forms.Panel(); this.lblHeader = new System.Windows.Forms.Label(); this.pnlController = new System.Windows.Forms.Panel(); this.btnSettings = new System.Windows.Forms.Button(); this.btnExit = new System.Windows.Forms.Button(); this.btnTender = new System.Windows.Forms.Button(); this.btnDelete = new System.Windows.Forms.Button(); this.btnEdit = new System.Windows.Forms.Button(); this.btnNew = new System.Windows.Forms.Button(); this.lstbxTickets = new CustomControls.CustomListbox(); this.pnl_Header.SuspendLayout(); this.pnlController.SuspendLayout(); this.SuspendLayout(); // // pnl_Header // this.pnl_Header.Controls.Add(this.lblHeader); this.pnl_Header.Location = new System.Drawing.Point(12, 12); this.pnl_Header.Name = "pnl_Header"; this.pnl_Header.Size = new System.Drawing.Size(984, 77); this.pnl_Header.TabIndex = 0; // // lblHeader // this.lblHeader.BackColor = System.Drawing.SystemColors.Control; this.lblHeader.Font = new System.Drawing.Font("Times New Roman", 30F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lblHeader.Location = new System.Drawing.Point(3, 9); this.lblHeader.Name = "lblHeader"; this.lblHeader.Size = new System.Drawing.Size(978, 59); this.lblHeader.TabIndex = 0; this.lblHeader.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; // // pnlController // this.pnlController.Controls.Add(this.btnSettings); this.pnlController.Controls.Add(this.btnExit); this.pnlController.Controls.Add(this.btnTender); this.pnlController.Controls.Add(this.btnDelete); this.pnlController.Controls.Add(this.btnEdit); this.pnlController.Controls.Add(this.btnNew); this.pnlController.Font = new System.Drawing.Font("Times New Roman", 24F, ((System.Drawing.FontStyle)((System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic))), System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.pnlController.Location = new System.Drawing.Point(822, 95); this.pnlController.Name = "pnlController"; this.pnlController.Size = new System.Drawing.Size(174, 622); this.pnlController.TabIndex = 1; // // btnSettings // this.btnSettings.BackColor = System.Drawing.SystemColors.Control; this.btnSettings.Font = new System.Drawing.Font("Times New Roman", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnSettings.Location = new System.Drawing.Point(3, 445); this.btnSettings.Name = "btnSettings"; this.btnSettings.Size = new System.Drawing.Size(168, 84); this.btnSettings.TabIndex = 5; this.btnSettings.Text = "Settings"; this.btnSettings.UseVisualStyleBackColor = false; this.btnSettings.Click += new System.EventHandler(this.btnSettings_Click); // // btnExit // this.btnExit.BackColor = System.Drawing.SystemColors.Control; this.btnExit.Font = new System.Drawing.Font("Times New Roman", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnExit.Location = new System.Drawing.Point(3, 535); this.btnExit.Name = "btnExit"; this.btnExit.Size = new System.Drawing.Size(168, 84); this.btnExit.TabIndex = 4; this.btnExit.Text = "Exit"; this.btnExit.UseVisualStyleBackColor = false; // // btnTender // this.btnTender.BackColor = System.Drawing.SystemColors.Control; this.btnTender.Font = new System.Drawing.Font("Times New Roman", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnTender.Location = new System.Drawing.Point(3, 273); this.btnTender.Name = "btnTender"; this.btnTender.Size = new System.Drawing.Size(168, 84); this.btnTender.TabIndex = 3; this.btnTender.Text = "Tender"; this.btnTender.UseVisualStyleBackColor = false; // // btnDelete // this.btnDelete.BackColor = System.Drawing.SystemColors.Control; this.btnDelete.Font = new System.Drawing.Font("Times New Roman", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnDelete.Location = new System.Drawing.Point(3, 183); this.btnDelete.Name = "btnDelete"; this.btnDelete.Size = new System.Drawing.Size(168, 84); this.btnDelete.TabIndex = 2; this.btnDelete.Text = "Delete"; this.btnDelete.UseVisualStyleBackColor = false; // // btnEdit // this.btnEdit.BackColor = System.Drawing.SystemColors.Control; this.btnEdit.Font = new System.Drawing.Font("Times New Roman", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnEdit.Location = new System.Drawing.Point(3, 93); this.btnEdit.Name = "btnEdit"; this.btnEdit.Size = new System.Drawing.Size(168, 84); this.btnEdit.TabIndex = 1; this.btnEdit.Text = "Review"; this.btnEdit.UseVisualStyleBackColor = false; this.btnEdit.Click += new System.EventHandler(this.btnEdit_Click); // // btnNew // this.btnNew.BackColor = System.Drawing.SystemColors.Control; this.btnNew.Font = new System.Drawing.Font("Times New Roman", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.btnNew.Location = new System.Drawing.Point(3, 3); this.btnNew.Name = "btnNew"; this.btnNew.Size = new System.Drawing.Size(168, 84); this.btnNew.TabIndex = 0; this.btnNew.Text = "New"; this.btnNew.UseVisualStyleBackColor = false; this.btnNew.Click += new System.EventHandler(this.btnNew_Click); // // lstbxTickets // this.lstbxTickets.CheckedBoxListItem = true; this.lstbxTickets.CheckedItemImage = global::JandJPOS.Properties.Resources.CheckBoxChecked; this.lstbxTickets.DetailsFont = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Italic, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.lstbxTickets.DrawMode = System.Windows.Forms.DrawMode.OwnerDrawVariable; this.lstbxTickets.Font = new System.Drawing.Font("Arial", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); stringFormat1.Alignment = System.Drawing.StringAlignment.Near; stringFormat1.HotkeyPrefix = System.Drawing.Text.HotkeyPrefix.None; stringFormat1.LineAlignment = System.Drawing.StringAlignment.Near; stringFormat1.Trimming = System.Drawing.StringTrimming.Character; this.lstbxTickets.Format = stringFormat1; this.lstbxTickets.FormattingEnabled = true; this.lstbxTickets.ImageSize = new System.Drawing.Size(50, 50); this.lstbxTickets.ItemHeight = 57; this.lstbxTickets.ItemImage = global::JandJPOS.Properties.Resources.CheckBoxUnChecked; this.lstbxTickets.Location = new System.Drawing.Point(12, 95); this.lstbxTickets.Margin = new System.Windows.Forms.Padding(4); this.lstbxTickets.Name = "lstbxTickets"; this.lstbxTickets.Size = new System.Drawing.Size(804, 621); this.lstbxTickets.TabIndex = 0; this.lstbxTickets.TitleFont = new System.Drawing.Font("Arial", 15.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); // // frmHome // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoSize = true; this.BackColor = System.Drawing.SystemColors.Control; this.ClientSize = new System.Drawing.Size(1008, 733); this.Controls.Add(this.lstbxTickets); this.Controls.Add(this.pnlController); this.Controls.Add(this.pnl_Header); this.MaximizeBox = false; this.MinimizeBox = false; this.MinimumSize = new System.Drawing.Size(1022, 726); this.Name = "frmHome"; this.Text = "Form1"; this.Load += new System.EventHandler(this.Form1_Load); this.pnl_Header.ResumeLayout(false); this.pnlController.ResumeLayout(false); this.ResumeLayout(false); }
private void PaintTileInternal(MapLayer item, System.Drawing.Rectangle dest, int x, int y, System.Drawing.Graphics g) { short data = item.Data[x, y]; if (item.Type == MapLayerType.Tile) { g.DrawImage( this.tileset[data], dest ); } else if (item.Type == MapLayerType.HalfBlockShadow) { for (int shadow = 0; shadow < 4; shadow++) { if ((data & (1 << shadow)) != 0) { g.FillRectangle( shadowBrush, dest.X + (shadow % 2) * size.Width / 2, dest.Y + (shadow / 2) * size.Height / 2, size.Width / 2, size.Height / 2 ); } } } else if (item.Type == MapLayerType.TilesetLabel) { if (data == -1) return; if (data == -2) { g.FillRectangle(System.Drawing.Brushes.Black, dest); return; } if (data >= 0 && item.Storage.ContainsKey(data.ToString())) { g.FillRectangle(System.Drawing.Brushes.Black, dest); string s = item.Storage[data.ToString()] as string; System.Drawing.StringFormat sf = new System.Drawing.StringFormat(); sf.LineAlignment = System.Drawing.StringAlignment.Center; sf.Alignment = System.Drawing.StringAlignment.Center; g.DrawString(s, this.Font, System.Drawing.Brushes.White, dest, sf); } } }
void HistoryListView_DrawSubItem(object sender, DrawListViewSubItemEventArgs e) { if (e.ItemIndex < 0) return; //Console.WriteLine(e.ItemIndex + "-" + e.Bounds); if (this.SelectedIndices.Contains(e.ItemIndex)) { e.Graphics.FillRectangle(System.Drawing.Brushes.LightGray, e.Bounds); ControlPaint.DrawFocusRectangle(e.Graphics, e.Item.Bounds); } else { e.DrawBackground(); } // if this is the first column, we want to draw an icon as well int newX = e.Bounds.Left; if (e.ColumnIndex == 0) { // draw the icon newX = newX + 20; PastNotification pn = (PastNotification)e.Item.Tag; if (pn != null) { System.Drawing.Image img = PastNotificationManager.GetImage(pn); using (img) { if (img != null) { int x = e.Bounds.Left + 2; int y = e.Bounds.Top; e.Graphics.DrawImage(img, new System.Drawing.Rectangle(x, y, 16, 16)); } } } } // draw text string text = e.SubItem.Text.Replace("\r", " - "); System.Drawing.Rectangle rect = new System.Drawing.Rectangle(newX, e.Bounds.Top, e.Bounds.Right - newX, e.Item.Font.Height); System.Drawing.StringFormat sf = new System.Drawing.StringFormat(); sf.Trimming = System.Drawing.StringTrimming.EllipsisCharacter; sf.FormatFlags = System.Drawing.StringFormatFlags.NoClip | System.Drawing.StringFormatFlags.NoWrap; System.Drawing.Color color = (e.ColumnIndex == 0 ? e.Item.ForeColor : System.Drawing.Color.FromArgb(System.Drawing.SystemColors.GrayText.ToArgb())); System.Drawing.SolidBrush foreBrush = new System.Drawing.SolidBrush(color); using (foreBrush) { //TextFormatFlags flags = TextFormatFlags.Default | TextFormatFlags.ExternalLeading | TextFormatFlags.GlyphOverhangPadding | TextFormatFlags.NoClipping | TextFormatFlags.EndEllipsis | TextFormatFlags.LeftAndRightPadding | TextFormatFlags.SingleLine; //TextRenderer.DrawText(e.Graphics, text, e.SubItem.Font, rect, e.SubItem.ForeColor, System.Drawing.Color.Transparent, flags); e.Graphics.DrawString(text, e.SubItem.Font, foreBrush, rect, sf); } }
/// <summary> /// Closes this instance. /// </summary> /// <param name="skipFileSave">if set to <c>true</c> don't save the thumbnail page.</param> public void Close(bool skipFileSave) { if (!skipFileSave && !(_currentCol == 0 && _currentRow == 0)) { _pageBitmap.Save (_filename, _creator._imageCodec, _creator._qualityParameters); } if (_pageBitmap != null) _pageBitmap.Dispose (); _pageBitmap = null; if (_graphics != null) _graphics.Dispose (); _graphics = null; if (_font != null) _font.Dispose (); _font = null; if (_brushWhite != null) _brushWhite.Dispose (); _brushWhite = null; if (_brushBlack != null) _brushBlack.Dispose (); _brushBlack = null; if (_borderPen != null) _borderPen.Dispose (); _borderPen = null; if (_borderHilightPen != null) _borderHilightPen.Dispose (); _borderHilightPen = null; if (_thumbFormat != null) _thumbFormat.Dispose (); _thumbFormat = null; if (_headerFormat != null) _headerFormat.Dispose (); _headerFormat = null; }