Solved

Flicker problem with TImage

Posted on 1998-03-03
9
1,018 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 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Convert a string into a TDateTime 5 72
Multiple image collision 13 88
creating threads in delphi 1 163
Performance of SQL statement 37 137
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…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

733 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