Can see line behind text - need to hide lines behind text

lep11

New member
Joined
Dec 3, 2010
Messages
2
Location
Texas, USA
Programming Experience
10+
I am using the code below to attempt to hide lines drawn on a .PNG image before or after the text is drawn. (.PNG image formats are not supposed to be transparent). The problem is that I can always see lines behind the text, even though I am using a solid white fill on the rectangle of the same dimensions as the text.

Dim msr as SizeF

msr = gr.MeasureString("aaaaaaaaaa", font1)
gr.FillRectangle(MyBrush, xpos, ypos - 45, msr.Width, msr.Height)
gr.DrawString("aaaaaaaaaa", font1, fontbrush, xpos, ypos)

There seems to be no way to make the line hidden by the text.

Please hlp. thx in advance.
 
By the way, the code is


Dim msr as SizeF

msr = gr.MeasureString("aaaaaaaaaa", font1)
gr.FillRectangle(MyBrush, xpos, ypos, msr.Width, msr.Height)
gr.DrawString("aaaaaaaaaa", font1, fontbrush, xpos, ypos)

without the "ypos-45" that's in the original post. So yes, the fillrectangle should be directly beneath the text, but nevertheless the line is visible when written before the fillrectangle.
 
Back
Top