怎么用VB.NET做一个拼图游戏?

f10221022 2007-07-14 07:21:42
主要是自动将图片分割的那一块不知道怎么弄。高手来指点一下啊
...全文
372 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
天开之想 2007-07-26
  • 打赏
  • 举报
回复
VB版本:
dim X,Y,Width,Height ,i ,j as integer
dim mybitmaptarget,mybitmapsource as bitmap
dim mycolor as color
x=你切图的左端点
y=你切图的上端点
width=你切图的宽度
height=你切图的高度
mybitmaptarget=new bitmap(width,height)
mybitmapsource=你要切得图

for i=x to i<x+width
for j=y to j<y + height
mycolor=mybitmapsource.getpixel(i,j)
mybitmaptarget.setpixel(i-x,j-y,mycolor)
next
next
够清楚了吧,记得给分!!!
天开之想 2007-07-26
  • 打赏
  • 举报
回复
int X,Y,Width,Height,i,j;
Bitmap MyBitmapTarget,MyBitmapSource;
Color MyColor;

X=System.Convert.ToInt16(this.textBox1.Text);
Y=System.Convert.ToInt16(this.textBox2.Text);
Width=System.Convert.ToInt16(this.textBox3.Text);
Height=System.Convert.ToInt16(this.textBox4.Text);
MyBitmapTarget=new Bitmap(Width,Height);
MyBitmapSource=(Bitmap)(this.pictureBox1.Image);
for(i=X;i<X+Width;i++)
{
for(j=Y;j<Y+Height;j++)
{
MyColor=MyBitmapSource.GetPixel(i,j);
MyBitmapTarget.SetPixel(i-X,j-Y,MyColor);
}
}
天开之想 2007-07-26
  • 打赏
  • 举报
回复
就是切图吧?
看代码,切指定大小的图:

for(i=X;i<X+Width;i++)
{
for(j=Y;j<Y+Height;j++)
{
MyColor=MyBitmapSource.GetPixel(i,j);
MyBitmapTarget.SetPixel(i-X,j-Y,MyColor);
}
}
hongmo5hao 2007-07-19
  • 打赏
  • 举报
回复

http://www.visual-graph.com

这个控件直接就做了 下个可以玩玩

是处理动态交互图形的
f10221022 2007-07-18
  • 打赏
  • 举报
回复
怎么都没人来回答啊??

16,554

社区成员

发帖
与我相关
我的任务
社区描述
VB技术相关讨论,主要为经典vb,即VB6.0
社区管理员
  • VB.NET
  • 水哥阿乐
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧