Solved

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

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
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, fr…

815 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

11 Experts available now in Live!

Get 1:1 Help Now