Thread: Bmp image appears black -- TImage in Borland C++ Builder

  1. #1
    Registered User
    Join Date
    Oct 2011
    Posts
    2

    Bmp image appears black -- TImage in Borland C++ Builder

    Hi,

    I have Borland C++ Builder 6 and develop for Windows...
    I would like to load a bitmap runtime into TImage. The user selects the file and then it should be shown via a TImage object. Using jpg images everything works just fine. Using a bmp a black rectangle appears instead of the image. (On the file system, with any image viewing tool the same image appears without problems.)

    The code is as follows:


    TPicture* picture = new TPicture;

    // I checked the following filename (debug...), it is correct
    picture->LoadFromFile( OpenPictureDialog->FileName );

    // Image is the TImage that is supposed to display the image
    Image->Picture = picture;


    Do you have any ideas?
    Thanks,
    Eszter

  2. #2
    Registered User
    Join Date
    Oct 2011
    Posts
    2
    With further investigation I found that the problem only concerns indexed bitmap images that are not supported by the Graphics class. But unfortunately, the images I have to display are indexed bitmaps.

    Do you know any good image converting classes for Borland C++ that could solve this problem?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 10-03-2006, 04:48 PM
  2. BitBlt turns entire image black?
    By SgtMuffles in forum Windows Programming
    Replies: 3
    Last Post: 05-01-2006, 03:33 AM
  3. THE END - Borland C++ Builder, Delphi, J Builder?
    By Davros in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 02-28-2006, 11:23 PM
  4. Problem with TImage in Borland C++ Builder
    By Hannes in forum Windows Programming
    Replies: 0
    Last Post: 01-16-2005, 04:59 PM
  5. Borland C++ Builder?
    By cozman in forum C++ Programming
    Replies: 7
    Last Post: 01-20-2002, 01:59 AM

Tags for this Thread