Pset (x, y), color
在隆回等地区,都构建了全面的区域性战略布局,加强发展的系统性、市场前瞻性、产品创新能力,以专注、极致的服务理念,为客户提供网站制作、网站设计 网站设计制作按需网站建设,公司网站建设,企业网站建设,品牌网站建设,成都全网营销,成都外贸网站制作,隆回网站建设费用合理。
其中x,y是所画点的坐标值,color是点的颜色值,比如:
Me.PSet (100, 100), vbRed '在当前窗体的(100,100)位置画一个红色的点
又比如:
Picture1.PSet (Picture1.ScaleWidth \ 2, Picture1.ScaleHeight \ 2), vbBlue '在Picture1中的中心位置画一个蓝色的点
画点:
在PictureBox的Paint事件里面:
dim myGraphics=e.Graphics
Dim myPointArray As Point() = {New Point(0, 0), New Point(50, 30), New Point(30, 60)}
myGraphics.DrawPolygon(myPen, myPointArray)
画圆:
Dim g As Graphics
g = PictureBox1.CreateGraphics
g.FillEllipse(Brushes.Red, x, y, 10, 10)
自己用GDI+画的 无论什么什么尺寸的picturebox都行
不过别太小了o(∩_∩)o
代码放在哪里自己决定啊
最好是放在 picturebox的resize时间里
每次picturebox大小改变都重画一次坐标
Dim b As New Bitmap(PictureBox1.Width, PictureBox1.Height)
Dim g As Graphics = Graphics.FromImage(b)
g.Clear(Color.White)
Dim p As New Pen(Color.Black)
p.EndCap = Drawing2D.LineCap.ArrowAnchor
g.DrawLine(p, 30, PictureBox1.Height - 30, 30, 30)
g.DrawLine(p, 30, PictureBox1.Height - 30, PictureBox1.Width - 30, PictureBox1.Height - 30)
Dim i As Integer
Dim bs As New SolidBrush(Color.Green)
Dim po As New Point
po.X = 0
po.Y = PictureBox1.Height - 35
For i = 700 To 1000 Step 50
g.DrawString(i, Me.Font, bs, po.X, po.Y)
g.DrawLine(p, po.X + 28, po.Y + 5, po.X + 30, po.Y + 5)
po.Y -= (PictureBox1.Height - 100) / 6
Next
po.X = 30
po.Y = PictureBox1.Height - 30
For i = 0 To 40 Step 5
g.DrawString(i, Me.Font, bs, po.X, po.Y + 5)
g.DrawLine(p, po.X, po.Y + 2, po.X, po.Y)
po.X += (PictureBox1.Width - 100) / 8
Next
PictureBox1.Image = b
vb中画点用Pset方法。根据查询相关公开信息显示,vb中画点,画线,画圆分别用Pset、Line、Circle方法进行绘制。
Dim b As New Bitmap(320, 200)'定义图像宽高
Dim clrs As Color=Color.Black
for y as int32=1 to 199
for x as int32=1 to 319
if x=y then
clrs = Color.White'假设是对角线,x=y时使用白色
else
clrs = Color.Black'平时使用黑色
endif
b.SetPixel(x, y, clrs)'画点
next
next
b.Save("test.tif", System.Drawing.Imaging.ImageFormat.Tiff)'保存到图片文件
==================
原创例子,祝进步!!