MFC 选定文件信息
我正在尝试创建一个 MFC 应用程序,其中用户可以从文件浏览器面板(如 Windows 资源管理器中的左侧面板,但也显示文件)中选择一个文件,并且可以显示和编辑有关该文件的信息(同样,类似于 Windows 7 的资源管理器底部面板中显示的信息)。相关文件将是不同类型的图像(尽管目前仅使用 .bmp)。
我已经使用 CMFCShellTreeCtrl 创建了一个文件浏览器,现在需要让程序检查浏览器面板中选定(突出显示/单击)的文件是否是图像,如果是,则检索各种信息(例如图像大小、尺寸、名称、位置等),并将其传递到其他地方,以便我可以在文本字段中显示此信息。这可能吗?如果可以,我将如何去做?
如果我需要更具体,请告诉我,我会尽力提供所需的信息。
I'm trying to create an MFC application wherein the user can select a file from a file browser panel (like the left panel in windows explorer, but showing files as well), and information about that file can be displayed and edited (Again, similar to the information displayed in windows 7's explorer bottom panel). The files in question are going to be images of varying types (though for the time being only .bmp will be used).
I have created a file browser using CMFCShellTreeCtrl
, and now need to get the program to check if the selected (highlighted/ clicked on) file in the browser panel is an image, and if so, retrieve various information (e.g. image size, dimensions, name, location, etc.), and pass it somewhere else so that I can display this information in text fields. Is this possible, and if so, how would I go about doing it?
If I need to be more specific, let me know and I'll try to provide the information requested.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
为此,您需要使用一些图像库。由于您正在使用 MFC,因此 GDI+ 看起来是一个不错的选择。从这里开始: http://msdn.microsoft .com/en-us/library/ms533814%28v=VS.85%29.aspx
You need to use some imaging library for this. Since you are working with MFC, GDI+ looks like a good candidate. Start from here: http://msdn.microsoft.com/en-us/library/ms533814%28v=VS.85%29.aspx