
正文
vb.net取画图像素 vb如何使用图像控件显示图片
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
vb.net怎么获取图片的各个像素的BGR值,我这个不得行
应该是边界溢出了,因为默认是0开始,所以 PictureBox1.Image.Width-1
同理PictureBox1.Image.Height - 1,不然行循环也会溢出
相关问答
Q1: 在vb.net中,如何获取Graphics中某一指定点(像素)的颜色值?(VB语言)
要使用GetPixel函数来取得像素vb.net取画图像素的颜色值vb.net取画图像素,代码如下vb.net取画图像素:
1
2
3
4
5
private void button1_Click(object sender, EventArgs e)
{
Color color = new Bitmap(pictureBox1.Image).GetPixel(10, 10);
MessageBox.Show(color.ToString());
Q2: VB.NET怎样把USB摄像头在显示器上输出的实时画面(像素信息),引入到数据库.
用directshow获取帧缓存,转换为标准图像格式(比如jpg,png这些),存储到数据库vb.net取画图像素的image字段里就行vb.net取画图像素了.
Q3: VB.net中如何画图?
VB.net与VB不同。
VB.net已经有专门绘图的类。
可以定义笔刷然后用Drawing类中的方法绘制。
Private Sub DrawEllipse()
Dim myPen As New System.Drawing.Pen(System.Drawing.Color.Red)
Dim formGraphics as System.Drawing.Graphics
formGraphics = Me.CreateGraphics()
formGraphics.DrawEllipse(myPen, New Rectangle(0,0,200,300))
myPen.Dispose()
formGraphics.Dispose()
End Sub
Private Sub DrawRectangle()
Dim myPen As New System.Drawing.Pen(System.Drawing.Color.Red)
Dim formGraphics as System.Drawing.Graphics
formGraphics = Me.CreateGraphics()
formGraphics.DrawRectangle(myPen, New Rectangle(0,0,200,300))
myPen.Dispose()
formGraphics.Dispose()
End Sub
Q4: 在VB.NET中通过那个函数可以获取当前屏幕的分辨率?
您可以用下面给出这一小段代码检测当前屏幕分辨率,然后根据结果作出反应──例如,重新调整窗体大小以适应用程序户分辨率。
Public Function CheckRez(pixelWidth As Long, pixelHeight As Long) As Boolean
'
Dim lngTwipsX As Long
Dim lngTwipsY As Long
'
' convert pixels to twips
lngTwipsX = pixelWidth * 15
lngTwipsY = pixelHeight * 15
'
' check against current settings
If lngTwipsX Screen.Width Then
CheckRez = False
Else
If lngTwipsY Screen.Height Then
CheckRez = False
Else
CheckRez = True
End If
End If
'
End Function
Next, run the following code at the start of the program:
If CheckRez(640, 480) = False Then
MsgBox "Incorrect screen size!"
Else
MsgBox "Screen Resolution Matches!"
End If
关于vb.net取画图像素和vb如何使用图像控件显示图片的介绍到此就结束了,不知道你从中找到你需要的信息了吗 ?如果你还想了解更多这方面的信息,记得收藏关注本站。







