Click here to Skip to main content
15,881,882 members
Home / Discussions / C#
   

C#

 
GeneralRe: problem in reading from DB Pin
Rocky Moore17-Jan-04 18:44
Rocky Moore17-Jan-04 18:44 
QuestionHow do you make a .net component run as an embedded resource? Pin
Arg...darn anynomous mode lol17-Jan-04 15:36
sussArg...darn anynomous mode lol17-Jan-04 15:36 
AnswerRe: How do you make a .net component run as an embedded resource? Pin
Colin Angus Mackay17-Jan-04 15:42
Colin Angus Mackay17-Jan-04 15:42 
QuestionHow do you make a .net component run as an embedded resource? Pin
Anonymous17-Jan-04 15:34
Anonymous17-Jan-04 15:34 
AnswerRe: How do you make a .net component run as an embedded resource? Pin
Arjan Einbu18-Jan-04 4:19
Arjan Einbu18-Jan-04 4:19 
AnswerRe: How do you make a .net component run as an embedded resource? Pin
Heath Stewart18-Jan-04 11:15
protectorHeath Stewart18-Jan-04 11:15 
QuestionShould I keep using it or should I change? Pin
caheo17-Jan-04 14:25
caheo17-Jan-04 14:25 
GeneralBUG: Graphics.DrawString Pin
leppie17-Jan-04 11:25
leppie17-Jan-04 11:25 
HI
Yesterday i had it, but couldnt replicate it, but now I have pin-pointed it.

BUG description: When rendering non-monospaced fonts, DrawString "compresses" the last +-25% of the string that need to be drawn. This can be seen clearly especially with long repetitive strings.

Here is a Control that demonstrates the BUG. Note: the alignment in the 1st 75% is "strected" and the rest is "squashed". Also that the complete width seems to be correct in SansSerif fonts, but not in Serif fonts.

[EDIT] If one clearly define the TextRendering not to use a GridFit type rendering, then it works correctly. Now where did I they leave the ClearTypeNonGridFit option? IMO it bad to change the underlying system's rendering as in the case if you have ClearType enabled. [EDIT]

[INFO] http://support.microsoft.com/default.aspx?scid=kb;EN-US;Q307208[^] [INFO][EDIT] I still dont see how thats gonna solve my problem as it appears MeasureString is the cultprit.[EDIT]

Comments welcome (especially from the MS crowd).

class Drawer : Control
{
  StringFormat sf = StringFormat.GenericTypographic;

  public Drawer()
  {
    Text = "ffffffffffffffffffffffffffffffffffffffffffffffffffffffff";
    BackColor = Color.White;
    Font = new Font(FontFamily.GenericSerif, 24);
  }

  protected override void OnPaint(PaintEventArgs e)
  {
    float h = Font.GetHeight();
    float w = e.Graphics.MeasureString("f", Font, int.MaxValue, sf).Width;
    for (int i = 1; i <= Text.Length;i++)
    {
      e.Graphics.DrawLine(Pens.DimGray, w * i, 0, w * i, h);
    }
    for (int i = 1; i <= Text.Length;i++)
    {
      w = e.Graphics.MeasureString(Text.Substring(0, i), Font, int.MaxValue, sf).Width;
      e.Graphics.DrawLine(Pens.DimGray, w , h, w, h + h);
    }
    e.Graphics.DrawString(Text, Font, Brushes.Black, 0,0, sf);
  }
}


leppie::AllocCPArticle("Zee blog");
Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.

GeneralWhat do you want to do today? Pin
leppie17-Jan-04 11:52
leppie17-Jan-04 11:52 
QuestionHow do you think about delegate in c#? Pin
Forrest Feather17-Jan-04 9:50
Forrest Feather17-Jan-04 9:50 
AnswerRe: How do you think about delegate in c#? Pin
Forrest Feather17-Jan-04 9:56
Forrest Feather17-Jan-04 9:56 
AnswerRe: How do you think about delegate in c#? Pin
Nick Parker17-Jan-04 10:35
protectorNick Parker17-Jan-04 10:35 
AnswerRe: How do you think about delegate in c#? Pin
Heath Stewart17-Jan-04 10:57
protectorHeath Stewart17-Jan-04 10:57 
GeneralRe: How do you think about delegate in c#? Pin
Colin Angus Mackay17-Jan-04 11:16
Colin Angus Mackay17-Jan-04 11:16 
GeneralRe: How do you think about delegate in c#? Pin
Heath Stewart17-Jan-04 11:19
protectorHeath Stewart17-Jan-04 11:19 
GeneralCheck if app is themed Pin
Roger Alsing17-Jan-04 8:56
Roger Alsing17-Jan-04 8:56 
GeneralRe: Check if app is themed Pin
Heath Stewart17-Jan-04 10:40
protectorHeath Stewart17-Jan-04 10:40 
GeneralA GDI+ Question Pin
muralidharck17-Jan-04 6:57
muralidharck17-Jan-04 6:57 
GeneralRe: A GDI+ Question Pin
Heath Stewart17-Jan-04 10:31
protectorHeath Stewart17-Jan-04 10:31 
GeneralRe: A GDI+ Question Pin
muralidharck17-Jan-04 14:40
muralidharck17-Jan-04 14:40 
GeneralExecutin Plugins Pin
CWIZO17-Jan-04 6:54
CWIZO17-Jan-04 6:54 
GeneralRe: Executin Plugins Pin
Heath Stewart17-Jan-04 10:21
protectorHeath Stewart17-Jan-04 10:21 
GeneralRe: Executin Plugins Pin
CWIZO17-Jan-04 22:13
CWIZO17-Jan-04 22:13 
Questionwhat kind of project Pin
gordingin17-Jan-04 6:38
gordingin17-Jan-04 6:38 
AnswerRe: what kind of project Pin
Heath Stewart17-Jan-04 10:16
protectorHeath Stewart17-Jan-04 10:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.