A
Abhishek R Prajapati
Guest
I want to increase/decrease space between characters while drawing using System.Drawing in C#. I am using one winapi SetTextCharacterExtra to do so but it is not working at all. Below is my code block:
[DllImport("gdi32.dll", CharSet=CharSet.Auto)]
public static extern int SetTextCharacterExtra(
IntPtr hdc, // DC handle
int nCharExtra // extra-space value
);
public void Draw(Graphics g)
{
IntPtr hdc = g.GetHdc();
SetTextCharacterExtra(hdc, 24);
g.ReleaseHdc(hdc);
e.Graphics.DrawString("str",this.Font,Brushes.Black,0,0);
}
I have tried printing each character manually but it is not working as perfect as it should be. Any idea on this please?
A.R.Prajapati
Continue reading...
[DllImport("gdi32.dll", CharSet=CharSet.Auto)]
public static extern int SetTextCharacterExtra(
IntPtr hdc, // DC handle
int nCharExtra // extra-space value
);
public void Draw(Graphics g)
{
IntPtr hdc = g.GetHdc();
SetTextCharacterExtra(hdc, 24);
g.ReleaseHdc(hdc);
e.Graphics.DrawString("str",this.Font,Brushes.Black,0,0);
}
I have tried printing each character manually but it is not working as perfect as it should be. Any idea on this please?
A.R.Prajapati
Continue reading...