vb.net导出图片格式的简单介绍

VB.net如何将多张图片保存为一个多页的tiff文件

自己上msdn找mode。

创新互联服务紧随时代发展步伐,进行技术革新和技术进步,经过十余年的发展和积累,已经汇集了一批资深网站策划师、设计师、专业的网站实施团队以及高素质售后服务人员,并且完全形成了一套成熟的业务流程,能够完全依照客户要求对网站进行成都网站设计、网站制作、建设、维护、更新和改版,实现客户网站对外宣传展示的首要目的,并为客户企业品牌互联网化提供全面的解决方案。

这里有个C的。

private ImageCodecInfo GetEncoder(ImageFormat format)

{

ImageCodecInfo[] codecs = ImageCodecInfo.GetImageDecoders();

foreach (ImageCodecInfo codec in codecs)

{

if (codec.FormatID == format.Guid)

{

return codec;

}

}

return null;

}

private void VaryQualityLevel()

{

// Get a bitmap.

Bitmap bmp1 = new Bitmap(@"c:\TestPhoto.jpg");

ImageCodecInfo jgpEncoder = GetEncoder(ImageFormat.Jpeg);

// Create an Encoder object based on the GUID

// for the Quality parameter category.

System.Drawing.Imaging.Encoder myEncoder =

System.Drawing.Imaging.Encoder.Quality;

EncoderParameters myEncoderParameters = new EncoderParameters(1);

EncoderParameter myEncoderParameter = new EncoderParameter(myEncoder, 0L);

myEncoderParameters.Param[0] = myEncoderParameter;

Bitmap b = new Bitmap(100, 200);

Graphics g = Graphics.FromImage(b);

g.InterpolationMode = InterpolationMode.HighQualityBicubic;

g.DrawImage(bmp1, new Rectangle(0, 0, 100, 100), new Rectangle(0, 0, bmp1.Width, bmp1.Height), GraphicsUnit.Pixel);

g.Dispose();

b.Save(@"c:\TestPhotoQualityZero.jpg", jgpEncoder, myEncoderParameters);

}

请问VB.net中如何保存BMP/jpg图像

我理解你

我写过图片网络传输的和你要求的一样

为了不把图片写到硬盘 又从硬盘读取

而直接保存图片内存流 进行网络传输

从网络读取的图片byte数组转成图片代码如下

Dim mStream As New IO.MemoryStream

mStream.Write(b, 0, b.length) '这里b就是你的一维数组了

Dim Img As New Bitmap(mStream)

mStream.Close()

mStream.Dispose()

下面是把图片保存到一维数组的方法

Dim Stream As New IO.MemoryStream

im.Save(Stream, System.Drawing.Imaging.ImageFormat.Jpeg)

im = Nothing

Stream.Flush()

Dim b As Byte() = Stream.ToArray

Stream.Dispose()

请问VB.net下如何使用winsock udp协议发送图片 和接收图片并存为jpg格式

winsock 发送图片,就是发送文件嘛。

不过UDP协议每次最多只能发送8K,所以你要先读取文件,建立以个byte()数组 然后第一次发送是从数组的0-8100这个范围,下次再发送的时候将再从8101开始发送,长度仍未8100就可以了。用一个while 循环来判断文件有没有发送完成就行了。对于接收端,在接收的时候也是要用一个循环来写文件,前提是你必须先把要发送的文件的长度告诉接收端。说的够详细了吧!

用VB.NET打开一张图片后,我怎样知道图片的格式?

Dim fmt As System.Drawing.Imaging.ImageFormat = PictureBox1.Image.RawFormat

If fmt.Equals(System.Drawing.Imaging.ImageFormat.Jpeg) Then

MsgBox("1")

ElseIf fmt.Equals(System.Drawing.Imaging.ImageFormat.Gif) Then

MsgBox("2")

End If

vb.net 导出PDF

利用DataWindow.net在 vb.net 下导出PDF格式文件

利用datawindow.net,导出PDF文件,实现前提:

1.安装Acrobat Distiller虚拟打印机,注意要用datawindow.net提供的打印驱动,在c:\program files\sybase\datawindow.net2.0\driver中,在文章最后,我会提供一个静态安装虚拟打印机的批处理文件,方便安装。

2.安装Ghostscript 7.05 ,在网上找,免费的。

3.导出PDF文件前,一要指定虚拟打印机名,其次导出格式为PDF(Export.PDF.Method=Distill!),另外还要指定 PDF.Distill.CustomPostScript=Yes。

具体代码如下:

''' summary

''' 导出文件

''' /summary

''' param name="sender"/param

''' param name="e"/param

''' remarks/remarks

Private Sub btnExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExport.Click

Try

Dim strFilename, strPrinter As String

Dim saveDg As New SaveFileDialog

strPrinter = Me.dwPrint.Describe("DataWindow.Print.PrinterName")

saveDg.FileName = Me.dwPrint.Tag.ToString

saveDg.Filter = "Pdf文件|*.pdf|Excel文件|*.xls|所有文件|*.*"

If saveDg.ShowDialog = Windows.Forms.DialogResult.OK Then

strFilename = saveDg.FileName

If strFilename.IndexOf(".pdf") 0 Then

Me.dwPrint.Modify("DataWindow.Print.PrinterName='Acrobat Distiller'")

Me.dwPrint.Modify("DataWindow.Export.PDF.Method=Distill!")

Me.dwPrint.Modify("DataWindow.Export.PDF.Distill.CustomPostScript=Yes")

Me.dwPrint.SaveAs(strFilename, Sybase.DataWindow.FileSaveAsType.Pdf, True)

ElseIf strFilename.IndexOf(".xls") 0 Then

Me.dwPrint.SaveAs(strFilename, Sybase.DataWindow.FileSaveAsType.Excel, True)

End If

Me.dwPrint.Modify("DataWindow.Print.PrinterName='" + strPrinter + "'")

MessageBox.Show("导出成功!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information)

End If

Catch ex As Exception

MessageBox.Show(ex.Message, "提示", MessageBoxButtons.OK, MessageBoxIcon.Error)

End Try

End Sub

4 批处理文件(实现静默安装)

vb.net如何把image类的变量以png格式导出

REM 假设存在Image类型变量img 

Dim bmp As Bitmap = CType(img, Bitmap) '先将Image类型强制转换为Bitmap类型 

bmp.Save("C:\1.png", System.Drawing.Imaging.ImageFormat.Png) '以PNG格式存储到C:\1.png


网页标题:vb.net导出图片格式的简单介绍
标题链接:http://myzitong.com/article/hhgpes.html