Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Create Text inside a triangle?

5 views
Skip to first unread message

Holysmoke

unread,
Dec 17, 2008, 12:00:08 PM12/17/08
to
Hi there,

I am tring to display some text inside a text but not found a single
resource after days of googling :(

I can able to show the text in bottom line but cannot able use the area of
triangle. How can I achieve that?

TIA,
Holy

Here is what i do in my routine

Private Function GetIC(ByVal Text As String, ByVal Map As Bitmap,
ByVal context As System.Web.HttpContext) As String
Using oGraphic As Graphics = Graphics.FromImage(Map)
oGraphic.Clear(Color.FromArgb(255, 255, 255))
oGraphic.InterpolationMode =
Drawing2D.InterpolationMode.HighQualityBilinear
oGraphic.SmoothingMode = Drawing2D.SmoothingMode.AntiAlias
oGraphic.TextRenderingHint =
System.Drawing.Text.TextRenderingHint.AntiAlias

Using Brush As New SolidBrush(Color.FromArgb(79, 129, 189))
Dim point(2) As Point
point(0) = New Point(Map.Width / 2, 0)
point(1) = New Point(0, Map.Height)
point(2) = New Point(Map.Width, Map.Height)
oGraphic.FillPolygon(Brush, point)

Dim Rectf As RectangleF = oGraphic.VisibleClipBounds()
Dim Font As New Font("Arial", 9)
Using FontBrush As New SolidBrush(Color.White)
Dim Format As New StringFormat()
Format.Alignment = StringAlignment.Far
Format.LineAlignment = StringAlignment.Center
oGraphic.DrawString(Text.Trim, Font, FontBrush,
Rectf.X, Rectf.Bottom - Font.Height)
Map.Save(context.Response.OutputStream,
Imaging.ImageFormat.Gif)
End Using
End Using
End Using
End Function


0 new messages