VoyForums

VoyUser Login optional ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: 12345678910 ]


[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 12:07:55 12/03/07 Mon
Author: Henry Radford
Subject: Tiff Resizing and resolution

I have solved my own question on this. As I have noticed others having this problem I've included code that works.

bool Main::ImageConvert(String FilePathName)
{
TResizeTransform *Transform;
bool retval = false;
TTiffGraphic *tif;
int i;

if ((tif = new (TTiffGraphic)) != NULL) {
if ((Transform = new (TResizeTransform)) != NULL)
retval = true;
}

if (retval) {
retval = false;

try {
tif->LoadFromFile(FilePathName);
retval = true;
}
catch(Exception &exc) {
;
}
}

if (retval) {
retval = false;
try {
Transform->Width = (int)((double)tif->Width * 1.5);
Transform->Height = (int)((double)tif->Height * 1.5);
Transform->Interpolated = false;
Transform->OverrideDestFormat = false;
Transform->Apply(tif);
retval = true;
}
catch(Exception &exc) {
;
}
}

if (retval) {
tif->XDotsPerInch = 300;
tif->YDotsPerInch = 300;

try {
tif->SaveToFile(FilePathName);
retval = true;
}
catch(Exception &exc) {
;
}
}

if (Transform)
delete Transform;

return retval;
}

[ Next Thread | Previous Thread | Next Message | Previous Message ]

VoyUser Login ] Not required to post.
Post a public reply to this message | Go post a new public message
* Notice: Posting problems? [ Click here ]
* HTML allowed in marked fields.
Message subject (required):

Name (required):

  Expression (Optional mood/title along with your name) Examples: (happy, sad, The Joyful, etc.) help)

  E-mail address (optional):

Type your message here:


Notice: Copies of your message may remain on this and other systems on internet. Please be respectful.

[ Contact Forum Admin ]


Forum timezone: GMT-5
VF Version: 2.94, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2008 Voyager Info-Systems. All Rights Reserved.