Delphi XE5 for android 使用 BITMAP STYLE DESIGNER 改变控件背景

 一、BITMAP STYLE DESIGNER

    工具集成在IDE开发工具的TOOLS菜单。

 

 

使用NEW 新建一个安卓样式。NEW—NEW ANDROID STYLE FOR FIREMONKEY。

这里我们改变edit的背景

在OBJECTS树找到EDIT

 

点击左侧OBJCEBTS的ITmap,然后在右侧的INSPECTOR中改变背景的bitmap

 选择:

空白。

方法是 :鼠标左键选择,然后鼠标右键选择。确定白色区域。最后按[APPLY]

选择保存就形成了一个自定义的EDIT的STYLE样式文件。其他未改变的属性都是控件的默认属性。

二、在form中

  

拖进一个STYLEBOOK

将FORM的STYLEBOOK定义为这个STYLEBOOK1。

三、导入样式文件

双击STYLEBOOK,把刚才自定义的样式文件[LOAD],然后【apply and close】

   

至此,一个自定义背景的EDIT已经形成。编译的时候,样式文件自动打包了。

转载于:https://www.cnblogs.com/happyhills/p/3674900.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是使用 Delphi-OpenCV 库在 Delphi XE 中将 IplImage 对象转换为Bitmap 对象的详细代码: ```delphiuses OpenCV_Core, OpenCV_ImageProc, // Delphi-OpenCV 库单元 Vcl.Graphics; // VCL 图形单元 function IplImageToBitmap(const Image: pIplImage): TBitmap; var Depth, Channels: Integer; LineSize: Integer; ImageData, SrcLine, DestLine: Pointer; Bitmap: TBitmap; Row, Col: Integer; Data: Byte; begin Depth := Image.depth; Channels := Image.nChannels; LineSize := Image.width * Channels; // 分配 Bitmap 对象 Bitmap := TBitmap.Create; Bitmap.PixelFormat := pf24bit; Bitmap.Width := Image.width; Bitmap.Height := Image.height; // 按行遍历 IplImage 数据并转换为 TBitmap 数据 ImageData := Image.imageData; for Row := 0 to Image.height - 1 do begin SrcLine := ImageData + Row * Image.widthStep; DestLine := Bitmap.ScanLine[Row]; case Depth of IPL_DEPTH_8U: begin for Col := 0 to Image.width - 1 do begin Data := PByte(SrcLine + Col * Channels)^; PByte(DestLine + Col * 3)^ := Data; PByte(DestLine + Col * 3 + 1)^ := Data; PByte(DestLine + Col * 3 + 2)^ := Data; end; end; IPL_DEPTH_8S: begin for Col := 0 to Image.width - 1 do begin Data := Byte(PShortInt(SrcLine + Col * Channels)^); PByte(DestLine + Col * 3)^ := Data; PByte(DestLine + Col * 3 + 1)^ := Data; PByte(DestLine + Col * 3 + 2)^ := Data; end; end; IPL_DEPTH_16U: begin for Col := 0 to Image.width - 1 do begin Data := Byte(PWord(SrcLine + Col * Channels)^ shr 8); PByte(DestLine + Col * 3)^ := Data; PByte(DestLine + Col * 3 + 1)^ := Data; PByte(DestLine + Col * 3 + 2)^ := Data; end; end; IPL_DEPTH_16S: begin for Col := 0 to Image.width - 1 do begin Data := Byte(PShortInt(SrcLine + Col * Channels)^ shr 8 + 128); PByte(DestLine + Col * 3)^ := Data; PByte(DestLine + Col * 3 + 1)^ := Data; PByte(DestLine + Col * 3 + 2)^ := Data; end; end; IPL_DEPTH_32S: begin for Col := 0 to Image.width - 1 do begin Data := Byte(PInteger(SrcLine + Col * Channels)^ shr 24); PByte(DestLine + Col * 3)^ := Data; PByte(DestLine + Col * 3 + 1)^ := Data; PByte(DestLine + Col * 3 + 2)^ := Data; end; end; IPL_DEPTH_32F: begin for Col := 0 to Image.width - 1 do begin Data := Byte(PSingle(SrcLine + Col * Channels)^ * 255); PByte(DestLine + Col * 3)^ := Data; PByte(DestLine + Col * 3 + 1)^ := Data; PByte(DestLine + Col * 3 + 2)^ := Data; end; end; IPL_DEPTH_64F: begin for Col := 0 to Image.width - 1 do begin Data := Byte(PDouble(SrcLine + Col * Channels)^ * 255); PByte(DestLine + Col * 3)^ := Data; PByte(DestLine + Col * 3 + 1)^ := Data; PByte(DestLine + Col * 3 + 2)^ := Data; end; end; end; end; Result := Bitmap; end; ``` 使用方法: ```delphi var Image: pIplImage; Bitmap: TBitmap; begin // 加载图像到 Image 变量中 Image := cvLoadImage('image.jpg'); // 将 IplImage 对象转换为 TBitmap 对象 Bitmap := IplImageToBitmap(Image); // 将 TBitmap 对象显示在 TImage 组件上 Image1.Picture.Assign(Bitmap); // 释放 IplImage 对象内存 cvReleaseImage(@Image); end; ``` 需要注意的是,由于 Delphi-OpenCV 库中的 IplImage 对象是指针类型的,因此需要传入指针的指针作为参数。在使用完毕后,需要手动释放 IplImage 对象的内存。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值