我有一个缩略图,它扫描给定目录并为它找到的图像文件生成缩略图.
我有加载其匹配允许的文件扩展名,我觉得图像(一个很好的通用的方式bmp,jpg,png等),但......我想写的所有缩略图文件作为png.
我不知道的是如何在没有扩展名的情况下方便地提取文件名并.png在输出我的图像之前粘贴到最后...
For Each File In SourceFileList
Dim FileInfo = New FileInfo(File)
Dim ThumbFilename = String.Format("{0}\Thumb_{1}", TargetDir, FileInfo.Name) '<-- How do I set the correct name here?
Dim Thumb = Thumbnailer.Thumbnail(FileInfo.FullName, 100)
Thumb.Save(ThumbFilename, Imaging.ImageFormat.Png)
Next
Run Code Online (Sandbox Code Playgroud)
我知道我可以使用Split和各种其他字符串操作,但所有看起来都有点笨重.这样做有最佳实践方法吗?什么东西System.IO?
(10年前,我从未想过split会太笨重 - 时代变了!)
| 归档时间: |
|
| 查看次数: |
143 次 |
| 最近记录: |