Solved

Flicker problem with TImage

Posted on 1998-03-03
9
1,039 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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
 
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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

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…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

707 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