|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
The string font is ugly on chartI found a good article about the disk explorer
http://www.codeproject.com/KB/vb/Disk_Size_Explorer.aspx And it ran well on Windows XP, but the text font on the chart was ugly when ran on Windows 7, look scratchy. I researched the code about the font for long time, it used DrawString method to draw the text string, but i did not how to correct it, can anyone correct it? "yxq" <ga***@163.net> wrote in message Every overload of the DrawString method specifies a Font object as the news:uRGrWgf5KHA.5016@TK2MSFTNGP02.phx.gbl... > I found a good article about the disk explorer > http://www.codeproject.com/KB/vb/Disk_Size_Explorer.aspx > > And it ran well on Windows XP, but the text font on the chart was ugly > when ran on Windows 7, look scratchy. > I researched the code about the font for long time, it used DrawString > method to draw the text string, but i did not how to correct it, can > anyone correct it? > second argument. Research the Font class here: http://msdn.microsoft.com/en-us/library/system.drawing.font.aspx and you should be able to change the font to something that looks better. I have changed the font to the specified Aril, regular, but the shown font
like bold and irregular, i think maybe the GDI+ caused the problem or there are some changes from XP to Windows 7. Show quoteHide quote > > "yxq" <ga***@163.net> wrote in message > news:uRGrWgf5KHA.5016@TK2MSFTNGP02.phx.gbl... >> I found a good article about the disk explorer >> http://www.codeproject.com/KB/vb/Disk_Size_Explorer.aspx >> >> And it ran well on Windows XP, but the text font on the chart was ugly >> when ran on Windows 7, look scratchy. >> I researched the code about the font for long time, it used DrawString >> method to draw the text string, but i did not how to correct it, can >> anyone correct it? >> > > Every overload of the DrawString method specifies a Font object as the > second argument. Research the Font class here: > > http://msdn.microsoft.com/en-us/library/system.drawing.font.aspx > > and you should be able to change the font to something that looks better. > > Am 28.04.2010 00:10, schrieb yxq:
> I have changed the font to the specified Aril, regular, but the shown font Maybe ClearType was turned off on the Windows XP machine and is turned > like bold and irregular, i think maybe the GDI+ caused the problem or there > are some changes from XP to Windows 7. on on the Windows 7 machine. If this is the case, you'd have to adjust the drawing code. When drawing the same string onto a certain surface more than once, the ClearType subpixel colors add up, which leads to a horribly looking result. You can solve this problem by redrawing the background prior to drawing the string. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/> Thank you, i think you are right.
"You can solve this problem by redrawing the background prior to drawing the string.", i do not understand your meaning, could you please tell the details? Show quoteHide quote > Am 28.04.2010 00:10, schrieb yxq: >> I have changed the font to the specified Aril, regular, but the shown >> font >> like bold and irregular, i think maybe the GDI+ caused the problem or >> there >> are some changes from XP to Windows 7. > > Maybe ClearType was turned off on the Windows XP machine and is turned on > on the Windows 7 machine. If this is the case, you'd have to adjust the > drawing code. When drawing the same string onto a certain surface more > than once, the ClearType subpixel colors add up, which leads to a horribly > looking result. You can solve this problem by redrawing the background > prior to drawing the string. > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://dotnet.mvps.org/dotnet/faqs/> Am 28.04.2010 14:50, schrieb yxq:
> Thank you, i think you are right. For example, fill the rectangle the text occupies with the background color.> "You can solve this problem by redrawing the background prior to drawing the > string.", i do not understand your meaning, could you please tell the > details? Relevant methods: 'Graphics.MeasureString' 'Graphics.FillRectangle' 'Graphics.DrawString' -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://dotnet.mvps.org/dotnet/faqs/> OK, i will try it, thank you.
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> ??????:esJk%23ov5KHA.5***@TK2MSFTNGP06.phx.gbl...Show quoteHide quote > Am 28.04.2010 14:50, schrieb yxq: >> Thank you, i think you are right. >> "You can solve this problem by redrawing the background prior to drawing >> the >> string.", i do not understand your meaning, could you please tell the >> details? > > For example, fill the rectangle the text occupies with the background > color. > > Relevant methods: > > 'Graphics.MeasureString' > 'Graphics.FillRectangle' > 'Graphics.DrawString' > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://dotnet.mvps.org/dotnet/faqs/> I have solved the problem by add the line below
'Graphics.TextRenderingHint = System.Drawing.Text.TextRenderingHint.SingleBitPerPixelGridFit Thank Herfried K. Wagner Show quoteHide quote > OK, i will try it, thank you. > > "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> > ??????:esJk%23ov5KHA.5***@TK2MSFTNGP06.phx.gbl... >> Am 28.04.2010 14:50, schrieb yxq: >>> Thank you, i think you are right. >>> "You can solve this problem by redrawing the background prior to drawing >>> the >>> string.", i do not understand your meaning, could you please tell the >>> details? >> >> For example, fill the rectangle the text occupies with the background >> color. >> >> Relevant methods: >> >> 'Graphics.MeasureString' >> 'Graphics.FillRectangle' >> 'Graphics.DrawString' >> >> -- >> M S Herfried K. Wagner >> M V P <URL:http://dotnet.mvps.org/> >> V B <URL:http://dotnet.mvps.org/dotnet/faqs/> > >
Do not work well for Windows 7?
a few basic question about resource files Is This Method Of Creating a String Possible? How to send email with no outlook and SMTP server ? System.net Utilities.FTP or ProcessStart? Sync Framework with multiple branch Resize an image: bug? form inheritence Option strict after debug "Can't write dll because a process has it open" |
|||||||||||||||||||||||