VoyForums

VoyUser Login optional ] [ 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: 07:20:20 08/24/00 Thu
Author: Michel
Subject: Re: Save bitmap as tiff with jpeg compression
In reply to: Peter Mikkelsen 's message, "Save bitmap as tiff with jpeg compression" on 05:46:09 08/23/00 Wed


Dear Peter,

Generally, to save from the TImageScrollBox, just call

ImageScrollBox.SaveToFile( 'newfile.jpg')

This won't set the compression to jpg though. To to that, you need to provide and event handler for the OnBeforeSave event. For example,


procedure TMainForm.ImageScrollBoxBeforeSave(
const Sender: TImageScrollBox;
const Graphic: TDibGraphic);
begin
if Graphic is TTiffGraphic then
begin
if Graphic.ImageFormat = ifTrueColor then
TTiffGraphic(Graphic).Compression := tcJPEG
else if Graphic.ImageFormat = ifBlackWhite then
TTiffGraphic(Graphic).Compression := tcGroup4

else
TTiffGraphic(Graphic).Compression := tcPackbits;
end;
end;

Best regards,

Michel

> How do I save a bitmap which has been loaded into a
> TImageScrollBox, as tiff with jpeg compression?

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


Replies:

  • Re: Save bitmap as tiff & vice versa -- vishwanath, 05:32:45 12/13/00 Wed
  • Re: Save bitmap as tiff & vice versa -- Michel, 07:26:27 12/13/00 Wed
    [ 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.