I've made a code that labels a jpg
, by typing the client's site address in the image footer.
The Problem: Some photos the text is coming giant as if it were source 72px instead of source 12px
See that both photos are vertical, but the same text "www.sigasoftware.com.br" is different in size.
When running the VS debug it seems that all values are similar, not justifying this source of this size, I need some hint of how I can try to find the problem
Follow part of the code for my class manipula_foto.cs
private void EstampaTexto(int _largura, int phHeight, Graphics grPhoto)
{
Font crFont = null;
SizeF crSize = new SizeF();
crFont = new Font("verdana", 12, FontStyle.Bold);
crSize = grPhoto.MeasureString(_textoetiqueta, crFont);
//imagem a 5% da altura, debaixo para cima.
int yPixlesFromBottom = (int)(phHeight * .05);
// Agora que temos um tamanho de ponto usar a altura das cordas Copyrights
// para determinar a coordenada y para desenhar a série de fotografia
float yPosFromBottom = ((phHeight - 10) - (crSize.Height / 2));
//Determinar a coordenada x calculando o centro da largura da imagem
float xCenterOfImg = (_largura / 2);
//definindo posição central do texto
StringFormat StrFormat = new StringFormat();
StrFormat.Alignment = StringAlignment.Center;
// retangulo de fundo
Brush brush = new SolidBrush(Color.FromArgb(120, 255, 255, 255));
grPhoto.FillRectangle(brush, 0, yPosFromBottom, _largura, 20);
//Texto Frente
SolidBrush semiTransBrush = new SolidBrush(Color.FromArgb(153, 255, 255, 255));
grPhoto.DrawString(_textoetiqueta, //string of text
crFont, //font
semiTransBrush, //Brush
new PointF(xCenterOfImg, yPosFromBottom), //Position
StrFormat); //Text alignment
}