Click here to Skip to main content
15,920,896 members
Home / Discussions / C#
   

C#

 
GeneralRe: creating a dll with win32 functions, and calling it from C# Pin
leppie18-Jan-04 6:15
leppie18-Jan-04 6:15 
GeneralRe: creating a dll with win32 functions, and calling it from C# Pin
Heath Stewart18-Jan-04 11:24
protectorHeath Stewart18-Jan-04 11:24 
GeneralRe: creating a dll with win32 functions, and calling it from C# Pin
misterbear20-Jan-04 6:51
misterbear20-Jan-04 6:51 
GeneralRe: creating a dll with win32 functions, and calling it from C# Pin
Heath Stewart20-Jan-04 8:24
protectorHeath Stewart20-Jan-04 8:24 
GeneralWeb Service Question Pin
Mazdak17-Jan-04 20:25
Mazdak17-Jan-04 20:25 
GeneralRe: Web Service Question Pin
Heath Stewart18-Jan-04 11:19
protectorHeath Stewart18-Jan-04 11:19 
GeneralTesting Distributed Applications Pin
Mohamad Al Husseiny17-Jan-04 19:26
Mohamad Al Husseiny17-Jan-04 19:26 
GeneralRe: Testing Distributed Applications Pin
Heath Stewart18-Jan-04 11:17
protectorHeath Stewart18-Jan-04 11:17 
GeneralRe: Testing Distributed Applications Pin
Mohamad Al Husseiny18-Jan-04 15:08
Mohamad Al Husseiny18-Jan-04 15:08 
GeneralRe: Testing Distributed Applications Pin
Heath Stewart19-Jan-04 3:02
protectorHeath Stewart19-Jan-04 3:02 
GeneralRe: Testing Distributed Applications Pin
Mohamad Al Husseiny19-Jan-04 20:09
Mohamad Al Husseiny19-Jan-04 20:09 
Generalproblem in reading from DB Pin
hadi20sa17-Jan-04 17:50
hadi20sa17-Jan-04 17:50 
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 

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.