Solved

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

Posted on 2004-04-02
3
258 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

920 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now