Click here to Skip to main content
15,922,533 members
Home / Discussions / C#
   

C#

 
GeneralRe: implementing interface not in same dir as class Pin
Kant7-Jun-03 5:17
Kant7-Jun-03 5:17 
GeneralObject events through the ide Pin
RB@Emphasys5-Jun-03 8:53
RB@Emphasys5-Jun-03 8:53 
GeneralRe: Object events through the ide Pin
Paresh Gheewala5-Jun-03 9:35
Paresh Gheewala5-Jun-03 9:35 
GeneralRe: Object events through the ide Pin
RB@Emphasys5-Jun-03 9:48
RB@Emphasys5-Jun-03 9:48 
GeneralMaster-Detail datagrid Pin
Madhuri Mittal5-Jun-03 6:38
Madhuri Mittal5-Jun-03 6:38 
GeneralRe: Master-Detail datagrid Pin
Paresh Gheewala5-Jun-03 9:19
Paresh Gheewala5-Jun-03 9:19 
GeneralHosting an IE window in a form Pin
eggie55-Jun-03 4:54
eggie55-Jun-03 4:54 
GeneralRe: Hosting an IE window in a form Pin
dynamic5-Jun-03 5:15
dynamic5-Jun-03 5:15 
GeneralRe: Hosting an IE window in a form Pin
eggie55-Jun-03 10:40
eggie55-Jun-03 10:40 
GeneralIncluding Files in Projects and FilePaths Pin
STW5-Jun-03 3:02
STW5-Jun-03 3:02 
GeneralRe: Including Files in Projects and FilePaths Pin
Kant5-Jun-03 8:22
Kant5-Jun-03 8:22 
GeneralToolbars, Toolbars, Toolbars Pin
MrEyes5-Jun-03 1:51
MrEyes5-Jun-03 1:51 
GeneralRe: Toolbars, Toolbars, Toolbars Pin
J. Dunlap5-Jun-03 7:52
J. Dunlap5-Jun-03 7:52 
GeneralRe: Toolbars, Toolbars, Toolbars Pin
xxrl5-Jun-03 15:55
xxrl5-Jun-03 15:55 
GeneralRe: Toolbars, Toolbars, Toolbars Pin
J. Dunlap5-Jun-03 16:00
J. Dunlap5-Jun-03 16:00 
GeneralRe: Toolbars, Toolbars, Toolbars Pin
MrEyes5-Jun-03 23:38
MrEyes5-Jun-03 23:38 
GeneralRe: Toolbars, Toolbars, Toolbars Pin
MrEyes6-Jun-03 0:06
MrEyes6-Jun-03 0:06 
GeneralRe: Toolbars, Toolbars, Toolbars Pin
James T. Johnson6-Jun-03 1:17
James T. Johnson6-Jun-03 1:17 
GeneralRe: Toolbars, Toolbars, Toolbars Pin
MrEyes6-Jun-03 1:22
MrEyes6-Jun-03 1:22 
GeneralRe: Toolbars, Toolbars, Toolbars Pin
romeok1-Sep-03 15:15
romeok1-Sep-03 15:15 
GeneralMeasureString returns incorrect sizeF! Pin
FruitBatInShades5-Jun-03 0:46
FruitBatInShades5-Jun-03 0:46 
GeneralRe: MeasureString returns incorrect sizeF! Pin
KingTermite5-Jun-03 1:48
KingTermite5-Jun-03 1:48 
GeneralRe: MeasureString returns incorrect sizeF! Pin
FruitBatInShades5-Jun-03 8:11
FruitBatInShades5-Jun-03 8:11 
GeneralRe: MeasureString returns incorrect sizeF! Pin
FruitBatInShades5-Jun-03 11:05
FruitBatInShades5-Jun-03 11:05 
GeneralRe: MeasureString returns incorrect sizeF! Pin
FruitBatInShades6-Jun-03 3:42
FruitBatInShades6-Jun-03 3:42 
Private Function VerticalGenerate() As Bitmap
    Dim TopRect As Rectangle = _Style.Section1
    Dim BottomRect As Rectangle = _Style.Section2
    Dim TextArea As SizeF
    Dim g As Graphics = Graphics.FromImage(Style.SourceImage)
    'If Not _Text = "" Then
    'calculate text area
    Dim tb As New TextBuilder()
    TextArea = tb.GetTextArea(g, _Style.txtStyle, _Text, New StringFormat(StringFormatFlags.DirectionVertical))
    TextArea.Height = TextArea.Height * 1.4
    'End If
    'create target bmp
    Dim bmp As New Bitmap(TopRect.Width, Convert.ToInt32((_Style.Offset.Top + Style.Offset.Bottom) + (TextArea.Height)))
    g = Graphics.FromImage(bmp)
    g.DrawImage(Style.SourceImage, TopRect, TopRect, GraphicsUnit.Pixel)
    'calculate bottom position
    Dim temprect As Rectangle = BottomRect
    temprect.Offset(New Point(0, (bmp.Height - BottomRect.Height) - BottomRect.Top))
    'draw bottom
    g.DrawImage(Style.SourceImage, temprect, BottomRect, GraphicsUnit.Pixel)
    'do fill
    Dim temprect2 As Rectangle = New Rectangle(0, TopRect.Height, TopRect.Width, _Style.ImageSize.Height - (TopRect.Height + BottomRect.Height))
    FillArea(g, Style.SourceImage, temprect2, New Size(TopRect.Width, TextArea.Height), New Point(0, TopRect.Height), WrapMode.Tile)
    'bmp.Height - (TopRect.Height + BottomRect.Height)
    If Not _Text = "" Then
        Dim Sf As New StringFormat()
        Sf.FormatFlags = StringFormatFlags.DirectionVertical Or StringFormatFlags.NoWrap
        tb.RenderText(g, _Style.txtStyle, _Text, New RectangleF(0, TopRect.Height, TextArea.Width + 1, TextArea.Height), Sf)
        ' New RectangleF(0, TopRect.Height, TopRect.Width, bmp.Height - (TopRect.Height + BottomRect.Height))
        Sf.Dispose()
    End If
    Return bmp.Clone
    g.Dispose()
    bmp.Dispose()
End Function


Public Function GetTextArea(ByRef g As Graphics, ByRef Style As TextStyle, ByVal Text As String, ByVal strFormat As StringFormat) As SizeF
			Return g.MeasureString(Text, Style.FontFace, New SizeF(1000, 1000), strFormat)
		End Function

Public Sub RenderText(ByRef g As Graphics, ByRef Style As TextStyle, ByVal Text As String, ByVal TargetRect As RectangleF, ByRef Format As StringFormat)
			If Not Style.Texture Is Nothing Then
				g.DrawString(Text, Style.FontFace, Style.Texture, TargetRect, Format)
			ElseIf Not Style.Gradient Is Nothing Then
				g.DrawString(Text, Style.FontFace, Style.Gradient, TargetRect, Format)
			Else
				g.DrawString(Text, Style.FontFace, New SolidBrush(Style.ForeColour), TargetRect, Format)
			End If
		End Sub

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.