Ich habe ein Problem mit Html5 LeinwandLeinwand DrawImage() schlechte Qualität
Ich zeichne ein Bild, aber die Qualität wird sehr schlecht
, nachdem ich es mit Leinwand ziehe es diese
wird
mein Code ist hier
<script type="text/javascript">
$canvasWidth = $('#canvas').width;
$canvasHeight = $('#canvas').height;
var alpha = 0.0;
var canvas = document.getElementById('canvas');
var ctx = canvas.getContext('2d');
function draw(){
var delta = 0.05;
ctx.clearRect(0,0,$canvasWidth, $canvasHeight);
ctx.globalAlpha = alpha;
var logo= new Image();
WandioLight.onload = function(){
ctx.drawImage(logo, 0, 0, 250, 167);
};
logo.src = "logo.png";
alpha += delta;
if(alpha > 1.0){
return false;
}
setTimeout(draw, 50);
}
tun Sie die Leinwand Breite und Höhe von CSS-Datei gesetzt? –
ich habe dies in html – Dachi
Ich glaube, das ist ein Skalierungsproblem, das auftritt, wenn "width" und 'height' versuche es mit dem' style' Attribut. – James