?
Solved

Flicker problem with TImage

Posted on 1998-03-03
9
Medium Priority
?
1,054 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
Technology Partners: 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 1200 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

Independent Software Vendors: 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!

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month12 days, 15 hours left to enroll

777 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