Solved

making clear areas in components

Posted on 2002-04-10
6
144 Views
Last Modified: 2010-04-04
People,

I am writing a component which requires the image drawn on the form (owners) canvas to be seen through areas. I have neem using the canvas.copyrect function though this requires that the form be repainted with the component set to invisible then made visible again. Obviously the form flickers like mad. Any suggestions on making this appear flicker free.
0
Comment
Question by:bobspencerr
[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
6 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 25 total points
ID: 6931151
setting the doublebuffered-property of the form to true may help a bit
0
 
LVL 11

Assisted Solution

by:robert_marquardt
robert_marquardt earned 25 total points
ID: 6931155
You want a TImage with holes to see through?
Set the Transparent property.
Check Image.Picture.Bitmap properties for the transparency details.
There is also a simple way to make a TImage descendant where the transparent areas are "outside" the control.
0
 
LVL 9

Assisted Solution

by:ginsonic
ginsonic earned 25 total points
ID: 6931530
Whay do this ?
Create two bitmap .
Copy the form area into first bitmap .
Create your component image into second . Mix this two bitmaps and then the final bitmap will be paint into your component canvas .

I use this trick to create semi-transparent components .
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!

 
LVL 6

Assisted Solution

by:Stuart_Johnson
Stuart_Johnson earned 25 total points
ID: 6933032
Set the component's canvas.brush.style to bsClear.  This will allow you to see through the component to the form.  Then, set the image's transparent property to true.  Transparencies work by "deleting" all pixels within the image that are the same colour as the bottom left hand pixel.  You can override this by setting the bitmaps' TransparentColor property to another colour if you wish.

Stu

0
 

Author Comment

by:bobspencerr
ID: 6938891
I have set the image property to doublebuffer, Created a second bitmap and use bitblt to paint to the original and use the invalidaterect function to limit the repaint region. All of this has made the component load fantastically and achieves what I was aiming for. However, the refresh rate of the region is now slow when the mouse moves over it. I only collect the x and the y in this section of code and then draw a line from a point specified toi the new point. It is quite noticible that there is a small delay in the speed of the mouse pointer. Any other suggestions??
0
 
LVL 1

Expert Comment

by:pnh73
ID: 9003069
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Split between kretzschmar and robert_marquardt and ginsonic and Stuart Johnson

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Paul (pnh73)
EE Cleanup Volunteer
0

Featured Post

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!

Question has a verified solution.

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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
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: …

695 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