@@ -85,23 +85,18 @@ Public Class formToolResources
8585 e.DrawFocusRectangle()
8686 'e.Graphics.FillRectangle(If(e.Index = lbImages.SelectedIndex, New SolidBrush(Color.FromKnownColor(KnownColor.Highlight)), Brushes.White), e.Bounds)
8787 If IsTitleItem(item) Then
88- TextRenderer.DrawText(e.Graphics, item.Text, New Font( Me .Font.Name, Me .Font.Size + 1 , FontStyle.Bold Or FontStyle.Underline), e.Bounds, Color.Black, TextFormatFlags.WordBreak Or TextFormatFlags.HorizontalCenter Or TextFormatFlags.VerticalCenter)
88+ TextRenderer.DrawText(e.Graphics, item.Text, New Font( Me .Font.Name, Me .Font.Size + 1 , FontStyle.Bold Or FontStyle.Underline), New Rectangle( e.Bounds.X + 138 , e.Bounds.Y, e.Bounds.Width - 143 , e.Bounds.Height) , Color.Black, TextFormatFlags.WordBreak Or TextFormatFlags.HorizontalCenter Or TextFormatFlags.VerticalCenter)
8989 Else
90- Dim imagewidth As Integer = 0
9190 ' maybe draw preview image
92- Dim isSmallImage As Boolean = False
9391 If item.Image IsNot Nothing Then
9492 ' maybe shrink image
95- isSmallImage = (item.Type = Images.eImageInfoType.IlluminationSnippits)
96- Dim factor As Single = item.Image.Height / If (isSmallImage, 32 , 48 ) 'If(item.Image.Width > item.Image.Height, item.Image.Width / 48, item.Image.Height / 48)
97- Dim helper As HelperBase = New HelperBase()
98- Dim shrinkedimage As Image = item.Image.Resized( New Size(Math.Min(item.Image.Width / factor, e.Bounds.Width / 2 ), item.Image.Height / factor))
99- imagewidth = shrinkedimage.Width
93+ Dim factor As Single = Math.Max(item.Image.Width / 128 , item.Image.Height / 48 )
94+ Dim shrinkedimage As Image = item.Image.Resized( New Size(item.Image.Width / factor, item.Image.Height / factor))
10095 ' draw image
101- e.Graphics.DrawImage(shrinkedimage, New Point( 5 , e.Bounds.Y + 3 + If (isSmallImage, 8 , 0 ) ))
96+ e.Graphics.DrawImage(shrinkedimage, New Point( 5 , e.Bounds.Y + 3 ))
10297 End If
10398 ' text
104- TextRenderer.DrawText(e.Graphics, item.Text.Replace( "\" , "\ " ), Me .Font, New Rectangle(imagewidth + 10 , e.Bounds.Y, e.Bounds.Width - imagewidth - 15 , e.Bounds.Height - 2 ), Color.Black, TextFormatFlags.VerticalCenter Or TextFormatFlags.HorizontalCenter Or TextFormatFlags.WordBreak)
99+ TextRenderer.DrawText(e.Graphics, item.Text.Replace( "\" , "\ " ), Me .Font, New Rectangle(e.Bounds.X + 138 , e.Bounds.Y, e.Bounds.Width - 143 , e.Bounds.Height), Color.Black, TextFormatFlags.VerticalCenter Or TextFormatFlags.HorizontalCenter Or TextFormatFlags.WordBreak)
105100 End If
106101 End If
107102
0 commit comments