Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-04-02
3
Medium Priority
?
265 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 1000 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

916 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