Solved

making clear areas in components

Posted on 2002-04-10
6
139 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
PDF library for Delphi 2 104
creating manifest for my dll that called from activex 6 98
delphi exception 7 61
Convert MS Word document to a PDF file 9 60
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
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…

932 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

11 Experts available now in Live!

Get 1:1 Help Now