使用 IntraWeb (18) - 基本控件之 TIWImage、TIWImageFile、TIWImageList
基本 控件 18 使用 IntraWeb
2023-09-11 14:20:42 时间
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、gif property OutputType: TIWImageOutput //输出类型(也就是最终用到 Html 的类型): ioGIF, ioJPEG, ioPNG(默认) property JpegOptions: TIWJpegOptions //当 OutputType = ioJPEG 时的更多选项(下有详注) property RenderEmptyAsSpan: Boolean //该属性默认 True, 表示没有图片可显示时将在 Html 中呈现为 SPAN 而不是 IMG property AltText: string //当图像无法显示时的替换文本 property AutoSize: Boolean //自动大小 property UseSize: Boolean //使用指定的大小 property BorderOptions: TIWBorderOptions //边框选项; 主要是 Width 和 Color property Confirmation: string // property DoSubmitValidation: Boolean // property OnClick: TNotifyEvent property OnMouseDown: TIWImageOnMouseDown property OnAsyncClick: TIWAsyncEvent property OnAsyncMouseDown: TIWAsyncEvent property 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.URL property Cacheable: Boolean //是否使用缓存 property AltText: string // property AutoSize: Boolean // property UseSize: Boolean // property BorderOptions: TIWBorderOptions // property Confirmation: string // property DoSubmitValidation: Boolean // property OnClick: TNotifyEvent property OnMouseDown: TIWImageOnMouseDown property OnAsyncClick: TIWAsyncEvent property OnAsyncMouseDown: TIWAsyncEvent property 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;
相关文章
- EasyMvc入门教程-基本控件说明(5)小图标
- EasyMvc入门教程-基本控件说明(2)定时器
- EasyMvc入门教程-基本控件说明(12)栏目导航
- EasyMvc入门教程-基本控件说明(10)图片轮播导航
- 3.1.6 基本分页存储管理的基本概念
- 大数据与机器学习:实践方法与行业案例.1.1 数据的基本形态
- netstat 的基本使用
- es6入门6--数组拓展运算符,Array.from()基本用法
- 《Python面向对象编程指南》——第2章 与Python无缝集成——基本特殊方法 2.1 __repr__()和__str__()方法
- 《HTML CSS JavaScript 网页制作从入门到精通 第3版》—— 第02章 HTML基本标记
- 算法入门到进阶(二)——STL和基本数据结构(队列和链表)
- 使用Duilib开发Windows软件(2)——控件的基本介绍
- GUI的基本组成----Android GWES之基本原理篇
- 《从问题到程序:用Python学编程和计算》——第3章 基本编程技术 3.1 循环程序设计
- Android 基本控件
- 【数字IC验证快速入门】15、SystemVerilog学习之基本语法2(操作符、类型转换、循环、Task/Function...内含实践练习)
- 使用 IntraWeb (25) - 基本控件之 TIWRegion
- 使用 IntraWeb (24) - 基本控件之 TIWFileUploader、TIWFile
- 使用 IntraWeb (17) - 基本控件之 TIWRadioButton、TIWRadioGroup、TIWCheckBox
- 使用 IntraWeb (14) - 基本控件之 TIWHRule、TIWRectangle
- Android中ExpandableListView控件基本使用
- 电子电路设计基本概念100问(二)【学习目标:原理图、PCB、阻抗设计、电子设计基本原则、基本原器件等】
- Direct2D教程II——绘制基本图形和线型(StrokeStyle)的设置详解
- python界面Tkinter编程(基本控件介绍及使用)