Solved

making clear areas in components

Posted on 2002-04-10
6
140 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
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
ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

 
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

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

831 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