zoukankan      html  css  js  c++  java
  • 将Imagelist里的图像复制到TCanvas上的指定区域

    function Tdmd.Draw_Image_In_Rect(C:TCanvas;R:TRect;i:integer):boolean;
    var
      tr:TRect;
    begin
        if i<ML.Count then
        begin
          if tempImage=nil then tempImage:=TBitMap.Create;
          ML.GetBitmap(i,tempimage);
          tr.Top:=R.Top+(((R.Bottom-R.Top)-24) div 2)+1;
          tr.Left:=R.Left+(((R.Right-R.Left)-24) div 2+1);
          tr.Right:=tr.Left+23;
          tr.Bottom:=tr.Top+23;
          C.CopyRect(TR,tempimage.Canvas,rect(0,0,24,24));
          result:=true;
        end else result:=false;
    end ;
                     

    图像复制方式:

    TCopyMode values describe how to combine the colors of a source bitmap and a destination bitmap.  

    The Windows unit defines the following constants for TCopyMode values:

    Value 
    Meaning 
    Fills the destination rectangle on the canvas with black.  
    Inverts the image on the canvas and ignores the source.  
    Combines the image on the canvas and the source bitmap by using the Boolean AND operator.  
    Combines the inverted source bitmap with the image on the canvas by using the Boolean OR operator.  
    Copies the inverted source bitmap to the canvas.  
    Combines the image on the canvas and the source bitmap by using the Boolean OR operator, and inverts the result.  
    Copies the source pattern to the canvas.  
    Combines the source pattern with the image on the canvas using the Boolean XOR operator  
    Combines the inverted source bitmap with the source pattern by using the Boolean OR operator. Combines the result of this operation with the image on the canvas by using the Boolean OR operator.  
    Combines the image on the canvas and source bitmap by using the Boolean AND operator.  
    Copies the source bitmap to the canvas.  
    Inverts the image on the canvas and combines the result with the source bitmap by using the Boolean AND operator.  
    Combines the image on the canvas and the source bitmap by using the Boolean XOR operator.  
    Combines the image on the canvas and the source bitmap by using the Boolean OR operator.  
    Fills the destination rectangle on the canvas with white.  

    http://blog.sina.com.cn/s/blog_56294d0a0100tnsd.html

  • 相关阅读:
    GD32E507移植FreeRTOS
    FreeRTOS学习笔记——任务基础知识
    FreeRTOS学习笔记——系统配置
    am335x WG209 wifi模块自动配置的脚本
    树莓派学习笔记——Systemd进程启动
    am335x WG209 wifi模块驱动移植
    树莓派学习笔记——搭建Samba服务端
    树莓派学习笔记——内核编译
    一个复制文件的Shell脚本
    Makefile学习笔记——Makefile通配符的使用
  • 原文地址:https://www.cnblogs.com/findumars/p/6399901.html
Copyright © 2011-2022 走看看