Visual Studio C#编程可以实现往桌面绘制图片
public class 桌面 {
[DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
public static extern IntPtr GetDesktopWindow();
[DllImport("user32.dll", EntryPoint = "GetDCEx", CharSet = CharSet.Auto, ExactSpelling = true)]
public static extern IntPtr GetDCEx(IntPtr hWnd, IntPtr hrgnClip, int flags);
public static Graphics 返回桌面画纸() {
IntPtr desk = GetDesktopWindow();
IntPtr deskDC = GetDCEx(desk, IntPtr.Zero, 0x403);
return Graphics.FromHdc(deskDC);
}
}
//把下面代码加入Form1_Load中
桌面.返回桌面画纸().DrawImage(new Bitmap(@"C:\123.bmp"), new Rectangle(0,0, 500,500));
this.Hide(); //隐藏本窗体。
做成exe运行即可。