Implementation of interface color gradient effect

zhaozj2021-02-11  192

Listing Example Description: 1. Create a form, assume that its width is 500, set a button Button1, press this button to put the table as the gradient of the yellow to the left to the right. The code of the 2.Button1 button is as follows: Procedure TFORM1.BUTTON1CLICK (Sender: Tobject); VAR I, J: Integer; DCT: TRECT; Begin J: = form1.height; // Get Form Height for i: = 0 to 255 DO // Set the RGB () in the RGB () in the RGB (), a color value: = RGB (255, 255, i); // DCT: = RECT (i * 2, 0, (i 1) each time you draw rectangles ) * 2, j); // each time the rectangular area canvas.FillRect (DCT); // fill the color End;

转载请注明原文地址:https://www.9cbs.com/read-4230.html

New Post(0)