Click here to Skip to main content
15,888,984 members
Home / Discussions / C#
   

C#

 
AnswerRe: Redraw Coordinates on Cropped Image Pin
BillWoodruff30-Oct-14 21:02
professionalBillWoodruff30-Oct-14 21:02 
AnswerRe: Redraw Coordinates on Cropped Image Pin
Django_Untaken30-Oct-14 21:11
Django_Untaken30-Oct-14 21:11 
GeneralRe: Redraw Coordinates on Cropped Image Pin
BillWoodruff30-Oct-14 23:09
professionalBillWoodruff30-Oct-14 23:09 
GeneralRe: Redraw Coordinates on Cropped Image Pin
Django_Untaken30-Oct-14 23:47
Django_Untaken30-Oct-14 23:47 
GeneralRe: Redraw Coordinates on Cropped Image Pin
BillWoodruff31-Oct-14 7:13
professionalBillWoodruff31-Oct-14 7:13 
QuestionAnyone familiar with Microsoft.Owin.Cors.CorsMiddleware? Pin
Alaric_30-Oct-14 10:09
professionalAlaric_30-Oct-14 10:09 
AnswerRe: Anyone familiar with Microsoft.Owin.Cors.CorsMiddleware? Pin
Alaric_30-Oct-14 15:38
professionalAlaric_30-Oct-14 15:38 
QuestionText Cursor Pin
OAportelles30-Oct-14 5:05
OAportelles30-Oct-14 5:05 
Hello, here I leave a code to copy a website to generate a text cursor type, but it always returns the text as if it were in Bold, as it could put the text Regular style
#region New_Cursor definition

public struct IconInfo
{
public bool fIcon;
public int xHotspot;
public int yHotspot;
public IntPtr hbmMask;
public IntPtr hbmColor;
}


public void New_Cursor(string text)
{
Font drawFont = new Font("Verdana", 9);
SolidBrush drawBrush = new SolidBrush(Color.Black);

Bitmap bitmap = new Bitmap(100, 25);
Graphics g = Graphics.FromImage(bitmap);
g.DrawString(text, drawFont, drawBrush, 0,0);

this.Cursor = CreateCursor(bitmap, 3, 3);
bitmap.Dispose();
}

[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
public static extern bool GetIconInfo(IntPtr hIcon, ref IconInfo pIconInfo);

[DllImport("user32.dll")]
public static extern IntPtr CreateIconIndirect(ref IconInfo icon);

public static Cursor CreateCursor(Bitmap bmp, int xHotSpot, int yHotSpot)
{
IntPtr ptr = bmp.GetHicon();
IconInfo tmp = new IconInfo();
GetIconInfo(ptr, ref tmp);
tmp.xHotspot = xHotSpot;
tmp.yHotspot = yHotSpot;
tmp.fIcon = false;
ptr = CreateIconIndirect(ref tmp);
return new Cursor(ptr);
}

#endregion New_Cursor definition

modified 30-Oct-14 11:26am.

GeneralRe: Text Cursor Pin
PIEBALDconsult30-Oct-14 5:12
mvePIEBALDconsult30-Oct-14 5:12 
GeneralRe: Text Cursor Pin
OAportelles30-Oct-14 5:16
OAportelles30-Oct-14 5:16 
GeneralRe: Text Cursor Pin
PIEBALDconsult30-Oct-14 5:17
mvePIEBALDconsult30-Oct-14 5:17 
AnswerRe: Text Cursor Pin
Dave Kreskowiak30-Oct-14 5:54
mveDave Kreskowiak30-Oct-14 5:54 
AnswerRe: Text Cursor Pin
Richard MacCutchan30-Oct-14 23:00
mveRichard MacCutchan30-Oct-14 23:00 
QuestionBinding CSV data to a chart - Problem Pin
Member 1119305330-Oct-14 3:56
Member 1119305330-Oct-14 3:56 
QuestionHow to change IP address of web service. Pin
Sachin Malviya30-Oct-14 1:57
Sachin Malviya30-Oct-14 1:57 
AnswerRe: How to change IP address of web service. Pin
OriginalGriff30-Oct-14 2:20
mveOriginalGriff30-Oct-14 2:20 
AnswerRe: How to change IP address of web service. Pin
ZurdoDev30-Oct-14 3:00
professionalZurdoDev30-Oct-14 3:00 
AnswerRe: How to change IP address of web service. Pin
RichardGrimmer30-Oct-14 5:23
RichardGrimmer30-Oct-14 5:23 
GeneralRe: How to change IP address of web service. Pin
Sachin Malviya31-Oct-14 5:08
Sachin Malviya31-Oct-14 5:08 
QuestionHow To Reduce CPU Usage ? Pin
AmbiguousName30-Oct-14 1:43
AmbiguousName30-Oct-14 1:43 
AnswerRe: How To Reduce CPU Usage ? Pin
BillWoodruff30-Oct-14 4:32
professionalBillWoodruff30-Oct-14 4:32 
QuestionMagTek MSR , Magnetic Swipe Reader Pin
Hari-CodeBlogger30-Oct-14 0:48
Hari-CodeBlogger30-Oct-14 0:48 
AnswerRe: MagTek MSR , Magnetic Swipe Reader Pin
BillWoodruff30-Oct-14 1:13
professionalBillWoodruff30-Oct-14 1:13 
AnswerRe: MagTek MSR , Magnetic Swipe Reader Pin
Garth J Lancaster31-Oct-14 13:18
professionalGarth J Lancaster31-Oct-14 13:18 
GeneralRe: MagTek MSR , Magnetic Swipe Reader Pin
Hari-CodeBlogger2-Nov-14 22:10
Hari-CodeBlogger2-Nov-14 22:10 

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.