Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Closed Thread
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 28th, 2005, 01:37 PM
Registered User
 
Join Date: Apr 2005
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Image Compression

I'm opening a tiff image that has citt group 4 compression, creating a bitmap to manipulate it and then saving the bitmap as a tiff again. The new tiff has LZ compression and I need to get it back to citt. I've since added this code to specify compression

    Dim eps As EncoderParameters = New EncoderParameters(1)
    eps.Param(0) = New EncoderParameter(System.Drawing.Imaging.Encoder.Qu ality, _
    System.Drawing.Imaging.EncoderValue.CompressionCCI TT4)
    image.Save(FileName, ici, eps)

It doesn't give me an error, but the compression is still LZ... I think I'm missing something fundamental.

  #2 (permalink)  
Old April 28th, 2005, 05:15 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Alameda, ca, USA.
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I use this Save overload:

image.Save("C:\\new1.tiff", System.Drawing.Imaging.ImageFormat.Tiff);

and it works fine. I read a bmp and save a tiff. Do you need to specify a codec?
Marco
  #3 (permalink)  
Old April 29th, 2005, 08:57 PM
Registered User
 
Join Date: Apr 2005
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Marco
Still no go... Saves as a tiff just fine, but it's still changing the compression. I added code to check the compression of the bitmap after it's manipulated and it still shows CITT4, but once saved as tiff it changes to LZ. Does yours not do this?

  #4 (permalink)  
Old May 2nd, 2005, 05:11 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Alameda, ca, USA.
Posts: 627
Thanks: 0
Thanked 0 Times in 0 Posts
Default

take a look at this article, this is where I got my code:
http://www.devx.com/dotnet/Article/18163/0/page/3
Marco
  #5 (permalink)  
Old May 19th, 2005, 03:52 PM
Registered User
 
Join Date: May 2005
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

4wrh,

You just need to change this line to:

eps.Param(0) = New EncoderParameter(System.Drawing.Imaging.Encoder.Compression, _
    System.Drawing.Imaging.EncoderValue.CompressionCCI TT4)


  #6 (permalink)  
Old May 24th, 2005, 05:39 PM
Registered User
 
Join Date: Apr 2005
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you both...I'll stop pulling my hair out now.

Closed Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
tiff compression sandrina C# 2005 1 December 4th, 2013 01:42 AM
Image Compression vaibhav VB How-To 1 July 3rd, 2008 06:43 AM
Compression changes on single tiff image hutchison1 Pro Visual Basic 2005 0 May 11th, 2007 03:28 PM
compression jaya_malini Java GUI 0 May 5th, 2005 10:01 AM
wav compression jothi Pro VB 6 0 April 26th, 2005 02:12 AM



All times are GMT -4. The time now is 11:28 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.