2
我摆弄桌面小工具(时钟)。它下面有反射效果,需要透明,我使用CopyFromScreen获取背景,然后将窗体背景设置为此。需要删除一个文件,由我自己的应用程序使用
像这样(一个“停靠/取消停靠”按钮的一部分):
Rectangle bounds = this.Bounds;
using (Bitmap ss = new Bitmap(bounds.Width, bounds.Height))
using (Graphics g = Graphics.FromImage(ss))
{
this.Opacity = 0;
g.CopyFromScreen(this.Location, Point.Empty, bounds.Size);
ss.Save(@"C:\clock1s\bg", ImageFormat.Png);
this.Opacity = 100;
this.BackgroundImage = new Bitmap(@"C:\clock1s\bg");
g.Dispose();
}
现在,每当我想再次使用它(比如移动时钟),我不能删除该文件或重新保存它,因为它目前正在使用中。我已经尝试将表单BG设置为其他内容,但那不起作用。
我该怎么办?
编辑:分类,谢谢(兰斯麦克尼尔尼)。
现在,如果我已将保存到文件,该怎么办?
而且,奖金问题:
the goddamn batwatch http://upload.snelhest.org/images/100219batwatch.jpg
选项和图标的形式下结束了是一个小麻烦,如果可能的话,我想他们要么结束在上面,或低于(保持平滑的抗锯齿)。我假设这是摆脱我的束缚,以解决问题的方法。
咄。谢谢。 稍后标记您的答案,允许人们对第二部分发表评论 – pastapockets 2010-02-19 18:41:30