Solved

Differences in D4 and D6 TImage component?  Getting flicker in D6.

Posted on 2004-04-02
3
260 Views
Last Modified: 2010-04-05
I have an application that I wrote in Delphi 4 a few years ago.  It generates a Mandelbrot image and displays the image as it's rendered.  I recompiled under Delphi 6, and now the TImage component flickers like crazy while it displays.  This is extremely annoying.  What changed between these two version to cause this?

Here is the code in the main loop:

  for i := 0 to iMandel.Height do
  begin
    for r := 0 to iMandel.Width do
    begin
      iMandel.Picture.Bitmap.Canvas.Pixels[r, i] :=
        ChooseColor(MandelComputeAndTest(MinX + (r * deltaR), MinY + (i * deltaI)));
    end;
    iMandel.Refresh;
    Application.ProcessMessages;
    if StopRender then
      Break;
  end;

iMandel in the TImage component.
MandelComputeAndTest computes a value for the point passed in.
ChooseColor maps that returned value into a color.

I tried commenting out the "iMandel.Refresh" and the "Application.ProcessMessages".  Neither of these stopped the flicker.

I just tried Delphi 7 and it doesn't flicker.  However, I prefer D6 to D7, so if anyone can help I would greatly appreciate it.

Thanks
0
Comment
Question by:edsteele
3 Comments
 
LVL 26

Expert Comment

by:Russell Libby
ID: 10746223
I have a feeling (based on the following link), that Delphi6 will need the  DoubleBuffered property set to True for the image's parent:

see:

http://www.delphiforfun.org/Programs/Delphi_Techniques/Testing_Delphi_Versions.htm

Try setting the TImage's parent (normally the form) DoubleBuffered property to True, and then run the test.

-----------------------

Hope this helps,
Russell


0
 
LVL 11

Accepted Solution

by:
ZhaawZ earned 250 total points
ID: 10746528
You can also try to set iMandel.Stretch to True
0
 
LVL 1

Author Comment

by:edsteele
ID: 10752058
Setting the DoubleBuffered property to true actually made things worse.

However, setting Stretch to true fixed it.  I'm a little perplexed as to why that would help.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

828 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question