Windows phone 8 如何以不同的分辨率生成瓷砖、闪屏等的位图?

Windows phone 8 如何以不同的分辨率生成瓷砖、闪屏等的位图?,windows-phone-8,windows-runtime,windows-phone-8.1,windows-phone,win-universal-app,Windows Phone 8,Windows Runtime,Windows Phone 8.1,Windows Phone,Win Universal App,在Windows8/10/Phone项目中,您应该以不同的分辨率提供瓷砖、闪屏和商店标识的资产。我有一个基于矢量的图标。我能不能不用手动操作就从中生成所需的所有内容?我就是这样解决的。我使用Inkscape绘制图标,使用InkscapeBatch()生成位图。为此,我有三个版本的图标: logo.svg–尺寸为36x36。用于大多数瓷砖 logo_high.svg–尺寸36x60。用于Windows Phone中的启动屏幕 logo_wide.svg–尺寸为74.4x36。用于启动屏幕和宽瓷砖

在Windows8/10/Phone项目中,您应该以不同的分辨率提供瓷砖、闪屏和商店标识的资产。我有一个基于矢量的图标。我能不能不用手动操作就从中生成所需的所有内容?

我就是这样解决的。我使用Inkscape绘制图标,使用InkscapeBatch()生成位图。为此,我有三个版本的图标:

  • logo.svg–尺寸为36x36。用于大多数瓷砖
  • logo_high.svg–尺寸36x60。用于Windows Phone中的启动屏幕
  • logo_wide.svg–尺寸为74.4x36。用于启动屏幕和宽瓷砖
只要比例正确,文档大小就不重要

在与svg文件相同的文件夹中,我有一个InkscapeBatch文件(.idp),它发挥了神奇的作用

在我的绘画中,我在Inkscape中使用了黑色。当我使用命令
Replace fill:#000000;生成位图时,我将用白色替换黑色;填充不透明度:1;填充:#FFFFFF;填充不透明度:1在下面的脚本中

这些是我正在使用的脚本。请注意,这些脚本以您可能不需要的所有分辨率和大小生成位图。还要注意,我使用的文件名与原始文件名略有不同

Windows 8.1 Windows Phone 8.1 视窗10 我已在Github上发布了针对Windows 10的解决方案:


这与上面针对Windows 8.1的解决方案非常相似,但首先需要使用一些模板。这些应该遵循微软的指导方针。

在搜索必要的光栅化资产解决方案时,你在谷歌上搜索了哪些短语?我不记得了。但不管怎样,我都没有找到任何完整的解决方案。
PathClear true
FileFormat png
FilePrefix
ExportBackground

// Convert
PathExport '.\windowsstore'

ExportArea canvas
FileSvg '.\logo.svg'

// Replace black color with white color
Replace fill:#000000;fill-opacity:1; fill:#FFFFFF;fill-opacity:1;



FileName 'LogoSquare30x30.targetsize-16'
ExportWidth 16
ExportHeight 16
Convert

FileName 'LogoSquare30x30.targetsize-32'
ExportWidth 32
ExportHeight 32
Convert

FileName 'LogoSquare30x30.targetsize-48'
ExportWidth 48
ExportHeight 48
Convert

FileName 'LogoSquare30x30.targetsize-256'
ExportWidth 256
ExportHeight 256
Convert

FileName 'LogoSquare30x30.scale-80'
ExportWidth 24
ExportHeight 24
Convert

FileName 'LogoSquare30x30.scale-100'
ExportWidth 30
ExportHeight 30
Convert

FileName 'LogoSquare30x30.scale-140'
ExportWidth 42
ExportHeight 42
Convert

FileName 'LogoSquare30x30.scale-180'
ExportWidth 54
ExportHeight 54
Convert



FileName 'LogoSquare70x70.scale-80'
ExportWidth 56
ExportHeight 56
Convert

FileName 'LogoSquare70x70.scale-100'
ExportWidth 70
ExportHeight 70
Convert

FileName 'LogoSquare70x70.scale-140'
ExportWidth 98
ExportHeight 98
Convert

FileName 'LogoSquare70x70.scale-180'
ExportWidth 126
ExportHeight 126
Convert



FileName 'LogoSquare150x150.scale-80'
ExportWidth 120
ExportHeight 120
Convert

FileName 'LogoSquare150x150.scale-100'
ExportWidth 150
ExportHeight 150
Convert

FileName 'LogoSquare150x150.scale-140'
ExportWidth 210
ExportHeight 210
Convert

FileName 'LogoSquare150x150.scale-180'
ExportWidth 270
ExportHeight 270
Convert



FileName 'LogoSquare310x310.scale-80'
ExportWidth 248
ExportHeight 248
Convert

FileName 'LogoSquare310x310.scale-100'
ExportWidth 310
ExportHeight 310
Convert

FileName 'LogoSquare310x310.scale-140'
ExportWidth 434
ExportHeight 434
Convert

FileName 'LogoSquare310x310.scale-180'
ExportWidth 558
ExportHeight 558
Convert



FileName 'StoreLogo.scale-100'
ExportWidth 50
ExportHeight 50
Convert

FileName 'StoreLogo.scale-140'
ExportWidth 70
ExportHeight 70
Convert

FileName 'StoreLogo.scale-180'
ExportWidth 90
ExportHeight 90
Convert



FileSvg '.\logo_wide.svg'

// Replace black color with white color
Replace fill:#000000;fill-opacity:1; fill:#FFFFFF;fill-opacity:1;



FileName 'LogoWide310x150.scale-80'
ExportWidth 248
ExportHeight 120
Convert

FileName 'LogoWide310x150.scale-100'
ExportWidth 310
ExportHeight 150
Convert

FileName 'LogoWide310x150.scale-140'
ExportWidth 434
ExportHeight 210
Convert

FileName 'LogoWide310x150.scale-180'
ExportWidth 558
ExportHeight 270
Convert



FileName 'SplashScreen.scale-100'
ExportWidth 620
ExportHeight 300
Convert

FileName 'SplashScreen.scale-140'
ExportWidth 868
ExportHeight 420
Convert

FileName 'SplashScreen.scale-180'
ExportWidth 1116
ExportHeight 540
Convert
PathClear true
FileFormat png
FilePrefix
ExportBackground

// Convert
PathExport '.\windowsphone'

ExportArea canvas
FileSvg '.\logo.svg'

// Replace black color with white color
Replace fill:#000000;fill-opacity:1; fill:#FFFFFF;fill-opacity:1;



FileName 'LogoSquare44x44.scale-100'
ExportWidth 44
ExportHeight 44
Convert

FileName 'LogoSquare44x44.scale-140'
ExportWidth 62
ExportHeight 62
Convert

FileName 'LogoSquare44x44.scale-240'
ExportWidth 106
ExportHeight 106
Convert



FileName 'LogoSquare71x71.scale-100'
ExportWidth 71
ExportHeight 71
Convert

FileName 'LogoSquare71x71.scale-140'
ExportWidth 99
ExportHeight 99
Convert

FileName 'LogoSquare71x71.scale-240'
ExportWidth 170
ExportHeight 170
Convert



FileName 'LogoSquare150x150.scale-100'
ExportWidth 150
ExportHeight 150
Convert

FileName 'LogoSquare150x150.scale-140'
ExportWidth 210
ExportHeight 210
Convert

FileName 'LogoSquare150x150.scale-240'
ExportWidth 360
ExportHeight 360
Convert



FileName 'StoreLogo.scale-100'
ExportWidth 50
ExportHeight 50
Convert

FileName 'StoreLogo.scale-140'
ExportWidth 70
ExportHeight 70
Convert

FileName 'StoreLogo.scale-240'
ExportWidth 120
ExportHeight 120
Convert



FileSvg '.\logo_wide.svg'

// Replace black color with white color
Replace fill:#000000;fill-opacity:1; fill:#FFFFFF;fill-opacity:1;



FileName 'LogoWide310x150.scale-100'
ExportWidth 310
ExportHeight 150
Convert

FileName 'LogoWide310x150.scale-140'
ExportWidth 434
ExportHeight 210
Convert

FileName 'LogoWide310x150.scale-240'
ExportWidth 744
ExportHeight 360
Convert




FileSvg '.\logo_high.svg'

// Replace black color with white color
Replace fill:#000000;fill-opacity:1; fill:#FFFFFF;fill-opacity:1;

// This could be used to add a background color
// ExportBackground #004873 

FileName 'SplashScreen.scale-100'
ExportWidth 480
ExportHeight 800
Convert

FileName 'SplashScreen.scale-140'
ExportWidth 672
ExportHeight 1120
Convert

FileName 'SplashScreen.scale-240'
ExportWidth 1152
ExportHeight 1920
Convert