Delphi 2010中单击缩略图时如何成像
我是delphi的新手,我正在编写一个根本没有记录的代码。所以我们决定重做编码,而我是我们团队中唯一的人。没有人知道如何用 Delphi 编写代码。我的要求是这样的。
例如,我想为图像创建缩略图,让我们采用一个填充红色的矩形并将其显示在主窗体中。用户单击该缩略图,当用户单击显示区域中的任意位置时,该对象应该出现。有人可以给我一些提示或链接来继续此操作吗?这真的很有帮助。
I am new to delphi and I am working on a code which is not at all documented. So we decided to redo the coding and I am the only one in my team. Nobody knows how to code in Delphi. My requirement is something like this.
I want to create a thumbnail for an image for instance lets take a rectangle filled with red and display it in the main form. The user clicks this thumbnail and when user clicks anywhere in the display area this object should appear. Can someone give me some hints or link to proceed with this? It would be really helpful.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要在缩略图和主图像之间建立一些连接。
让我假设您将主图像存储在文件系统中。
如果所有缩略图的大小相同,则将它们存储在
图像列表
中是有意义的。查看图像的常用控件是 ListView。
这里是 DFM 文件的文本:
您需要将一些图像添加到
imagelist
这些图像将显示在 ListView 中。单击列表视图中的项目将触发事件并在
TImage
中显示图像。You would need to make some connection between the thumbnails and the main image.
Let me assume you have the main images stored in the filesystem.
If all your thumbnails are the same size, it makes sense to store them in a
imagelist
.A common control to view Images is the ListView.
Here the text for the DFM file:
You would need to add some images to the
imagelist
These will be shown in the ListView.Clicking on an item in the listview will trigger the event and show the image in the
TImage
.