private int GetCharMaxX(Bitmap charBitmap)
{
var width = charBitmap.Width;
var height = charBitmap.Height;
for (var x = width - 1; x >= 0; --x)
{
for (var y = 0; y < height; ++y)
{
Color color;
color = charBitmap.GetPixel(x, y);
if (color.A > 0)
{
return x;
}
}
}
return width - 1;
}