?
Solved

making clear areas in components

Posted on 2002-04-10
6
Medium Priority
?
146 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 100 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 100 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 100 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 6

Assisted Solution

by:Stuart_Johnson
Stuart_Johnson earned 100 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

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses
Course of the Month13 days, 10 hours left to enroll

800 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