GraphicsPath.AddString Problem!

  • Thread starter Thread starter jay
  • Start date Start date
J

jay

Hi!

I'm using this code to add text to the GraphicsPath m_Gpath:

m_Gpath.AddString(m_objectLabel, otherFont.FontFamily,
(int)otherFont.Style, (int)otherFont.Size, new Point(m_MouseX,
m_MouseY), StringFormat.GenericDefault);


I'm using this code to paint Bitmap m_Bitmap on a picture control:

private void picSketch_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
Graphics g = e.Graphics;
g.DrawImage(m_Bitmap, new Rectangle(0, 0,
(int)(m_Bitmap.Width*Zoom), (int)(m_Bitmap.Height * Zoom)));

e.Graphics.FillPath(new SolidBrush(skyobjFontColor) ,
m_Gpath);

}


I'm using this to save bitmap:

m_Bitmap.Save(saveFileDialog.FileName, ext);


Now, I get the text (crisp, not smooth) in picture box, but saving the
m_Bitmap does not save text with it!

adding this does not help either:

e.Graphics.DrawPath(new Pen(Color.Red), m_Gpath);

Changing the order in picSketch_Paint doesn't help neither:

private void picSketch_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
e.Graphics.FillPath(new SolidBrush(skyobjFontColor) ,
m_Gpath);
e.Graphics.DrawPath(new Pen(Color.Red), m_Gpath);

Graphics g = e.Graphics;

g.DrawImage(m_Bitmap, new Rectangle(0, 0,
(int)(m_Bitmap.Width*Zoom), (int)(m_Bitmap.Height * Zoom)));
}

Can someone with an experience with this sort of thing help me please?
I suppose there should be a way to "glue" graphics path to bitmap but
I don't know how.

thanks all,
jay
 
Back
Top