SVG to PNG Converter & Resizer
by Mobile Wallpapers & Software |
|
SVG to PNG Converter & Resizer
حول ملفات المتجهات SVG إلى صور PNG شفافة وعالية الجودة فوراً.
<div class="separator" style="clear: both;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjv14VGeIbywnKIKRddlup1pOJdgoYJH-PyS-pCvNP0oX8MfEenHhqmB7hC8rdW71f4UR90_V0zE_AAJBQtcJGY8rEAE2ycSvbrGYb9LLMgwypnynwp0gAhviYAeqQqaMN6U5dqc5DSIBec-DXSNWJhZeoGXyQr1Ry5YwVf0Fwb3UADU2QVVyWVo7Adhgz/s1408/1000049178.jpg" style="display: block; padding: 1em 0; text-align: center; "><img alt="" border="0" data-original-height="768" data-original-width="1408" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjv14VGeIbywnKIKRddlup1pOJdgoYJH-PyS-pCvNP0oX8MfEenHhqmB7hC8rdW71f4UR90_V0zE_AAJBQtcJGY8rEAE2ycSvbrGYb9LLMgwypnynwp0gAhviYAeqQqaMN6U5dqc5DSIBec-DXSNWJhZeoGXyQr1Ry5YwVf0Fwb3UADU2QVVyWVo7Adhgz/s600/1000049178.jpg" width="600"/></a></div>
<div style="background:#1e222d; color:#fff; padding:25px; border-radius:12px; font-family:sans-serif; max-width:800px; margin: auto;">
<h2 style="color:#0ea5e9; text-align:center; margin-bottom:10px;">SVG to PNG Converter & Resizer</h2>
<p style="text-align:center; color:#a0a0a0; font-size:14px; margin-bottom:20px;">حول ملفات المتجهات SVG إلى صور PNG شفافة وعالية الجودة فوراً.</p>
<div style="border: 2px dashed #3a415a; padding: 30px; text-align: center; border-radius: 8px; cursor: pointer; background: #292d3e; margin-bottom: 20px;" onclick="document.getElementById('svgFile').click()">
<input type="file" id="svgFile" accept=".svg" style="display:none;" onchange="convertSvg(event)">
<p style="margin: 0; color: #0ea5e9; font-weight: bold;">اضغط هنا لرفع ملف SVG</p>
</div>
<div id="svgResult" style="text-align:center; display:none;">
<p style="color:#24ee89; font-weight:bold;">تم التحويل بنجاح!</p>
<a download="converted-image.png" id="downloadSvgPng" style="background:#0ea5e9; color:#fff; padding:10px 20px; text-decoration:none; border-radius:6px; display:inline-block; font-weight:bold;">تحميل صورة PNG</a>
</div>
</div>
<script>
function convertSvg(e) {
const file = e.target.files[0];
if(!file) return;
const reader = new FileReader();
reader.onload = function(event) {
const blob = new Blob([event.target.result], {type: 'image/svg+xml;charset=utf-8'});
const URL = window.URL || window.webkitURL || window;
const blobURL = URL.createObjectURL(blob);
const image = new Image();
image.onload = function() {
const canvas = document.createElement('canvas');
canvas.width = image.width || 512;
canvas.height = image.height || 512;
const context = canvas.getContext('2d');
context.drawImage(image, 0, 0);
const png = canvas.toDataURL('image/png');
document.getElementById('downloadSvgPng').href = png;
document.getElementById('svgResult').style.display = 'block';
};
image.src = blobURL;
};
reader.readAsText(file);
}
</script>
Share the article with your friends
Comments
Post a Comment