win7怎么把一张图片放到桌面上,但不是变成背景

就放在一边,背景还是原来的壁纸

第1个回答  2020-01-29

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运行即可。

第2个回答  2013-03-20
其实,我也在想这个问题,不过。突然我明白了!用ps哈哈~~~
相似回答