create function icon
This commit is contained in:
@@ -7,6 +7,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CampusAppWStore8", "Campuss
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CampusAppWPortalLib8", "CampusAppWPortalLib8\CampusAppWPortalLib8.csproj", "{67D80BE2-0FB7-44C8-A495-7D44FC2AC262}"
|
||||
EndProject
|
||||
Project("{888888A0-9F3D-457C-B088-3A5042F75D52}") = "IconCreator", "IconCreator\IconCreator.pyproj", "{78E8DC22-F4E1-42D9-BA04-93EA031C630C}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
@@ -73,6 +75,14 @@ Global
|
||||
{67D80BE2-0FB7-44C8-A495-7D44FC2AC262}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||
{67D80BE2-0FB7-44C8-A495-7D44FC2AC262}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{67D80BE2-0FB7-44C8-A495-7D44FC2AC262}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{78E8DC22-F4E1-42D9-BA04-93EA031C630C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{78E8DC22-F4E1-42D9-BA04-93EA031C630C}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||
{78E8DC22-F4E1-42D9-BA04-93EA031C630C}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||
{78E8DC22-F4E1-42D9-BA04-93EA031C630C}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{78E8DC22-F4E1-42D9-BA04-93EA031C630C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{78E8DC22-F4E1-42D9-BA04-93EA031C630C}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||
{78E8DC22-F4E1-42D9-BA04-93EA031C630C}.Release|x64.ActiveCfg = Release|Any CPU
|
||||
{78E8DC22-F4E1-42D9-BA04-93EA031C630C}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
import cairo
|
||||
import rsvg
|
||||
|
||||
img = cairo.ImageSurface(cairo.FORMAT_ARGB32, 640,480)
|
||||
ctx = cairo.Context(img)
|
||||
handler= rsvg.Handle(str("test.svg"))
|
||||
handler.render_cairo(ctx)
|
||||
img.write_to_png("svg.png")
|
||||
@@ -5,9 +5,9 @@
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>78e8dc22-f4e1-42d9-ba04-93ea031c630c</ProjectGuid>
|
||||
<ProjectHome>.</ProjectHome>
|
||||
<StartupFile>IconCreator.py</StartupFile>
|
||||
<SearchPath>
|
||||
</SearchPath>
|
||||
<StartupFile>
|
||||
</StartupFile>
|
||||
<SearchPath>scripts\</SearchPath>
|
||||
<WorkingDirectory>.</WorkingDirectory>
|
||||
<OutputPath>.</OutputPath>
|
||||
<Name>IconCreator</Name>
|
||||
@@ -22,12 +22,15 @@
|
||||
<EnableUnmanagedDebugging>false</EnableUnmanagedDebugging>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="IconCreator.py" />
|
||||
<Compile Include="scripts\createspng.py" />
|
||||
<Compile Include="scripts\IconCreator.py" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="dstImages\" />
|
||||
<Folder Include="dstImages\wp8\" />
|
||||
<Folder Include="dstImages\wp8\159x159\" />
|
||||
<Folder Include="dstImages\wp8\159x159\functions\" />
|
||||
<Folder Include="scripts\" />
|
||||
<Folder Include="srcImages\" />
|
||||
<Folder Include="srcImages\emotions\" />
|
||||
<Folder Include="srcImages\functions\" />
|
||||
|
||||
29
CampusAppWP8/IconCreator/scripts/IconCreator.py
Normal file
29
CampusAppWP8/IconCreator/scripts/IconCreator.py
Normal file
@@ -0,0 +1,29 @@
|
||||
import cairo
|
||||
import rsvg
|
||||
import xml.etree.ElementTree as ET
|
||||
|
||||
def convertSVGToPNG(src, dst, dstWidth, dstHeight, srcWidth, srcHeight, style,layerID):
|
||||
ET.register_namespace("","http://www.w3.org/2000/svg")
|
||||
|
||||
tree = ET.parse(src)
|
||||
root = tree.getroot()
|
||||
|
||||
for layer in root.findall('./{http://www.w3.org/2000/svg}g'):
|
||||
name = layer.get('{http://www.inkscape.org/namespaces/inkscape}label')
|
||||
if name != layerID :
|
||||
root.remove(layer)
|
||||
else :
|
||||
for path in layer.findall('./{http://www.w3.org/2000/svg}path'):
|
||||
path.set("style",style)
|
||||
|
||||
img = cairo.ImageSurface(cairo.FORMAT_ARGB32, dstWidth, dstHeight)
|
||||
ctx = cairo.Context(img)
|
||||
|
||||
width_ratio = float(dstWidth) / float(srcWidth)
|
||||
height_ratio = float(dstHeight) / float(srcHeight)
|
||||
ctx.scale(width_ratio, height_ratio)
|
||||
|
||||
handler= rsvg.Handle(None,str(ET.tostring(root, encoding='utf8', method='xml')))
|
||||
handler.render_cairo(ctx)
|
||||
|
||||
img.write_to_png(dst)
|
||||
9
CampusAppWP8/IconCreator/scripts/createspng.py
Normal file
9
CampusAppWP8/IconCreator/scripts/createspng.py
Normal file
@@ -0,0 +1,9 @@
|
||||
import IconCreator
|
||||
import os
|
||||
os.chdir("srcImages/functions")
|
||||
for files in os.listdir("."):
|
||||
if files.endswith(".svg"):
|
||||
fileName, fileExtension = os.path.splitext(files)
|
||||
IconCreator.convertSVGToPNG(files, "../../dstImages/wp8/159x159/LightTheme/functions/"+fileName+".png",159,159,256,256,"fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:none" , "Icon")
|
||||
IconCreator.convertSVGToPNG(files, "../../dstImages/wp8/159x159/DarkTheme/functions/"+fileName+".png",159,159,256,256,"fill:#FFFFFF;fill-opacity:1;fill-rule:evenodd;stroke:none", "Icon")
|
||||
|
||||
@@ -1,114 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="256"
|
||||
height="256"
|
||||
id="svg3000"
|
||||
version="1.1"
|
||||
inkscape:version="0.48.4 r9939"
|
||||
sodipodi:docname="openinghours3.svg">
|
||||
<defs
|
||||
id="defs3002">
|
||||
<filter
|
||||
inkscape:collect="always"
|
||||
id="filter3761"
|
||||
x="-0.50632314"
|
||||
width="2.0126463"
|
||||
y="-0.43506995"
|
||||
height="1.8701399">
|
||||
<feGaussianBlur
|
||||
inkscape:collect="always"
|
||||
stdDeviation="21.835187"
|
||||
id="feGaussianBlur3763" />
|
||||
</filter>
|
||||
<filter
|
||||
inkscape:collect="always"
|
||||
id="filter3765"
|
||||
x="-0.1168438"
|
||||
width="1.2336876"
|
||||
y="-0.10040076"
|
||||
height="1.2008015">
|
||||
<feGaussianBlur
|
||||
inkscape:collect="always"
|
||||
stdDeviation="5.0388894"
|
||||
id="feGaussianBlur3767" />
|
||||
</filter>
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
id="base"
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1.0"
|
||||
inkscape:pageopacity="0.0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:zoom="0.63531537"
|
||||
inkscape:cx="127.46031"
|
||||
inkscape:cy="549"
|
||||
inkscape:document-units="px"
|
||||
inkscape:current-layer="layer1"
|
||||
showgrid="false"
|
||||
inkscape:window-width="1920"
|
||||
inkscape:window-height="1014"
|
||||
inkscape:window-x="-8"
|
||||
inkscape:window-y="-8"
|
||||
inkscape:window-maximized="1" />
|
||||
<metadata
|
||||
id="metadata3005">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<g
|
||||
inkscape:label="Glow"
|
||||
inkscape:groupmode="layer"
|
||||
id="g3839">
|
||||
<path
|
||||
d="M 66.000000,125.000000 C 66.000000,125.000000 123.958313,125.000000 123.958313,125.000000 C 123.958313,125.000000 124.000000,68.604156 124.000000,68.604156 C 124.000000,68.604156 132.062485,68.593750 132.062485,68.593750 C 132.062485,68.593750 132.062500,125.000000 132.062500,125.000000 C 132.062500,125.000000 189.000000,125.000000 189.000000,125.000000 C 189.000000,125.000000 189.000000,133.000000 189.000000,133.000000 C 189.000000,133.000000 132.031250,133.000000 132.031250,133.000000 C 132.031250,133.000000 132.000000,186.062500 132.000000,186.062500 C 132.000000,186.062500 123.968735,186.062500 123.968735,186.062500 C 123.968735,186.062500 124.062485,133.000000 124.062485,133.000000 C 124.062485,133.000000 66.000000,133.000000 66.000000,133.000000 C 66.000000,133.000000 66.000000,125.000000 66.000000,125.000000 Z"
|
||||
style="opacity:0.68000034;fill:#00c8ff;fill-opacity:1;fill-rule:evenodd;stroke:none;filter:url(#filter3761)"
|
||||
id="path3841"
|
||||
inkscape:connector-curvature="0"/>
|
||||
</g>
|
||||
<g
|
||||
id="g3835"
|
||||
inkscape:groupmode="layer"
|
||||
inkscape:label="Icon">
|
||||
<path
|
||||
d="M 66.000000,125.000000 C 66.000000,125.000000 123.958313,125.000000 123.958313,125.000000 C 123.958313,125.000000 124.000000,68.604156 124.000000,68.604156 C 124.000000,68.604156 132.062485,68.593750 132.062485,68.593750 C 132.062485,68.593750 132.062500,125.000000 132.062500,125.000000 C 132.062500,125.000000 189.000000,125.000000 189.000000,125.000000 C 189.000000,125.000000 189.000000,133.000000 189.000000,133.000000 C 189.000000,133.000000 132.031250,133.000000 132.031250,133.000000 C 132.031250,133.000000 132.000000,186.062500 132.000000,186.062500 C 132.000000,186.062500 123.968735,186.062500 123.968735,186.062500 C 123.968735,186.062500 124.062485,133.000000 124.062485,133.000000 C 124.062485,133.000000 66.000000,133.000000 66.000000,133.000000 C 66.000000,133.000000 66.000000,125.000000 66.000000,125.000000 Z"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path3837"
|
||||
style="fill:#151515;fill-opacity:1;fill-rule:evenodd;stroke:none" />
|
||||
</g>
|
||||
<g
|
||||
inkscape:label="Shadow"
|
||||
inkscape:groupmode="layer"
|
||||
id="layer1">
|
||||
<path
|
||||
d="M 66.000000,125.000000 C 66.000000,125.000000 123.958313,125.000000 123.958313,125.000000 C 123.958313,125.000000 124.000000,68.604156 124.000000,68.604156 C 124.000000,68.604156 132.062485,68.593750 132.062485,68.593750 C 132.062485,68.593750 132.062500,125.000000 132.062500,125.000000 C 132.062500,125.000000 189.000000,125.000000 189.000000,125.000000 C 189.000000,125.000000 189.000000,133.000000 189.000000,133.000000 C 189.000000,133.000000 132.031250,133.000000 132.031250,133.000000 C 132.031250,133.000000 132.000000,186.062500 132.000000,186.062500 C 132.000000,186.062500 123.968735,186.062500 123.968735,186.062500 C 123.968735,186.062500 124.062485,133.000000 124.062485,133.000000 C 124.062485,133.000000 66.000000,133.000000 66.000000,133.000000 C 66.000000,133.000000 66.000000,125.000000 66.000000,125.000000 Z"
|
||||
style="opacity:0.9;fill:#484848;fill-opacity:0.60392157;fill-rule:evenodd;stroke:none;filter:url(#filter3765)"
|
||||
id="path3014"
|
||||
inkscape:connector-curvature="0"/>
|
||||
</g>
|
||||
<g
|
||||
inkscape:groupmode="layer"
|
||||
id="layer2"
|
||||
inkscape:label="Ring">
|
||||
<path
|
||||
style="opacity:0.98999999000000005;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-opacity:1;fill:#656565"
|
||||
d="M 128 0.5 C 57.587656 0.5 0.5 57.587656 0.5 128 C 0.5 198.41234 57.587656 255.5 128 255.5 C 198.41234 255.5 255.5 198.41234 255.5 128 C 255.5 57.587656 198.41234 0.5 128 0.5 z M 128 4.71875 C 196.09396 4.71875 251.28125 59.906043 251.28125 128 C 251.28125 196.09396 196.09396 251.28125 128 251.28125 C 59.906043 251.28125 4.71875 196.09396 4.71875 128 C 4.71875 59.906043 59.906043 4.71875 128 4.71875 z "
|
||||
id="path3037" />
|
||||
</g>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 5.9 KiB |
Reference in New Issue
Block a user