vb.net图片转位图 vb实现图片旋转

在VB.NET中浏览图片

转换成位图肯定是可以浏览的,WMF文件没试过。

成都创新互联主营扶风网站建设的网络公司,主营网站建设方案,APP应用开发,扶风h5成都微信小程序搭建,扶风网站营销推广欢迎扶风等地区企业咨询

你可以将图片以二进制形式存储在数据库中,如果是SQL Server,对应字段的类型应该是image。

vb中,怎么可以把一张图片旋转起来

这个问题不是小问题。如果只是90度转,vb.net的picture控件有RotateFlip方法。

任意角度,可以参考这个

;cs-lang=csharp

图片的变换涉及坐标处理,要自己算。

还有可以用Windows Presentation Foundation (WPF) 编程,里面的image控件好像也能旋转图片。

如果是VB6,恐怕只能用API函数了,百度一下“vb 旋转图片” “VB api函数”了解一下

vb.net如何将图片转二进制

'容易,用api,查一查SetBitmapBits

'新建工程,增加一个 command button , 一个 picture box , 将图片加载到 picture box.

'将代码粘贴到 Form1

Private Type BITMAP

bmType As Long

bmWidth As Long

bmHeight As Long

bmWidthBytes As Long

bmPlanes As Integer

bmBitsPixel As Integer

bmBits As Long

End Type

Private Declare Function GetObject Lib "gdi32" Alias "GetObjectA" (ByVal hObject As Long, ByVal nCount As Long, lpObject As Any) As Long

Private Declare Function GetBitmapBits Lib "gdi32" (ByVal hBitmap As Long, ByVal dwCount As Long, lpBits As Any) As Long

Private Declare Function SetBitmapBits Lib "gdi32" (ByVal hBitmap As Long, ByVal dwCount As Long, lpBits As Any) As Long

Dim PicBits() As Byte, PicInfo As BITMAP, Cnt As Long

Private Sub Command1_Click()

'Get information (such as height and width) about the picturebox

GetObject Picture1.Image, Len(PicInfo), PicInfo

'reallocate storage space

ReDim PicBits(1 To PicInfo.bmWidth * PicInfo.bmHeight * 3) As Byte

'Copy the bitmapbits to the array

GetBitmapBits Picture1.Image, UBound(PicBits), PicBits(1)

'Invert the bits

For Cnt = 1 To UBound(PicBits)

PicBits(Cnt) = 255 - PicBits(Cnt)

Next Cnt

'Set the bits back to the picture

SetBitmapBits Picture1.Image, UBound(PicBits), PicBits(1)

'refresh

Picture1.Refresh

End Sub

VB.net 如何将数据转换为位图(Bitmap)所需要的byte()数组?急!!!!

public Byte[] getphoto(string photopath) //参数图片地址,主要用到的类有FileStream

{

string str = photopath;

FileStream file = new FileStream(str, FileMode.Open, FileAccess.Read);

Byte[] bytBLOBData = new Byte[file.Length];

file.Read(bytBLOBData, 0, bytBLOBData.Length);

file.Close();

return bytBLOBData;

}//这是定义函数..

Vb.net怎么实现图像的处理

这问题有点笼统,软糖来说说把:

图像处理由System.Drawing命名空间负责。

主要是Bitmap类和Graphics类。

Bitmap表示一个位图,可以是BMP,JPG,PNG等文件。

装载位图

Dim 位图 As Bitmap = Bitmap.FromFile("C:\Image1.PNG")

Graphics表示一张画纸,能够进行绘制操作。

它可以被窗体、控件、位图调用CreateGraphics()方法来创建。

然后调用Graphics.Draw开头的一系列函数来绘制图像和图形,Fill开头的填充图形。

创建画纸并绘制位图

Dim 画纸 As Graphics = Me.CreateGraphics()

画纸.DrawImage(位图, 100, 100, 256, 256)

可以将上面三行放到Form1_Load中测试,把路径改一下,

还可以把Me改为能在上面绘图的控件的名称。

更多内容请看MSDN的System.Drawing命名空间。

如满意,请采纳,谢谢。


标题名称:vb.net图片转位图 vb实现图片旋转
链接URL:http://pwwzsj.com/article/hpphsj.html