using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.IO; namespace SetPixel函数用法
{
class Program
{
static void Main(string[] args)
{
Color 试验用 = Color.Blue;
Bitmap bmp = new Bitmap(@"C:\5.BMP");
for (int 像素x = 0; 像素x < bmp.Width;像素x=像素x+1)
for (int 像素y = 0; 像素y < bmp.Height; 像素y = 像素y + 1)
{
bmp.SetPixel(像素x, 像素y, 试验用);
bmp.Save(@"c:\5.bmp", ImageFormat.Bmp);
}
}
}
}
错误提示是:当前上下文中不存在名称"ImageFormat" 这个函数(还是属性?)的参数应该怎样填呢? 这个bmp.Save是应该放在for内还是for外呢?
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.IO; namespace SetPixel函数用法
{
class Program
{
static void Main(string[] args)
{
Color 试验用 = Color.Blue;
Bitmap bmp = new Bitmap(@"C:\5.BMP");
for (int 像素x = 0; 像素x < bmp.Width;像素x=像素x+1)
for (int 像素y = 0; 像素y < bmp.Height; 像素y = 像素y + 1)
{
bmp.SetPixel(像素x, 像素y, 试验用);
bmp.Save(@"c:\5.bmp", ImageFormat.Bmp);
}
}
}
}
错误提示是:当前上下文中不存在名称"ImageFormat" 这个函数(还是属性?)的参数应该怎样填呢? 这个bmp.Save是应该放在for内还是for外呢?
解决方案 »
- C# 自带的打包工具问题
- winForm DataGridView实现列的关联操作问题
- c# 在主类中声明函数,到底在哪里写啊??请帮忙!!!!
- C# FTP客户端编程—LIST命令的问题
- 讨论一下c#命名规则
- 急啊!!急啊!!!!!!有人知道这个问题吗?
- 如何调用OFFICEXP 的公式编辑器,并将结果在RICHTEXTBOX中显示?
- dataset中已经存在一个table,想要新建一个table,怎样操作
- 错误 1 找不到类型或命名空间名称“Video”(是否缺少 using 指令或程序集引用?)
- 如何在其他电脑访问自己电脑的数据库
- 双击from A的职务窗口,如何弹出Fromb对应职务的数据窗口数据;
- C#高级编程(第四版)这本书怎么样?
using System.Drawing.Imaging;
bmp.Save(@"c:\5.bmp", System.Drawing.Imaging.ImageFormat.Bmp); Save放循环外面。