FAQ Database Discussion Community


firefox svg canvas drawImage error

firefox,svg,base64,drawimage
I am trying to convert a external svg icon to base64. It is working in all browsers except Firefox which throws an error "NS_ERROR_NOT_AVAILABLE". var img = new Image(); img.src = "icon.svg"; img.onload = function() { var canvas = document.createElement("canvas"); canvas.width = this.width; canvas.height = this.height; var ctx = canvas.getContext("2d");...

Firefox wont draw to canvas on first visit

jquery,html5,firefox,canvas,drawimage
I have an issue I'm having a hard time believing... It seems that when I draw to a dynamically created canvas in firefox it wont render the first time that source is run... It seems to happen the first time the javascript in question is run either by modifying the...

Java's drawImage method doesn't show the image

java,javax.imageio,drawimage
I'm just beginner at Java Programming and am using NetBeans. The code below runs and No Error is displayed but no image is seen! This image is in the "frame" package beside this two classes. package frame; import javax.swing.JPanel; import java.awt.Graphics; import java.awt.image.BufferedImage; import java.io.IOException; import javax.imageio.ImageIO; public class Screen...

Java swing won't display g.drawImage() until repaint() is called

java,swing,paintcomponent,repaint,drawimage
@Override public void paintComponent(Graphics g) { Graphics2D g2 = (Graphics2D) g; super.paintComponent(g2); g2.fillRect(20, 20, 200, 200); g2.drawImage(map, 0, 0, 1004, 687, null); } This is the code for the paintComponent in my JPanel. When the application is launched, I can see the rectangle (which is only there because I wanted...

DrawImage is not drawing in a canvas

javascript,html5,canvas,drawimage
Basically what I have been trying to do, is make a loop that will cycle through a tonne(only 36 atm) of tiles, and place them in order. While that part works, it doesn't actually load the images and display the images. Using console.log, I've narrowed the problem down to when...

HTML5 Canvas drawImage with video source not working on Android

android,html5,video,canvas,drawimage
I am trying to use canvas's drawImage method with video source, but it's not working in Android 4.4.2, tested with Chrome browser. Here's my code: $(function() { var canvas = document.getElementById('canvas'); var ctx = canvas.getContext('2d'); var video = document.getElementById('video'); var videoWidth; var videoHeight; var paused = false; canvas.addEventListener('click', function() {...

How to use compatibleImage to make drawing images faster in java2D?

bufferedimage,java-2d,drawimage
I'm writing a game in Java2D, and it runs smoothly on my computer and another computer I tested it on. However on another computer, with decent specs and same java settings, it is extremely slow. I'm pretty sure that I narrowed it down to the g.drawImage() command. After doing some...