Solved

Image.beginupdate ?

Posted on 2001-08-25
6
837 Views
Last Modified: 2010-04-06
I'm doing lot of drawing on the canvas in a image, this has the bad effect that some other images on the form flickers from time to time.
Is there a way to make it more flicker free.
I thought of LockWindowUpdate but as remember this seems to make all windows flicker.
0
Comment
Question by:bnz
6 Comments
 
LVL 33

Expert Comment

by:Slick812
ID: 6425849
I'm not sure how many times you are drawing on the image canvas, but since you said 'alot', you may want to try what's called page filpping. Whenever you draw directly on a visible canvas rapidly and a draw does NOT sync with the monitor's refresh rate you get some flicker. Try to not draw something on a part of a visible canvas. Only replace the ENTIRE image with a memory bitmap that you have drawn on. Flip a whole page to the image instead of a piece of a page. This may seem like a backwards way (more work instead of less) to do it, but it tends to sync together with the refresh rate better. Oh, a TImage has some update routines that may kick in. You may want to try a PaintBox or Do all the rapid drawing in a Rect on the Form's Canvas. If your drawing is not rapid, you could try DoubleBuffer := True;
0
 
LVL 3

Expert Comment

by:Slavak
ID: 6426002
I has the same problems with standard delphi components. Best solution I found it do NOT use it, if you want nice graphic application.
I use components from http://www.stuckindoors.com/dib/.
It solved most of my problems. The biggest disadvantage (for me) is that it cannot run in 256 colors mode.
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6426668
maybe it helps to place the timage on a tpanel
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:bnz
ID: 6426715
Slick812: I tried to create an invisible image and then paint on the real image using this code     VisibleImage.Canvas.Draw(0,0, TempImage);

It helps a bit but not much, am I doing the right thing?

Slavak: thanks for you tip, the component does not work with Delphi 6 yet, so I will way for that to come.
0
 
LVL 33

Accepted Solution

by:
Slick812 earned 100 total points
ID: 6427478
yea bnz, thats the idea, , , you did not say if you are rapidly drawing on the canvas (more that 5 changes a second or so), Like I said I think the TImage has some canvas updates that kick in when you draw on it, , I do not use a TImage EVER, to do rapid drawing on it's canvas. I use a PaintBox (you can use the canvas of a TPanel too), what you will have to add is the Bitmap drawn on it in it's OnPaint event. So it will not disapear when it is refreshed. I think the TImage was made mostly for static (NON-changing) images. I beleive it handles its canvas a little differently than other controls. I have done some very rapid page flipping on a TPaintBox without the flicker (if it's size gets Large then it will slow down for the time it takes to draw the images)
0
 

Author Comment

by:bnz
ID: 6428016
Ahh now I get it. You are right, I used a paintbox and 99% flicker free :)
0

Featured Post

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
error 1.1 400 Bad request idhttp delphi 18 87
Delphi XE10 Round Image 2 126
Making delphi communicate with a c# service 16 103
Working with hours 3 57
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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

770 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