-
Recent Posts
-
Recent Comments
- Find duplicate files in C#, Part 3 of 4 - C# HelperC# Helper on Find duplicate files in C#, Part 2 of 4
- Carlos on Determine where two lines intersect in C#
- Find duplicate files in C#, Part 2 of 4 - C# HelperC# Helper on Find duplicate files in C#, Part 1 of 4
- M S Ghosh on Load images without locking their files in C#
- Find duplicate files in C#, Part 1 of 4 - C# HelperC# Helper on Calculate hash codes for a file in C#
Archives
- April 2018
- March 2018
- February 2018
- January 2018
- December 2017
- November 2017
- October 2017
- September 2017
- August 2017
- July 2017
- June 2017
- May 2017
- April 2017
- March 2017
- February 2017
- January 2017
- December 2016
- November 2016
- October 2016
- September 2016
- August 2016
- July 2016
- June 2016
- May 2016
- April 2016
- March 2016
- February 2016
- January 2016
- December 2015
- November 2015
- October 2015
- September 2015
- August 2015
- July 2015
- June 2015
- May 2015
- April 2015
- March 2015
- February 2015
- January 2015
- December 2014
- November 2014
- October 2014
- September 2014
- August 2014
- July 2014
- June 2014
- May 2014
- March 2014
- February 2014
- January 2014
- December 2013
- November 2013
- October 2013
- August 2013
- June 2013
- December 2012
- September 2012
- August 2012
- July 2012
- June 2012
- May 2012
- April 2012
- January 2012
- December 2011
- November 2011
- May 2011
- April 2011
- February 2011
- December 2010
Categories
- .NET
- 3D
- 3D graphics
- ADO.NET
- algorithms
- animation
- API
- arrays
- attributes
- audio
- books
- C#
- C# programming
- calculations
- challenges
- classes
- clipboard
- coding
- combinatorics
- console
- controls
- cryptography
- curve fitting
- database
- debugging
- dialogs
- directories
- Drag and Drop
- drawing
- drawings
- enums
- Event
- events
- example program
- Excel
- extension methods
- extensions
- files
- finance
- fonts
- formatting
- forms
- fractals
- ftp
- games
- GDI+
- generic
- geometry
- globalization
- graphics
- html
- IDE
- image processing
- inheritance
- interfaces
- internationalization
- internet
- interoperability
- LINQ
- lists
- localization
- mathematics
- memory
- menus
- MessageBox
- methods
- miscellany
- multimedia
- network
- Office
- OOP
- operators
- parsing
- performance
- phone
- PowerPoint
- printers
- printing
- productivity
- programs
- puzzles
- recursion
- reflection
- registry
- regular expressions
- serialization
- settings
- SQL
- stories
- strings
- syntax
- system
- threading
- tips
- tools
- transformations
- Uncategorized
- user interface
- variables
- VBA
- web
- Windows Forms programming
- WMI
- Word
- wpf
- XAML
- XML
Meta
Tag Archives: draw strings
Use a custom dash pattern with WPF and XAML in C#
My post Render dashed lines in a WPF program using C# explains how a WPF program can use C# code to render lines with a custom dash pattern onto a bitmap. This post shows how to use a custom dash … Continue reading
Posted in drawing, geometry, graphics, wpf, XAML
Tagged C#, C# programming, custom dash pattern, dash, DashDot, dashed lines, dotted lines, draw strings, draw text, drawing, example, example program, geometry, graphics, OnRender, render, rendering, strings, text, Windows Forms programming, WPF, XAML
Leave a comment
Easily draw rotated text on a form in C#
The example Draw rotated text in C# shows how to draw rotated text. Unfortunately that method requires you to use code at run time to position the text. It’s not too hard but it’s inconvenient if you’re trying to draw … Continue reading
Posted in fonts, forms, graphics
Tagged C#, C# programming, draw rotated strings, draw rotated text, draw strings, draw text, example, example program, fonts, forms, graphics, rotated text, Windows Forms programming
1 Comment
Get font metrics in a WPF program using C#
This example explains how to get font metrics in a WPF application. It’s actually not too hard, it’s just hard to figure out how to do it. The font metrics are tucked away inside the FormattedText object and the Typeface … Continue reading
Posted in drawing, geometry, graphics, wpf, XAML
Tagged C#, C# programming, draw strings, draw text, drawing, DrawText, example, example program, extension methods, font metrics, geometry, graphics, measure font, measure text, OnRender, render, rendering, strings, text, Windows Forms programming, WPF, XAML
Leave a comment
Easily render rotated text in a WPF program using C#
The example Render text easily in a WPF program using C# shows how to make an extension method that makes rendering text easy in WPF. This example makes a similar extension method that helps you render rotated text. This is … Continue reading
Posted in drawing, extension methods, geometry, graphics, wpf, XAML
Tagged C#, C# programming, draw strings, draw text, drawing, example, example program, extension methods, geometry, graphics, OnRender, render, render rotated text, rendering, rotated text, strings, text, Windows Forms programming, WPF, XAML
1 Comment
Render text filled with an image in a WPF program using C#
The example Render outlined text in a WPF program using C# shows how to draw text that is filled with one color and outlined with another. This example uses the following overridden OnRender to render text filled with an image. … Continue reading
Posted in drawing, geometry, graphics, wpf, XAML
Tagged C#, C# programming, draw strings, draw text, drawing, example, example program, filled text, geometry, graphics, OnRender, outline, outlined text, render, rendering, strings, text, Windows Forms programming, WPF, XAML
Leave a comment
Render outlined text in a WPF program using C#
The example Render text in a WPF program using C# shows how to draw basic text. This example uses the following overridden OnRender to draw outlined text. protected override void OnRender(DrawingContext drawingContext) { // Clear the background. Rect bg_rect = … Continue reading
Posted in drawing, geometry, graphics, wpf, XAML
Tagged C#, C# programming, draw strings, draw text, drawing, example, example program, geometry, graphics, OnRender, outline, outlined text, render, rendering, strings, text, Windows Forms programming, WPF, XAML
4 Comments
Render text easily in a WPF program using C#
The example Render text in a WPF program using C# explains how to draw text in WPF code. This example uses the following extension method to make drawing text easier. // Draw text at the indicated location. public static void … Continue reading
Posted in drawing, extension methods, geometry, graphics, wpf, XAML
Tagged C#, C# programming, draw strings, draw text, drawing, example, example program, extension methods, geometry, graphics, OnRender, render, rendering, strings, text, Windows Forms programming, WPF, XAML
2 Comments
Render text in a WPF program using C#
Normally to display text in WPF you use some sort of object such as a Label or TextBlock, but you can draw text yourself if necessary. To make this easier, at design time I set the window’s Background property to … Continue reading
Posted in drawing, geometry, graphics, wpf, XAML
Tagged C#, C# programming, draw strings, draw text, drawing, example, example program, geometry, graphics, HitTestResult, OnRender, render, rendering, strings, text, VisualTreeHelper, Windows Forms programming, WPF, XAML
3 Comments
Render polygons and polylines in a WPF program using C#
WPF lets you do all sorts of interesting things that are much harder in Windows Forms applications. However sometimes, as in this example, it makes simple things much harder. (WPF’s slogan should be, “Twice as flexible and only five times … Continue reading
Posted in drawing, extension methods, geometry, graphics, wpf, XAML
Tagged C#, C# programming, draw polygon, draw polyline, draw strings, draw text, drawing, DrawPolygon, DrawPolyline, example, example program, extension methods, geometry, graphics, OnRender, polygon, Polyline, render, rendering, strings, text, Windows Forms programming, WPF, XAML
2 Comments
Render dashed lines in a WPF program using C#
When you draw in WPF, you create a Pen object. You can set that object’s DashStyle to make the pen draw dashed or dotted lines. The following code shows how this example draws the second line from the top. Pen … Continue reading
Posted in drawing, geometry, graphics, wpf, XAML
Tagged C#, C# programming, dash, DashDot, dashed lines, dotted lines, draw strings, draw text, drawing, example, example program, geometry, graphics, OnRender, render, rendering, strings, text, Windows Forms programming, WPF, XAML
1 Comment