Solved

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

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
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…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

744 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

14 Experts available now in Live!

Get 1:1 Help Now