In this example:
Code File:
Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, Dib, stdctrls; Type tform1 = Class (tform) dxpaintbox1: bytes; button1: tbutton; button2: tbutton; button3: tbutton; Procedure button1click (Sender: tobject); Procedure destroy (Sender: tobject); end; var form1: tform1; implementation {$ R *. DFM} procedure tform1.button1click (Sender: tobject); const imgpath1 = 'C: \ temp \ dx.jpg '; begin dxpaintbox1.dib. loadfromfile (imgpath1); dxpaintbox1.width: = dxpaintbox1.dib. width; dxpaintbox1.height: = dxpaintbox1.dib. height; dxpaintbox1.repaint; end; Procedure tform1.button2click (Sender: tobject); begin dxpaintbox1.dib. darker (130); dxpaintbox1.repaint; end; Procedure tform1.button3click (Sender: tobject); begin dxpaintbox1.dib. lighter (110); dxpaintbox1.repaint; end.