Converting Tiff Image into Byte Array(VB6)

Converting Tiff Image into Byte Array(VB6)

Page 1 of 1

3 Replies - 8100 Views - Last Post: 30 September 2008 - 08:29 PM Rate Topic: -----

#1 Sudhagar  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 30-September 08

Converting Tiff Image into Byte Array(VB6)

Post icon  Posted 30 September 2008 - 08:16 AM

Hi all,

I need a method to convert TIFF file stored in my system (For eg: C:\Scan\Filename.tiff) into Byte Array. I need to do this Visual Basic 6.
Because currently i am creating ACTIVEX control in VB6, I will add this method in my ActiveX control and I will use it where ever I need.

I was able to find method in .NET, but not in Visual Basic 6


private byte[] ConvertImageToByteArray(Image imageToConvert, ImageFormat formatOfImage)
{
byte[] Ret = new byte[0];
try
{
using (MemoryStream ms = new MemoryStream())
{
imageToConvert.Save(ms, formatOfImage);
Ret = ms.ToArray();
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
return Ret;
}


Thanks for all your valuable time,

Regards.
Sudhagar.S

Is This A Good Question/Topic? 0
  • +

Replies To: Converting Tiff Image into Byte Array(VB6)

#2 akhileshbc  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 9
  • View blog
  • Posts: 179
  • Joined: 27-September 08

Re: Converting Tiff Image into Byte Array(VB6)

Posted 30 September 2008 - 08:28 AM

have you searched google??? :)
Was This Post Helpful? 0
  • +
  • -

#3 Sudhagar  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 30-September 08

Re: Converting Tiff Image into Byte Array(VB6)

Posted 30 September 2008 - 10:35 AM

View Postakhileshbc, on 30 Sep, 2008 - 08:28 AM, said:

have you searched google??? :)

I tryed but nothing much worth useful. Any one can help me on this, would be great help.
Was This Post Helpful? 0
  • +
  • -

#4 akhileshbc  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 9
  • View blog
  • Posts: 179
  • Joined: 27-September 08

Re: Converting Tiff Image into Byte Array(VB6)

Posted 30 September 2008 - 08:29 PM

Then try searching in planetsourcecode.Com
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1