Delphix (25) of Delphi and DirectX: tdib. Blur ();

Source: Internet
Author: User
On the component panel of delphix, the second is tdxdib;

Tdxdib. DiB is the unique attribute of tdxdib (others are inherent in tcomponent );

The tdxdib. Dib attribute is a tdib object;

Tdib and tbitmap both inherit from tgraphic directly. They are an image container and have an alias: tdibitmap;

Tdib and tdxdraw. Surface and tdximagelist have similar features (tpicturecollectionitem), but they are more powerful.

The uses Dib unit is required to use tdib;
However, if the tdxdib component is added, the dib unit is automatically added and images can be loaded at design fashion.

In this example, the fuzzy image function of tdib is tested as follows:


Code File:
Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, Dib, dxdraws, stdctrls; Type tform1 = Class (tform) dxdraw1: tdxdraw; dxdib1: Taobao; button1: tbutton; button2: tbutton; button3: tbutton; button4: tbutton; Procedure button1click (Sender: tobject); Procedure button2click (Sender: tobject ); procedure button3click (Sender: tobject); Procedure button4click (Sender: tobject); end; var form1: tform1; implementation {$ R *. DFM} const imgpath1 = 'C: \ temp \ delphix.bmp '; Procedure tform1.button1click (Sender: tobject); begin dxdraw1.surface. loadfromfile (imgpath1); dxdraw1.flip; end; Procedure tform1.button2click (Sender: tobject); begin dxdib1.dib. loadfromfile (imgpath1); dxdib1.dib. blur (32, 1); dxdraw1.surface. loadfromdib (dxdib1.dib); dxdraw1.flip; end; Procedure tform1.button3click (Sender: tobject); begin dxdib1.dib. loadfromfile (imgpath1); dxdib1.dib. blur (32, 6); dxdraw1.surface. loadfromdib (dxdib1.dib); dxdraw1.flip; end; Procedure tform1.button4click (Sender: tobject); begin dxdib1.dib. loadfromfile (imgpath1); dxdib1.dib. blur (4, 2); dxdraw1.surface. loadfromdib (dxdib1.dib); dxdraw1.flip; end.
 
   
 

Form file:

Object form1: tform1 left = 0 Top = 0 caption = 'form1' clientheight = 151 clientwidth = 280 color = clbtnface font. charset = default_charset font. color = clwindowtext font. height =-11 font. name = 'tahoma 'font. style = [] oldcreateorder = false pixelsperinch = 96 textheight = 13 object dxdraw1: tdxdraw left = 8 Top = 8 width = 265 Height = 105 autoinitialize = true autosize = true color = clblack display. fixedbitcount = false display. fixedratio = true display. fixedsize = true Options = [doallowreboot, dowaitvblank, docenter, do3d, dodirectx7mode, dohardware, doselectdriver] surfaceheight = 105 surfacewidth = 265 taborder = 0 traces = end object button1: tbutton left = 8 Top = 119 width = 60 Height = 25 caption = 'button1' taborder = 1 onclick = button1click end object button2: tbutton left = 76 Top = 119 width = 60 Height = 25 caption = 'button2' taborder = 2 onclick = button2click end object button3: tbutton left = 144 Top = 119 width = 60 Height = 25 caption = 'button3' taborder = 3 onclick = button3click end object button4: tbutton left = 213 Top = 119 width = 60 Height = 25 caption = 'button4' taborder = 4 onclick = button4click end object dxdib1: tdxdib left = 240 Top = 16 endend
 
  
 

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.