I&#039;m trying to save a Bitmap to a TIFF, but I keep getting "A generic<BR>error occured in GDI+" or "Invalid parameter used" errors. I&#039;ve tried<BR>everything I can think of, to no avail.... Has anyone ever do this<BR>successfully?<BR><BR><BR>Here this code:<BR><BR>Imports System.Drawing.Imaging<BR>Imports System.Web<BR>Imports System.Web.UI<BR>Imports System.Web.UI.WebControls<BR>Imports System.Web.UI.HtmlControls<BR>Imports System.Drawing.Imaging.EncoderValue<BR><BR>Public Class WebForm1<BR> Inherits System.Web.UI.Page<BR> Public lblInfo As Label<BR><BR>#Region " Web Form Designer Generated Code "<BR><BR> &#039;This call is required by the Web Form Designer.<BR> &#060;System.Diagnostics.DebuggerStepThrough()&#06 2; Private Sub<BR>InitializeComponent()<BR><BR> End Sub<BR><BR> Private Sub Page_Init(ByVal sender As System.Object, ByVal e As<BR>System.EventArgs) Handles MyBase.Init<BR> &#039;CODEGEN: This method call is required by the Web Form<BR>Designer<BR> &#039;Do not modify it using the code editor.<BR> InitializeComponent()<BR> End Sub<BR><BR>#End Region<BR><BR> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As<BR>System.EventArgs) Handles MyBase.Load<BR> MakeTiff("Company Infomation")<BR> End Sub<BR> Sub MakeTiff(ByVal sCaption As String)<BR> Try<BR> Dim iHeight As Integer = 792<BR> Dim iWidth As Integer = 612<BR> Dim objBitmap As Bitmap = New Bitmap(iWidth, iHeight)<BR> Dim objGraphics As Graphics =<BR>Graphics.FromImage(objBitmap)<BR> Dim objEncoder As System.Drawing.Imaging.Encoder<BR> Dim objEncoderParams As<BR>System.Drawing.Imaging.EncoderParameters<BR> <BR><BR> objGraphics.FillRectangle(New SolidBrush(Color.White), 0,<BR>0, iWidth, iHeight)<BR> &#039;objGraphics.FillRectangle(New SolidBrush(Color.Ivory), 0,<BR>0, iWidth, iHeight)<BR><BR> Dim objBlackBrush As SolidBrush = New<BR>SolidBrush(Color.Black)<BR> Dim objWhiteBrush As SolidBrush = New<BR>SolidBrush(Color.White)<BR> Dim objPen As Pen = New Pen(Color.Black)<BR> Dim fontDefault As Font = New Font("Arial", 11,<BR>FontStyle.Bold)<BR> Dim coordX As Integer<BR> Dim coordY As Integer<BR> coordX = 50<BR> coordY = 50<BR> &#039;Draw Company Info<BR> objGraphics.DrawRectangle(objPen, 20, 20, 200, 100)<BR> &#039;Draw table of 3 column, 2 row trip info labels<BR> objGraphics.FillRectangle(objBlackBrush, 230, 20, 120, 30)<BR> objGraphics.FillRectangle(objWhiteBrush, 232, 35, 116, 13)<BR> objGraphics.FillRectangle(objBlackBrush, 355, 20, 120, 30)<BR> objGraphics.FillRectangle(objWhiteBrush, 357, 35, 116, 13)<BR> objGraphics.FillRectangle(objBlackBrush, 480, 20, 120, 30)<BR> objGraphics.FillRectangle(objWhiteBrush, 482, 35, 116, 13)<BR> &#039;end first row<BR> objGraphics.FillRectangle(objBlackBrush, 230, 55, 120, 30)<BR> objGraphics.FillRectangle(objWhiteBrush, 232, 70, 116, 13)<BR> objGraphics.FillRectangle(objBlackBrush, 355, 55, 120, 30)<BR> objGraphics.FillRectangle(objWhiteBrush, 357, 70, 116, 13)<BR> objGraphics.FillRectangle(objBlackBrush, 480, 55, 120, 30)<BR> objGraphics.FillRectangle(objWhiteBrush, 482, 70, 116, 13)<BR> &#039;end second row<BR> objGraphics.FillRectangle(objBlackBrush, 230, 90, 120, 30)<BR> objGraphics.FillRectangle(objWhiteBrush, 232, 105, 116,<BR>13)<BR> objGraphics.FillRectangle(objBlackBrush, 355, 90, 120, 30)<BR> objGraphics.FillRectangle(objWhiteBrush, 357, 105, 116,<BR>13)<BR> objGraphics.FillRectangle(objBlackBrush, 480, 90, 120, 30)<BR> objGraphics.FillRectangle(objWhiteBrush, 482, 105, 116,<BR>13)<BR><BR> &#039;draw big square for line items<BR> objGraphics.DrawRectangle(objPen, 20, 125, 572, 200)<BR><BR> objGraphics.DrawString(sCaption, fontDefault,<BR>objBlackBrush, coordX, coordY)<BR><BR><BR> Dim objTIFFEncoder As ImageCodecInfo<BR> Dim objEncoderParm0, objEncoderParm1, objEncoderParm2 As<BR>EncoderParameter<BR> Dim objEncoderParms As EncoderParameters<BR> Dim objEncoderCompression As Encoder = Encoder.Compression<BR> Dim objEncoderColorDepth As Encoder = Encoder.ColorDepth<BR> Dim objEncoderSaveFlag As Encoder = Encoder.SaveFlag<BR> Dim lColorDepth As Long = 4<BR><BR> objTIFFEncoder = GetEncoderInfo("image/tiff")<BR> objEncoderParms = New EncoderParameters(3)<BR> objEncoderParm0 = New<BR>EncoderParameter(objEncoderCompression, CompressionCCITT3)<BR> objEncoderParms.Param(0) = objEncoderParm0<BR> objEncoderParm1 = New EncoderParameter(Encoder.ColorDepth,<BR>1)&#039;&# 060;-- When I use 1, 4 or 8 here, I get the generic error message, 24<BR>and 32 give the invalid parameter error<BR> objEncoderParms.Param(1) = objEncoderParm1<BR> objEncoderParm2 = New EncoderParameter(objEncoderSaveFlag,<BR>MultiFrame )<BR> objEncoderParms.Param(2) = objEncoderParm2<BR><BR><BR><BR> &#039;objBitmap.Save(Server.MapPath("blank.tif"),< BR>ImageFormat.Tiff) &#039;&#060;-- this works everytime<BR> objBitmap.Save(Server.MapPath("blankCCITT4.tif"),< BR>objTIFFEncoder, objEncoderParms)&#039;&#060;-- this fails when I try to use<BR>CompressionCCITT3 or 4<BR> objGraphics.Dispose()<BR> objBitmap.Dispose()<BR> Catch Ex As Exception<BR> lblInfo.Text = Ex.Message & " " & Ex.Source<BR><BR> End Try<BR><BR> End Sub<BR><BR> Private Function GetEncoderInfo(ByVal sMimeType As String) As<BR>ImageCodecInfo<BR> Dim aImageCodecInfo() As ImageCodecInfo<BR> Dim i As Integer<BR><BR> aImageCodecInfo = ImageCodecInfo.GetImageEncoders()<BR> For i = 0 To aImageCodecInfo.Length<BR> If aImageCodecInfo(i).MimeType = sMimeType Then<BR> Return aImageCodecInfo(i)<BR> Exit For<BR> End If<BR> Next<BR><BR> End Function<BR><BR> <BR>End Class<BR><BR><BR>Thanks for your help,<BR>SamC<BR>