我想在C#里画点,可是.net类库不提供这样的方法,搜索csdn用贴位图的方法试了也不行,当画1像素的位图时,位图和位图之间总是有一定距离。
于是我就想在c#中调用windows api的SetPixel函数。这样:
[System.Security.SuppressUnmanagedCodeSecurity] // We won't use this maliciously
[System.Runtime.InteropServices.DllImport("gdi32.dll")]
public static extern int SetPixel(IntPtr hdc, int X, int Y, int crColor);这样就带来了一个问题:hdc怎么获得?
GDI+里已经不是靠dc来画图了。各位大虾,怎么办?
救救小弟吧,急用!!!