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

将Imagelist里的图像复制到TCanvas上的指定区域的更多相关文章

  1. opencv中的图像复制、保存和显示

    接下来几天会写一个opencv的基础系列,与各位相互学习! &1 图像操作 声明图像指针:IplImage* 读入图像: cvLoadImage 创建图像:cvCreateImage 复制图像 ...

  2. 转JS--通过按钮直接把input或者textarea里的值复制到粘贴板里

    document.activeElement属性为HTML 5中新增的document对象的一个属性,该属性用于返回光标所在元素.当光标未落在页面中任何元素内时,属性值返回body元素. setSel ...

  3. canvas上的像素操作(图像复制,细调)

    canvas上的像素操作(图像复制,细调) 总结 1.操作对象:ImageData 对象,其实是canvas的像素点集合 2.主要操作: var obj=ctx.getImageData(0,0,10 ...

  4. Winform中实现ZedGraph曲线图的图像复制到剪切板、打印预览、获取图片并保存、另存为的功能

    场景 Winforn中设置ZedGraph曲线图的属性.坐标轴属性.刻度属性: https://blog.csdn.net/BADAO_LIUMANG_QIZHI/article/details/10 ...

  5. 如何在Web页面里使用高拍仪扫描上传图像

    如何在Web页面里使用高拍仪扫描上传图像 市场上所有的高拍仪都支持扫描图片并保存到本地,一般公司都会提供控件.开发人员只需要在页面集成就可以进行拍照和扫描.只不过一般扫描的图片是保存在本地固定的文件夹 ...

  6. 将 windows 目录结构 复制到 linux 上

    思路:生成目录结构文件,复制到linux上,然后建立每个文件即可 借助unix_utils( https://sourceforge.net/projects/unxutils/) 1. window ...

  7. Android捕捉图像后在SurfaceView上变形显示问题的处理

    我们在Android中经常会使用SurfaceView编写自定义的摄像头,可是有的时候会经常会出现图像的变形,我们就会很郁闷的问这到底是为什么呢?其实这个最根本的原因是SurfaceView和PreV ...

  8. Halcon从某一个图片以指定区域绘制到另一个图像

    ************************************************************* * Halcon从某一个图片以指定区域绘制到另一个图像 * Author: ...

  9. 自绘实现半透明水晶按钮(继承CButton,设置BS_OWNERDRAW风格,覆盖DrawItem函数绘制按钮,把父窗口的背景复制到按钮上,实现视觉上的透明,最后通过AlphaBlend实现半透明)

    运行效果 实现方法 1.给按钮加上BS_OWNERDRAW样式2.重载DrawItem函数,在这里绘制按钮3.关键之处就是把父窗口的背景复制到按钮上,实现视觉上的透明4.最后通过AlphaBlend实 ...

随机推荐

  1. Java易混点记录

    1.Java 默认将所有成员变量和成员方法与 this 关联在一起,因此使用 this 在某些情况下是多余的. 2.只要类存在,程序就可以访问该类的类变量,语法如下: 类.类变量. 只要实例存在,程序 ...

  2. 桌面程序的其他实现方式----使用WPF窗体展现网页

    需求 在WPF应用程序中,需要使用到WEB项目的资源,第一时间想到的就是在WPF窗口中,展现WEB项目中的页面,这样子有两点好处:一是,实现简单,不需要在WPF应用程序中实现UI布局和数据绑定:二是, ...

  3. YII2.0多条件查询升级版

    $query = self::find()->andFilterWhere(['v_type' => $v_type])->andFilterWhere(['like', 'a_na ...

  4. visual studio 编译器在辨异 C/C++ 程序时的注意事项

    1. 数组大小的限制 visual studio 对数组的维数(元素的个数)没有限制,但要求数组的 size (sizeof() 后的结果,所占内存的大小)不得超过 0x7fff ffff = 2^3 ...

  5. js之美

    http://fxck.it/post/72326363595 大部分脚本语言里字面量都要快一些,因为解析[]比解析new Array()步骤少的多 关于Object可以用constructor注入的 ...

  6. Android系统联系人全特效实现(下),字母表快速滚动

    在上一篇文章中,我和大家一起实现了类似于Android系统联系人的分组导航和挤压动画功能,不过既然文章名叫做<Android系统联系人全特效实现>,那么没有快速滚动功能显然是称不上&quo ...

  7. 记一次由于缓存导致的bug

    bug描述 有一张数据库表存储的是 值日员工信息,有时候可能一次性录入1个月的数据.有时候也可能隔了很多天没有录入数据,也就是说这个录数据不是很规律. bug现象:测试人员发现,网站上三亚地区能正常显 ...

  8. ude—基于udp的全双工可靠传输协议

    ude是一款基于udp的可靠传输协议,专门用于在数据传输方面对实时性要求较高的应用领域.    tcp协议虽然能保证数据的可靠传输,但它有以下几个缺点:1.tcp的数据确认机制会导致发送方重复发送一些 ...

  9. 探索jquery方法中empty,remove与detach的区别

    最近一直疑惑此三种方法的具体区别在于何处,随即想弄明白其具体的区别,看了一些说明,也依照官方文档,终于把这三个方法弄明白了,果然功夫不负有心人,继续努力. 上正文,先简单介绍下这三种方法 .empty ...

  10. Python多线程 简明例子

    综述   多线程是程序设计中的一个重要方面,尤其是在服务器Deamon程序方面.无论何种系统,线程调度的开销都比传统的进程要快得多. Python可以方便地支持多线程.可以快速创建线程.互斥锁.信号量 ...