博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
使用 IntraWeb (18) - 基本控件之 TIWImage、TIWImageFile、TIWImageList
阅读量:6973 次
发布时间:2019-06-27

本文共 3499 字,大约阅读时间需要 11 分钟。

  hot3.png

TIWImage     //用于显示资源中的图片, 设计时通过 Picture 载入图片到资源TIWImageFile //用于显示给定路径或地址的图片TIWImageList //它继承于 TImageList, 一般用于图标管理, 一般也是在设计时载入图片以进入资源

TIWImage 所在单元及继承链:
IWCompExtCtrls.TIWImage < TIWDynamicImage < TIWCustomImage < TIWCustomControl < TIWBaseHTMLControl < TIWBaseControl < TIWVCLBaseControl < TControl < TComponent < TPersistent < TObject
主要成员:

property Picture: TPicture  //通过它载入图片; 设计时载入的图片会嵌入资源; 如果用它动态加载或许是为使用其更多功能, 否则不如用 TIWImageFile property TransparentColor: TIWColor  //透明色; 只对 png、gifproperty OutputType: TIWImageOutput  //输出类型(也就是最终用到 Html 的类型): ioGIF, ioJPEG, ioPNG(默认)property JpegOptions: TIWJpegOptions //当 OutputType = ioJPEG 时的更多选项(下有详注)property RenderEmptyAsSpan: Boolean  //该属性默认 True, 表示没有图片可显示时将在 Html 中呈现为 SPAN 而不是 IMGproperty AltText: string    //当图像无法显示时的替换文本property AutoSize: Boolean  //自动大小property UseSize: Boolean   //使用指定的大小property BorderOptions: TIWBorderOptions  //边框选项; 主要是 Width 和 Colorproperty Confirmation: string        //property DoSubmitValidation: Boolean //property OnClick: TNotifyEventproperty OnMouseDown: TIWImageOnMouseDownproperty OnAsyncClick: TIWAsyncEventproperty OnAsyncMouseDown: TIWAsyncEventproperty OnAsyncMouseUp: TIWAsyncEvent  {TIWJpegOptions 类的属性}  property CompressionQuality: Shortint  //压缩比率; 默认 90  property Performance: TJPEGPerformance //质量选项; jpBestQuality、jpBestSpeed(默认)  property ProgressiveEncoding: Boolean  //是否使用递增式编码(图像较大时, 从模糊到清晰); 默认 False  property Smoothing: Boolean            //是否平滑处理; 默认 True

TIWImageFile 所在单元及继承链:
IWCompExtCtrls.TIWImageFile < TIWCustomImage < TIWCustomControl < TIWBaseHTMLControl < TIWBaseControl < TIWVCLBaseControl < TControl < TComponent < TPersistent < TObject
主要成员:

property ImageFile: TIWFileReference //这是它最主要的属性; ImageFile.Filename 或 ImageFile.URLproperty Cacheable: Boolean  //是否使用缓存property AltText: string   //property AutoSize: Boolean //property UseSize: Boolean  //property BorderOptions: TIWBorderOptions //property Confirmation: string            //property DoSubmitValidation: Boolean     //property OnClick: TNotifyEventproperty OnMouseDown: TIWImageOnMouseDownproperty OnAsyncClick: TIWAsyncEventproperty OnAsyncMouseDown: TIWAsyncEventproperty OnAsyncMouseUp: TIWAsyncEvent

TIWImageList 所在单元及继承链:
IWImageList.TIWImageList < TImageList < TDragImageList < TCustomImageList < TComponent < TPersistent < TObject
主要成员:

property BkColor: TColor    //背景色property BlendColor: TColor //混合色; 在产生 DrawingStyle 需要的不同效果时需要property ColorDepth: TColorDepth  //颜色深度property DrawingStyle: TDrawingStyle //dsFocus(焦点状态)、dsNormal(正常,默认)、dsSelected(选择状态)、dsTransparent(透明)property ImageType: TImageType       //图像类型: itImage(原图像)、itMask(遮罩)property ShareImages: Boolean  //?property Masked: Boolean  //?property Count: Integer   //property Height: Integer  //property Width: Integer   //property OnChange: TNotifyEvent  //function ExtractImageToCache(AImageIndex: Integer; const ACacheType: TCacheType): string //提取到缓存, 返回路径;                                                                                           //IW.CacheStream.TCacheType 是缓存期选项, 默认 ctOneTime											 //TCacheType = (ctOneTime、ctApp、ctSession、ctForm)

示例(通过 TIWImageFile 遍历 TIWImageList 中的图片):

var i: Integer;procedure TIWForm1.IWButton1AsyncClick(Sender: TObject; EventParams: TStringList);var  imgFilePath: string;begin  imgFilePath := IWImageList1.ExtractImageToCache(i);  IWImageFile1.ImageFile.Filename := imgFilePath;  Inc(i);  if i = IWImageList1.Count then i := 0;end;

转载于:https://my.oschina.net/hermer/blog/319178

你可能感兴趣的文章
如何使用SecureCRT连接vmware下ubuntu
查看>>
从源代码制作iDempiere Server安装软件(Ubuntu Desktop 12.04 LTS 64位)
查看>>
jQuery必知必熟基础知识
查看>>
本原串
查看>>
Android ble 蓝牙4.0 总结一
查看>>
三大方案解决了Intellij IDEA 2017/2018.1.5 输入法 不跟随
查看>>
WebApi系列~StringContent与FormUrlEncodedContent
查看>>
Lind.DDD.SSO单点登陆组件的使用(原创)
查看>>
图的创建——邻接表法
查看>>
OJ错误命令解释
查看>>
Javascript的匿名函数
查看>>
python-memcached学习笔记
查看>>
最受美国年轻用户青睐的App排行榜
查看>>
C# 使用 iTextSharp 将 PDF 转换成 TXT 文本
查看>>
初学 Python(十一)——切片
查看>>
lower_bound
查看>>
Python_基础_(正表达式)
查看>>
C++字符串的输入
查看>>
Scrapy安装报错
查看>>
github开源文章生成pdf
查看>>