TBitmap对象Assign一个图像以后,目标图像的Width、Height、PixelFormat等属性也会变为和原图像一样吗?

ooolinux 2020-11-24 05:23:48
TBitmap对象Assign一个图像以后,目标图像的Width、Height、PixelFormat等属性也会变为和原图像一样吗?
如果想保留原来设置的属性,是不是只能用Canvas的Draw或者StretchDraw了?
...全文
461 3 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
ooolinux 2020-11-27
  • 打赏
  • 举报
回复
引用 1 楼 早打大打打核战争 的回复:
宽高肯定是和原图像相同的,PixelFormat则未必,可能会出现转换,15/16位格式会被转化为24位位图

老概这个问题有没有什么看法:
https://bbs.csdn.net/topics/398345212
ooolinux 2020-11-25
  • 打赏
  • 举报
回复
引用 1 楼 早打大打打核战争 的回复:
宽高肯定是和原图像相同的,PixelFormat则未必,可能会出现转换,15/16位格式会被转化为24位位图

Help都没提到这些细节,只能写程序验证,或者查看库源代码了。
Description

Copies a new bitmap image to the bitmap object.

Assign copies the bitmap image contained in Source to the bitmap object. If Source is not a bitmap, Assign calls the inherited Assign method, which can copy an image from any class that knows how to copy to a TBitmap object. If the bitmap needs to be changed, the actual bitmap image is copied before the changes are made (copy on write).

Note: An object of one type can always be assigned to another object of the same type. Also, the Source can be of type TPicture if the Graphic property of the picture is a bitmap.
  • 打赏
  • 举报
回复
宽高肯定是和原图像相同的,PixelFormat则未必,可能会出现转换,15/16位格式会被转化为24位位图

1,185

社区成员

发帖
与我相关
我的任务
社区描述
Delphi GAME,图形处理/多媒体
社区管理员
  • GAME,图形处理/多媒体社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧