Hi I am reading in a byte [] into a image and having trouble cropping the image after inserting it into the aspose.cells.worksheet. The image being read into the stream needs to crop to the bottom 4th of the page. See code below.
Dim book As New Aspose.Cells.Workbook(xlsDocPath)
'Get the first worksheet
Dim sheet As Aspose.Cells.Worksheet = book.Worksheets(0)
Dim ansTif2() As Byte
ansTif2 = File.ReadAllBytes(“C:\ans.tif”)
Dim stream As MemoryStream = New MemoryStream()
stream.Write(ansTif2, 0, ansTif2.Length)
Dim infoImage As System.Drawing.Image = System.Drawing.Image.FromStream(stream)
'Insert a picture into a cell using a stream
'sheet.Pictures.Add(12, 1, stream, 100, 100)
sheet.Pictures.Add(20, 0, stream)
Dim pic As Aspose.Cells.Drawing.Picture
pic = sheet.Pictures(1)
pic.FormatPicture.Brightness = 0.5F
pic.FormatPicture.Contrast = 0.5
pic.IsLockAspectRatio = False
’ Set the picture size format
pic.Height = 400.0F
pic.Width = 600.0F
’ Set the picture trimming
pic.FormatPicture.TopCrop = 450.0F
pic.FormatPicture.BottomCrop = 85.0F
pic.FormatPicture.RightCrop = 40.0F
pic.FormatPicture.LeftCrop = 5.0F
'pic.Top = 536
'pic.Left = 6
book.Save(“c:\temp.xls”, SaveFormat.Excel97To2003)