Solved

Image.beginupdate ?

Posted on 2001-08-25
6
821 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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

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…
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

708 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

21 Experts available now in Live!

Get 1:1 Help Now