嘿家伙我想知道是否有办法得到某个位图的某个区域?我试图制作一个瓷砖切割器,我需要它来遍历加载的瓷砖集,然后将图像剪切成xscale * yscale图像,然后单独保存它们。我目前正在使用这个为我的循环切割过程。得到一个位图的某个正方形区域
int x_scale, y_scale, image_width, image_height;
image_width = form1.getWidth();
image_height = form1.getHeight();
x_scale = Convert.ToInt32(xs.Text);
y_scale = Convert.ToInt32(ys.Text);
for (int x = 0; x < image_width; x += x_scale)
{
for (int y = 0; y < image_height; y += y_scale)
{
Bitmap new_cut = form1.getLoadedBitmap();//get the already loaded bitmap
}
}
那么有没有办法可以“选择”位图new_cut的一部分,然后保存该部分?
谢谢,作品很棒:)我学到了很多东西! – 2012-02-04 08:56:55