问题描述
如题我把图像以读入picurebox,代码如下tempBmp=(Bitmap)Bitmap.FromFile(openDialog.FileName);PicWidth=tempBmp.Width;//保存图像宽度PicHeight=tempBmp.Height;//保存图像高度originalPicture.Image=tempBmp;多边形的坐标是获取鼠标右击时的坐标,存入ArrayListpointArr中了,请问如何把pointArr数组点包含的图像在另一个picturebox中显示出来??
解决方案
解决方案二:
privatevoidbutton2_Click(objectsender,EventArgse){Bitmap_Bit=(Bitmap)Image.FromFile(@"C:1.bmp");Point[]_Point=newPoint[3];_Point[0]=newPoint(0,0);_Point[1]=newPoint(0,100);_Point[2]=newPoint(100,100);//定义了一个三角this.BackgroundImage=GetBitmap(_Bit,_Point);}publicstaticBitmapGetBitmap(Bitmapp_Bitmap,Point[]p_Point){System.Drawing.Drawing2D.GraphicsPath_Path=newSystem.Drawing.Drawing2D.GraphicsPath();_Path.AddPolygon(p_Point);Region_Region=newRegion(newRectangleF(0,0,p_Bitmap.Width,p_Bitmap.Height));_Region.Xor(_Path);Bitmap_New=(Bitmap)p_Bitmap.Clone();Graphics_Graphics=Graphics.FromImage(_New);_Graphics.FillRegion(Brushes.White,_Region);_Graphics.Dispose();return_New;}这样看看.