Board index » delphi » TImage doesn't always display, depending on computer

TImage doesn't always display, depending on computer

I have an irritating problem with an app -- it's an installer shell, and I have a pretty logo with some text (label) that scrolls
across it.  The logo is a JPEG file loaded into a TImage (at design time), which resides on a TPanel.  I put it on the TPanel and
set DoubleBuffered to True in the OnCreate proc so that my text scrolls nicely across it without flickering.  OK, enough
background...

The problem is that on *some* systems (and, of course, they're the ones at my customer's plant), when the program starts, the nice
image doesn't display at all until the text starts scrolling, and then the only part that displays is the part under the text.  This
looks goofy as hell.  It doesn't do it on any of the machines that I have here in my office (95, NT4 SP3, NT4 SP4, all P2 or P3,
350MHz and up), and it didn't do it on the one machine of theirs that I had here during initial development (NT4 SP3, P2 350MHz).

I'm using D4.03 Pro and I'm going crazy.  Any suggestions greatly appreciated.

TIA,
Doug MacLean
--
"All sorts of computer errors are now turning up. You'd be
surprised to know the number of doctors who claim they
are treating pregnant men." -- Isaac Asimov

 

Re:TImage doesn't always display, depending on computer


Doug MacLean <dmacl...@PUPUKAKAalesinc.com> schrieb in im Newsbeitrag:
3A1201A2.FC061...@PUPUKAKAalesinc.com...

Quote
> The problem is that on *some* systems (and, of course, they're the ones at

my customer's plant), when the program starts, the nice
Quote
> image doesn't display at all until the text starts scrolling, and then the

only part that displays is the part under the text.

I have found that JPEG files do odd things too in a TImage.  I find one of
these often fixes the problems

1) reduce the jpeg to 256 colors (most are stored in 16 million by default)
2) do not use stretch draw or transparent or auto size and make the TImage
just a little smaller then the JPEG dimensions (this trick often also keeps
it from flickering without having to set double buffering).
3) try to load the jpeg from a disk file in the onshow method rather then
storing it in the TImage.
4) do not know about Timage, but MS common controls dll version affects
Timagelists.
5) if all else fails, use a bitmap.  They always seem to work (but do add
quite a bit of memory to the software... solution is again to load from a
file)

Kevin

Re:TImage doesn't always display, depending on computer


Thanks for the response.  I had thought of COMCTL32.DLL, but I really hate messing with their operating system files, as I don't
take any responsibility for maintaining their systems.

I think I'll try the bitmap approach, as I don't really care if it uses more memory -- it's just an installation shell that runs off
the CD, and only occaisionally.

Doug

Quote
Ecological Software Solutions wrote:
> Doug MacLean <dmacl...@PUPUKAKAalesinc.com> schrieb in im Newsbeitrag:
> 3A1201A2.FC061...@PUPUKAKAalesinc.com...

> > The problem is that on *some* systems (and, of course, they're the ones at
> my customer's plant), when the program starts, the nice
> > image doesn't display at all until the text starts scrolling, and then the
> only part that displays is the part under the text.

> I have found that JPEG files do odd things too in a TImage.  I find one of
> these often fixes the problems

> 1) reduce the jpeg to 256 colors (most are stored in 16 million by default)
> 2) do not use stretch draw or transparent or auto size and make the TImage
> just a little smaller then the JPEG dimensions (this trick often also keeps
> it from flickering without having to set double buffering).
> 3) try to load the jpeg from a disk file in the onshow method rather then
> storing it in the TImage.
> 4) do not know about Timage, but MS common controls dll version affects
> Timagelists.
> 5) if all else fails, use a bitmap.  They always seem to work (but do add
> quite a bit of memory to the software... solution is again to load from a
> file)

> Kevin

--
"All sorts of computer errors are now turning up. You'd be
surprised to know the number of doctors who claim they
are treating pregnant men." -- Isaac Asimov

Re:TImage doesn't always display, depending on computer


Quote
Doug MacLean <dmacl...@PUPUKAKAalesinc.com> wrote in message

news:3A12A133.C2E6CD3C@PUPUKAKAalesinc.com...
Quote
> Thanks for the response.  I had thought of COMCTL32.DLL, but I really hate

messing with their operating system files,
..
Doug,
a bit of advice, just make sure they`ve got latest IE installed.

Regards,

Jack Sudarev.

Re:TImage doesn't always display, depending on computer


OK, I fixed it.  Here's an excerpt from the form declaration:

type
  TfrmMain = class(TForm);
    ...
    imgBackground: TImage;
    tmrDelay: TTimer;  // OnTimer is set to tmrDelayTimer
    ...
  end;

...and I added this stuff to the various procs:

procedure TfrmMain.FormCreate(Sender: TObject);
begin
  Application.OnActivate := AppOnActivate;
end;

procedure TfrmMain.AppOnActivate(Sender: TObject);
begin
  imgBackground.Refresh;
end;

{ This is called just once, after the app starts, to make sure that there's
  plenty of time for the app to have started and everything initialized --
  tmrDelay.Enabled is set to True at design-time.

Quote
}

procedure TfrmMain.tmrDelayTimer(Sender: TObject);
begin
  imgBackground.Refresh;
  tmrDelay.Enabled := False;
end;

Now, either the call in tmrDelayTimer or AppOnActivate is doing the trick -- I just have to determine which one it is, so I've compiled
two versions, and will test it.  I actually released
it with both calls and it works fine.  I just want to figure out if I can get away with just having
it in one place, and to see if there is any visible difference between the two different calls to
Refresh.

Thanks to all who responded!

Doug
--
"All sorts of computer errors are now turning up. You'd be
surprised to know the number of doctors who claim they
are treating pregnant men." -- Isaac Asimov

Other Threads