可能重复:
图像分为9个部分
虽然我用Google搜索足够但很遗憾找不到帮助.此代码项目教程也无法满足我的实际需要.
我在WinForm中有一个Image和9 PictureBox.
Image img = Image.FromFile("media\\a.png"); // a.png has 312X312 width and height
// some code help, to get
// img1, img2, img3, img4, img5, img6, img7, img8, img9
// having equal width and height
// then...
pictureBox1.Image = img1;
pictureBox2.Image = img2;
pictureBox3.Image = img3;
pictureBox4.Image = img4;
pictureBox5.Image = img5;
pictureBox6.Image = img6;
pictureBox7.Image = img7;
pictureBox8.Image = img8;
pictureBox9.Image = img9;
Run Code Online (Sandbox Code Playgroud)
这是一个示例图像为您:

这是我的Picture Puzzle类项目的一部分.我已经完成了photoshop图片,现在想动态剪切.
提前致谢.
如何从文件中读取int?我有一个大的(512MB)txt文件,其中包含整数数据:
0 0 0 10 5 0 0 140
0 20 6 0 9 5 0 0
Run Code Online (Sandbox Code Playgroud)
现在,如果我使用c = file.read(1),我一次只能得到一个字符,但我一次需要一个整数.喜欢:
c = 0
c = 10
c = 5
c = 140 and so on...
Run Code Online (Sandbox Code Playgroud)
任何伟大的心脏,请帮助.提前致谢.
我希望得到一个string[]指定的StreamReader.喜欢:
try{
StreamReader sr = new StreamReader("a.txt");
do{
str[i] = sr.ReadLine();
i++;
}while(i < 78);
}
catch (Exception ex){
MessageBox.Show(ex.ToString());
}
Run Code Online (Sandbox Code Playgroud)
我可以做到但不能使用字符串[].我想做这个:
MessageBox.Show(str[4]);
Run Code Online (Sandbox Code Playgroud)
如果您需要更多信息,请随时询问,我会更新.提前致谢...
c# ×1
c#-4.0 ×1
file-io ×1
image ×1
picturebox ×1
python ×1
python-2.7 ×1
streamreader ×1
string ×1