Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-10

Is this the best way to add TIFF support to imgviewer?

3 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Reinier Olislagers

(repost from the forum, no response there, so trying my luck here)

Am trying to extend the Lazarus examples\imgviewer application with .tiff support.

Is this[1] the best way to add tiff support to the Lazarus imageview demo application?
It works but is a bit slow. Perhaps the slowness is caused by the tiff reading routines themselves, my fairly large 5MB file or my way of coding.

Any suggestions to improve this?

Thanks,
Reinier

[1]
procedure TMainForm.ShowFile(Index: integer);
var
  TIFF: TTiffImage;
...
        // TImage does not support the TIFF format natively
        if
pos(LowerCase(ExtractFileExt(LBFiles.Items[Index])),'.tif.tiff')0 then
        begin
          TIFF:=TTiffImage.Create;
          try
            TIFF.LoadFromFile(LBFiles.Items[Index]);
            IMain.Picture.Bitmap.Assign(TIFF);
          finally
            TIFF.Free;
          end;
        end
        else
        begin
          // existing code

Reply by email

Unknown author
to Reinier Olislagers
Reinier Olislagers wrote 7 lines
(repost from the forum, no response there, so trying my luck here) Am trying to extend the Lazarus examples\imgviewer application with .tiff support. Is this[1] the best way to add tiff support to the Lazarus imageview demo application?

Normally, including fpreadtiff.pas in the uses clause should be enough ?

Michael.

Reply by email

Reinier Olislagers
to Unknown author
Show quoted text 15 lines
On Thu, 18 Oct 2012, Reinier Olislagers wrote: > (repost from the forum, no response there, so trying my luck here) > > Am trying to extend the Lazarus examples\imgviewer application with > .tiff support. > > Is this[1] the best way to add tiff support to the Lazarus imageview > demo application? Normally, including fpreadtiff.pas in the uses clause should be enough ? Michael.

Thanks, it seems so, couldn't find that mentioned though here
http://wiki.lazarus.freepascal.org/fcl-image
or
http://wiki.lazarus.freepascal.org/Developing_with_Graphics (added a section to this page; I'm less than precise with terms but at least the info is in there)

Thanks again,
Reinier

Reply by email