HighTechTalks DotNet Forums  

Tif file parameters question

Dotnet Framework (Drawing) microsoft.public.dotnet.framework.drawing


Discuss Tif file parameters question in the Dotnet Framework (Drawing) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Robert Dufour
 
Posts: n/a

Default Tif file parameters question - 03-18-2007 , 04:14 PM






I create a 32bpp rgb bitmap in my code to write some text to it then convert
it to a monochrome. My original bitmap is 1728 W by 2261 High with a
resolution set of X= 204 and Y = 196.
After converting it to a monochrome bitmap it has the same pixels height
width and resolutions.
I then save it as a tif file with cdcit group 3 fax compression. But it
won't fax out with my dialogic board.
I know the tiff file should be 1728 wide, single striped segmentation,
multipage tiff even though it only contains one page. The code that does my
conversion to tif is the following.

MyBitMapBW = BmpCvrtr.ConvertBmp32rgbToBitonal(MyBitmapRgb)

'I finish the conversion to B&W then
Dim MyEncoder As Encoder

Dim MyEncoderParam As EncoderParameter

Dim MyEncoderParams As EncoderParameters = New EncoderParameters(5)

MyEncoderParams.Param(0) = New EncoderParameter(Encoder.Compression,
CType(EncoderValue.CompressionCCITT3, Long))

MyEncoderParams.Param(1) = New EncoderParameter(Encoder.ColorDepth, 1) '

MyEncoderParams.Param(2) = New EncoderParameter(Encoder.SaveFlag,
CType(EncoderValue.MultiFrame, Long)) '

MyEncoderParams.Param(3) = New EncoderParameter(Encoder.SaveFlag,
CType(EncoderValue.FrameDimensionPage, Long)) '

MyEncoderParams.Param(4) = New EncoderParameter(Encoder.SaveFlag,
CType(EncoderValue.Flush, Long)) '

Dim MyImgCodecInfo As ImageCodecInfo = GetEncoderInfo("image/tiff")

MyBitMapBW.Save("C:\TIFF\TestFax.Tif", MyImgCodecInfo, MyEncoderParams)



What am I dong wrong? Can anyone put me on the track to converting this
correctly.

Thanks for any help.

Bob



Reply With Quote
  #2  
Old   
Michael C
 
Posts: n/a

Default Re: Tif file parameters question - 03-19-2007 , 12:36 AM






"Robert Dufour" <bdufour (AT) sgiims (DOT) com> wrote

Quote:
I create a 32bpp rgb bitmap in my code to write some text to it then
convert it to a monochrome. My original bitmap is 1728 W by 2261 High with
a resolution set of X= 204 and Y = 196.
After converting it to a monochrome bitmap it has the same pixels height
width and resolutions.
I then save it as a tif file with cdcit group 3 fax compression. But it
won't fax out with my dialogic board.
I know the tiff file should be 1728 wide, single striped segmentation,
multipage tiff even though it only contains one page. The code that does
my conversion to tif is the following.

MyBitMapBW = BmpCvrtr.ConvertBmp32rgbToBitonal(MyBitmapRgb)

'I finish the conversion to B&W then
Dim MyEncoder As Encoder

Dim MyEncoderParam As EncoderParameter

Dim MyEncoderParams As EncoderParameters = New EncoderParameters(5)

MyEncoderParams.Param(0) = New EncoderParameter(Encoder.Compression,
CType(EncoderValue.CompressionCCITT3, Long))

MyEncoderParams.Param(1) = New EncoderParameter(Encoder.ColorDepth, 1) '
You need to convert to 1 to long here also as it will default to int.

Michael




Reply With Quote
  #3  
Old   
Michael C
 
Posts: n/a

Default Re: Tif file parameters question - 03-19-2007 , 12:38 AM



"Robert Dufour" <bdufour (AT) sgiims (DOT) com> wrote

Quote:
I create a 32bpp rgb bitmap in my code to write some text to it then
convert it to a monochrome. My original bitmap is 1728 W by 2261 High with
a resolution set of X= 204 and Y = 196.
After converting it to a monochrome bitmap it has the same pixels height
width and resolutions.
I then save it as a tif file with cdcit group 3 fax compression. But it
won't fax out with my dialogic board.
I know the tiff file should be 1728 wide, single striped segmentation,
multipage tiff even though it only contains one page. The code that does
my conversion to tif is the following.
If that wasn't the problem try having a look at 2 tiff files in a hex
editor. The format isn't that complex to understand. You can download tiff
file info from the web. You might end up having to write the file to disk
manually if there's one small param that your fax proggy doesn't like.

Michael




Reply With Quote
  #4  
Old   
Robert Dufour
 
Posts: n/a

Default Re: Tif file parameters question - 03-19-2007 , 11:14 AM



Thanks Michael, you've been GREAT
Bob
"Michael C" <nospam (AT) nospam (DOT) com> wrote

Quote:
"Robert Dufour" <bdufour (AT) sgiims (DOT) com> wrote in message
news:OI6TzpZaHHA.4508 (AT) TK2MSFTNGP03 (DOT) phx.gbl...
I create a 32bpp rgb bitmap in my code to write some text to it then
convert it to a monochrome. My original bitmap is 1728 W by 2261 High with
a resolution set of X= 204 and Y = 196.
After converting it to a monochrome bitmap it has the same pixels height
width and resolutions.
I then save it as a tif file with cdcit group 3 fax compression. But it
won't fax out with my dialogic board.
I know the tiff file should be 1728 wide, single striped segmentation,
multipage tiff even though it only contains one page. The code that does
my conversion to tif is the following.

If that wasn't the problem try having a look at 2 tiff files in a hex
editor. The format isn't that complex to understand. You can download tiff
file info from the web. You might end up having to write the file to disk
manually if there's one small param that your fax proggy doesn't like.

Michael




Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.