Solved

Flicker problem with TImage

Posted on 1998-03-03
9
967 Views
Last Modified: 2008-02-01


If I set the Height or Width of my TImage object to be different from a bitmap
loaded into it then any drawing on the bitmap causes the whole bitmap to
flicker. This doesn't happen if the Height and Width are the same as the bitmap.

I want to do this so i can use the stretch property to zomm the image up in size.

Any ideas how to stop the flicker?

Cheers Chris
0
Comment
Question by:chrishart
  • 4
  • 4
9 Comments
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1360057
I have had a similar problem before.  Without spending a lot of time on TImage, I quickly switched to TPaintBox.  You can use TPaintBox.Canvas.StretchDraw(...) to accomplish your zooming.

JB

0
 

Author Comment

by:chrishart
ID: 1360058
Hello JimBob,

Perhaps I should have mentioned I'm using C++Builder which I guess is similar to Delphi 2. Is TPaintBox a Delphi 3 enhancement?

Thanks Chris.
0
 
LVL 5

Expert Comment

by:JimBob091197
ID: 1360059
Hi

TPaintBox exists in Delphi 2 & Delphi 3 (and Delphi 1).  It is on the "System" component tab (same tab as TTimer in Delphi).

Regards,
JB
0
 

Author Comment

by:chrishart
ID: 1360060
Hello JimBob,

Thanks for your patience! I have started to use TPaintBox and it feels faster and better. Thanks.

I have noticed, however, that if another window moves across it, it does not get refreshed and chunks can get missing. Is there an easy way to keep it refreshed automatically?

Cheers Chris.

BTW I think you should get the points for this!
0
Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

 
LVL 5

Expert Comment

by:JimBob091197
ID: 1360061
Hi Chris

When another window moves in front of the paintbox, the paintbox's OnPaint *should* be fired, which allows the paintbox to be redrawn.  Is your OnPaint event not working 100%?

JB
0
 
LVL 3

Expert Comment

by:williams2
ID: 1360062
You could overwrite TImage's Update method, by it's usual code and an bit of code testing for Vertical Blank event, or you could code a function waiting for the VBlank update, and then resize the Image, BUT it's not working all time, since the way pictures may be updated is not similar in hardware (I've have been testing it with VGA only!) ..I'll have to look up some code first.
0
 

Author Comment

by:chrishart
ID: 1360063
Thanks for your comments williams2, however I have just got JimBobs PaintBox suggestion to work and its seems fine! But thank you for the alternative.

JimBob if you turn your comment into an answer I would be pleased to award you the points.

Thnaks again that was invaluable help

Cheers Chris
0
 
LVL 5

Accepted Solution

by:
JimBob091197 earned 300 total points
ID: 1360064
Hi Chris,
Glad the PaintBox works for you.

Regards,
JB
0
 

Author Comment

by:chrishart
ID: 1360065
Thanks again for the guiding me through this!

Chris
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
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…
This video discusses moving either the default database or any database to a new volume.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

759 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

13 Experts available now in Live!

Get 1:1 Help Now