| Flash for .NET Task-Based Help > C1FlashCanvas Tasks > Drawing Text in C1FlashCanvas > Drawing Text |
To draw text on the C1FlashCanvas, use the RenderToFile method to render the content on the C1FlashCanvas to a SWF file:
To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
Imports C1.C1Flash
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim rc As New Rectangle(20, 20, 200, 40)
Dim font As New Font("Arial", 14, FontStyle.Bold)
Me.C1FlashCanvas1.DrawString("Hello World!", font, Brushes.Orange, rc)
font.Dispose()
End Sub
|
|
To write code in C#
| C# |
Copy Code
|
|---|---|
using C1.C1Flash;
private void Form1_Load(object sender, System.EventArgs e)
{
Rectangle rc = new Rectangle(20, 20, 200, 40);
Font font = new Font("Arial", 14, FontStyle.Bold);
this.c1FlashCanvas1.DrawString("Hello World!", font, Brushes.Orange, rc);
font.Dispose();
}
|
|
To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
Me.C1FlashCanvas1.RenderToFile("c:\WindowsApplication1.swf")
LaunchViewer("c:\WindowsApplication1.swf")
|
|
To write code in C#
| C# |
Copy Code
|
|---|---|
this.c1FlashCanvas1.RenderToFile(@"c:\WindowsApplication1.swf"); LaunchViewer(@"c:\WindowsApplication1.swf"); |
|
Here is what your text will look like in Internet Explorer:
