首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > VB Dotnet >

简单的图形处理有关问题

2012-01-21 
简单的图形处理问题假设PictureBox1有图片,需要在PictureBox2显示PictureBox1中间的一部分图片。应该怎么处

简单的图形处理问题
假设PictureBox1有图片,需要在PictureBox2显示PictureBox1中间的一部分图片。应该怎么处理?

[解决办法]
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
够清楚了吧,记得给分!!!

热点排行