private void DrawShaiyaDetails( Graphics g, Rectangle drawSize ) { Point stringStart; SizeF mesure; // never Initialized if( ShaiyaName == null || ShaiyaLevel == null ) return; // Icon if( ShaiyaClass != null ) { stringStart = new Point( drawSize.X + ShaiyaClassPadRight, drawSize.Y + ( drawSize.Height / 2 ) - ( ShaiyaClassHeight / 2 ) + ShaiyaClassPadTop ); g.DrawImage( ShaiyaClass, new Rectangle( stringStart.X, stringStart.Y, ShaiyaClassWidth, ShaiyaClassHeight ) ); } // Name if( ShaiyaName.Trim().Length > 0 ) { ShaiyaName = ShaiyaName.Trim(); mesure = g.MeasureString( ShaiyaName, ShaiyaFont ); stringStart = new Point( drawSize.X + 20 + ShaiyaNamePadRight, drawSize.Y + ( drawSize.Height / 2 ) - (int)( mesure.Height / 2f ) + ShaiyaNamePadTop ); if( ShaiyaClass != null ) stringStart.X += ShaiyaClassWidth; if( ShaiyaTextBorder == true ) g.DrawStringBordered( ShaiyaName, ShaiyaFont, new SolidBrush( ShaiyaTextColor ), new SolidBrush( Color.FromArgb( 255 - ShaiyaTextBorderAlpha, ShaiyaTextBorderColor ) ), stringStart.X, stringStart.Y ); else g.DrawString( ShaiyaName, ShaiyaFont, new SolidBrush( ShaiyaTextColor ), stringStart.X, stringStart.Y ); // Level if( ShaiyaLevel.Trim().Length > 0 ) { ShaiyaLevel = ShaiyaLevel.Trim(); int levelPad = (int)mesure.Width + 10 + ShaiyaLevelPadRight; mesure = g.MeasureString( ShaiyaName, ShaiyaFont ); stringStart = new Point( stringStart.X + levelPad, drawSize.Y + ( drawSize.Height / 2 ) - (int)( mesure.Height / 2f ) + ShaiyaLevelPadTop ); if( ShaiyaTextBorder == true ) g.DrawStringBordered( ShaiyaLevel, ShaiyaFont, new SolidBrush( ShaiyaTextColor ), new SolidBrush( Color.FromArgb( 255 - ShaiyaTextBorderAlpha, ShaiyaTextBorderColor ) ), stringStart.X, stringStart.Y ); else g.DrawString( ShaiyaLevel, ShaiyaFont, new SolidBrush( ShaiyaTextColor ), stringStart.X, stringStart.Y ); } } }
private void DrawCustomString( Graphics g, Rectangle drawSize ) { // never Initialized if( CustomText == null || CustomFont == null ) return; Point stringStart = new Point( drawSize.X + drawSize.Width + CustomPadRight, drawSize.Y + ( drawSize.Height / 2 ) + CustomPadTop ); SizeF mesure = g.MeasureString( CustomText, CustomFont ); stringStart.X -= (int)mesure.Width; stringStart.Y -= (int)mesure.Height / 2; if( CustomTextBorder == true ) g.DrawStringBordered( CustomText, CustomFont, new SolidBrush( CustomTextColor ), new SolidBrush( Color.FromArgb( 255 - CustomTextBorderAlpha, CustomTextBorderColor ) ), stringStart.X, stringStart.Y ); else g.DrawString( CustomText, CustomFont, new SolidBrush( CustomTextColor ), stringStart.X, stringStart.Y ); }
private void DrawCustomString( Graphics g, Rectangle drawSize ) { if( CustomTexts.Count == 0 ) return; for( int i = 0; i < CustomTexts.Count; i++ ) { CustomSettingSet set = CustomTexts[ i ]; Point stringStart = new Point( drawSize.X + drawSize.Width + set.PadRight, drawSize.Y + ( drawSize.Height / 2 ) + set.PadTop ); SizeF mesure = g.MeasureString( set.Text, set.Font ); stringStart.X -= (int)mesure.Width; stringStart.Y -= (int)mesure.Height / 2; if( set.TextBorder == true ) g.DrawStringBordered( set.Text, set.Font, new SolidBrush( CustomTextColor ), new SolidBrush( Color.FromArgb( 255 - set.BorderAlpha, CustomTextBorderColor ) ), stringStart.X, stringStart.Y ); else g.DrawString( set.Text, set.Font, new SolidBrush( CustomTextColor ), stringStart.X, stringStart.Y ); } }