Delphix (24) of Delphi and DirectX: tdirectdrawsurface. BLT (), bltfast ();

Source: Internet
Author: User
These two functions are not common troubles, especially BLT (); they are not completely involved at the moment. This is an example of a preliminary attempt:


Code File:
Unit unit1; interfaceuses windows, messages, sysutils, variants, classes, graphics, controls, forms, dialogs, dxdraws, stdctrls, DirectX; Type tform1 = Class (tform) dxdraw1: tdxdraw; button1: tbutton; button2: tbutton; Procedure button1click (Sender: tobject); Procedure button2click (Sender: tobject); end; var form1: tform1; implementation {$ R *. DFM} const imgpath1 = 'C: \ temp \ delphix.bmp '; imgpath2 = 'C: \ temp \ test.bmp'; Procedure tform1.button1click (Sender: tobject); var mysurface: tdirectdrawsurface DF: tddbltfx; begin mysurface: = tdirectdrawsurface. create (dxdraw1.ddraw); mysurface. loadfromfile (imgpath1); dxdraw1.surface. loadfromfile (imgpath2); df. dwsize: = sizeof (DF); df. dwddfx: = 0; dxdraw1.surface. BLT (rect (0, 0, mysurface. width Div 2, mysurface. height Div 2), mysurface. clientrect, temperature or temperature, DF, mysurface); dxdraw1.flip; freeandnil (mysurface); end; procedure temperature (Sender: tobject); var mysurface: tdirectdrawsurface; begin mysurface: = tdirectdrawsurface. create (dxdraw1.ddraw); mysurface. loadfromfile (imgpath1); dxdraw1.surface. loadfromfile (imgpath2); dxdraw1.surface. bltfast (0, 0, bounds (16, 4, trunc (mysurface. width * 0.9), trunc (mysurface. height * 0.9), ddbltfast_srccolorkey or ddbltfast_wait, mysurface); dxdraw1.flip; freeandnil (mysurface); end.
 
   
 

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.