VoyForums
[ Show ]
Support VoyForums
[ Shrink ]
VoyForums Announcement: Programming and providing support for this service has been a labor of love since 1997. We are one of the few services online who values our users' privacy, and have never sold your information. We have even fought hard to defend your privacy in legal cases; however, we've done it with almost no financial support -- paying out of pocket to continue providing the service. Due to the issues imposed on us by advertisers, we also stopped hosting most ads on the forums many years ago. We hope you appreciate our efforts.

Show your support by donating any amount. (Note: We are still technically a for-profit company, so your contribution is not tax-deductible.) PayPal Acct: Feedback:

Donate to VoyForums (PayPal):

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: 12345678[9]10 ]


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

Date Posted: 18:20:18 11/09/00 Thu
Author: Kyle Boatwright
Subject: Re: Deleting a page in a multi-page tiff
In reply to: Michel 's message, "Re: Deleting a page in a multi-page tiff" on 07:39:04 11/09/00 Thu

>
> Hi Kyle,
>
> Your loop,
>
> for i := 1 to iImgCnt do
> begin
> if i <> iCurrImg the
> begin
> tgrSource.SingleLoadFromStream(msViewImage, i);
> tgrSource.AppendToStream(fsDest);
> end;
> end;
>
> looks fine.
>
> When you write "ImageCount gets hosed up", do you mean
> the iImgCnt variable? I don't know why the loop
> variable i, would be -1. Is it possible that this code
> is having problems when there is not any image loaded
> in Image1?
>
> Best regards,
>
> Michel
>
> > I would like to allow my users the option to delete a
> > page in a multi-page TIFF. I've tried a number of
> > solutions the current is this:
> >
> > var
> > iCurrImg: Integer;
> > iImgCnt: Integer;
> > i: Integer;
> > tgrSource: TTiffGraphic;
> > fsDest: TFileStream;
> > begin
> > //TODO: Verify page delete
> > tgrSource := TTiffGraphic.Create;
> > fsDest :=
> > TFileStream.Create(AddBackSlash(msPrivDir) +
> > '$$Wrk.TIF', fmCreate);
> > iImgCnt := Image1.FrameCount; //Current number of
> > frames
> > iCurrImg := Image1.CurrentFrame; //Current frame
> in
> > view (to delete)
> > msViewImage.Seek(0, soFromBeginning);
> >
> > for i := 1 to iImgCnt do begin
> > if i <> iCurrImg then begin
> > tgrSource.SingleLoadFromStream(msViewImage, i);
> > tgrSource.AppendToStream(fsDest);
> > end;
> > end;
> > fsDest.Seek(0, soFromBeginning);
> > Image1.LoadFromStream(fsDest, 'TIF', 0);
> > fsDest.Free;
> > end;
> >
> > This works OK except the ImageCount gets hosed up and
> > ends up zero and the current image becomes -1. What
> > am I doing wrong???
> >
> > Thanks for your help!
> > Kyle Boatwright
On further review, Envision works fine. I was expecting the ImageScrollBox.FrameCount to = 1 for a Tiff that is not Multi-page, but it is = 0. ImageScrollBox.CurrentFrame = -1. Easy enough to work around, just not what I expected.

Thanks for your help...

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

[ Contact Forum Admin ]


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