Solved

making clear areas in components

Posted on 2002-04-10
6
137 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
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

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…
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…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

708 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now