S
Sharon
Hello helping experts,
I'm using VC2005 with .NET Framework 2.0, C#.
I using the Win32 GDI function:
HPEN CreatePen(int fnPenStyle,int nWidth,COLORREF crColor)
as PInvoke as follow:
[System.Runtime.InteropServices.DllImportAttribute("gdi32.dll")]
private static extern IntPtr CreatePen(PenStyles enPenStyle, int nWidth, int
crColor);
But when I'm using/invoking the CreatePen by my C# code as follow:
Color color = Color.Yellow;
int crColor = color.ToArgb() & 0xFFFFFF; // or just color.ToArgb()
IntPtr gdiPen = CreatePen(/*PS_SOLID*/0, 1, GetRGBFromColor(PenColor));
The color I'm getting is not the color being drawn. In most of the colors
I'm setting, the color being drawn is deferent.
What am I doing wrong?
I'm using VC2005 with .NET Framework 2.0, C#.
I using the Win32 GDI function:
HPEN CreatePen(int fnPenStyle,int nWidth,COLORREF crColor)
as PInvoke as follow:
[System.Runtime.InteropServices.DllImportAttribute("gdi32.dll")]
private static extern IntPtr CreatePen(PenStyles enPenStyle, int nWidth, int
crColor);
But when I'm using/invoking the CreatePen by my C# code as follow:
Color color = Color.Yellow;
int crColor = color.ToArgb() & 0xFFFFFF; // or just color.ToArgb()
IntPtr gdiPen = CreatePen(/*PS_SOLID*/0, 1, GetRGBFromColor(PenColor));
The color I'm getting is not the color being drawn. In most of the colors
I'm setting, the color being drawn is deferent.
What am I doing wrong?