Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6713171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:20:52+00:00 2026-05-26T08:20:52+00:00

I am currently working on Delphi XE2 trial version. I want to load and

  • 0

I am currently working on Delphi XE2 trial version. I want to load and display TIFF images in TImage control without using any third party component/library.

I tried below code but it is not woking for me.

Procedure TForm1.Button1Click(Sender: TObject); 
Var 
     OleGraphic               : TOleGraphic; 
     fs                       : TFileStream; 
     Source                   : TImage; 
     BMP                      : TBitmap; 
Begin 
     Try 
          OleGraphic := TOleGraphic.Create; 

          fs := TFileStream.Create('c:\testtiff.dat', fmOpenRead Or fmSharedenyNone); 
          OleGraphic.LoadFromStream(fs); 

          Source := Timage.Create(Nil); 
          Source.Picture.Assign(OleGraphic); 

          BMP := TBitmap.Create; 
          bmp.Width := Source.Picture.Width; 
          bmp.Height := source.Picture.Height; 
          bmp.Canvas.Draw(0, 0, source.Picture.Graphic); 

          image1.Picture.Bitmap := bmp;
     Finally 
          fs.Free; 
          OleGraphic.Free; 
          Source.Free; 
          bmp.Free; 
     End; 
End;

Please advice.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T08:20:52+00:00Added an answer on May 26, 2026 at 8:20 am

    As said in my comment, if the file extension is the standard tiff extension the code to open the file is trivial :

    image1.Picture.LoadFromFile(MyTiffFile);
    

    If not, follow the answer from dwrbudr.

    Here is an example :

    procedure LoadBitmapFromFile( aImage : TImage; tiffFilename : String);
    var
      tiffIm : TWICImage;
      ext : String;
    begin
      ext := SysUtils.ExtractFileExt(tiffFilename);
      if (ext = '.tif') or (ext = '.tiff')
        then aImage.Picture.LoadFromFile(tiffFilename)
        else begin
          tiffIm:= TWICImage.Create;
          try
            tiffIm.LoadFromFile(tiffFilename);
            aImage.Picture.Bitmap.Assign(tiffIm);
          finally
            tiffIm.Free;
          end;
        end;
    end;
    

    See also TWICImage, which works for XP SP3 and up.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a multi-threaded Delphi 6 Pro application that I am currently working on
Currently working on a game, and is converting it to retina. I am using
I am currently working with Delphi Prism for Mono development. So, the software can
We are currently working with Delphi 2006, but we are now very ready to
I'm currently working on a program to generate the hashes of files, in Delphi
I am using Delphi 2007 and working on some presentation software. The current module
I want to develop a Web application in Delphi using VCL. I tried UniGUI,
Currently working on a 3D media engine using C# and I have come across
I'm currently working on porting an existing Delphi 5 application to Delphi 2010. It's
I am currently working on very old project, which is based on Delphi 5.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.