I. Implementation of the interface color gradient effect
The color gradient effect of the interface is achieved by refreshing adjacent rectangular blocks with a gradient. The following is an example:
1. Create a new form, assuming its width is 500, and set a button button1. Click this button to set the form to a gradient effect from yellow to white on the left to the right.
2. The code for the button1 button is as follows:
Procedure tform1.button1click (Sender: tobject );
VaR I, j: integer;
DCT: trect;
Begin
J: = form1.height;
// Obtain the form height
For I: = 0 to 255 do
// Set a color value in RGB ().
Begin
Canvas. Brush. Color: = RGB (255,255, I );
// Specifies the painting color of each rectangle.
DCT: = rect (I * 2, 0, (I + 1) * 2, J );
// The area of the rectangle to be painted each time
Canvas. fillrect (DCT );
// Fill color
End;
End;
Ii. Overall drawing pulling effect
The pull-out effect of a simple image is relatively simple. It can be achieved by dynamically changing the size of the graphic area, but the "stretch" of the image should be set to "true" in advance ".
Example:
1. Place an image on the form. The height is 200, the attribute "height" is set to 0, and the "stretch" is set to true. Add the "timer" component, set "interval" to 200, and "enable" to true.
2. Add the code to timer1timer:
Procedure tform1.timer1timer (Sender: tobject );
Begin
Image1.height: = image1.height + 20;
// Set the Increment
If image1.height = 200 then timer1.enabled: = false;
// The image is pulled out.
End;
The preceding two examples run in Windows 95 and Delphi3.0
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service