Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    Export png from Drawpane in firefox

    Hi,
    I'm trying to get the Drawpane with "export" to work.
    We only have users with IE9 or higher so working with dataURL should work just fine.

    I have build a simple example, but everytime i click the getDataURL button, there is a request to the server (which might not be needed).


    This happens in Firefox (latest version) and also in latest version of chrome.
    Is there some attribute missing? Like an example on the Feature-Page I have experimented with "isc.DrawPane.neverUsePNGWorkaround", but in both cases (true and false) the event to the server is called.

    Code:
    isc.DrawPane.neverUsePNGWorkaround = false;
    
    var mainPane = isc.DrawPane.create({
    		ID : "myDrawpane",
    		autoDraw : false,
    		showEdges : true,
    		name : "man",
    		width : 300,
    		height : 100
    	});
    isc.DrawImage.create({
    	left : 150,
    	top : 30,
    	width : 16,
    	height : 16,
    	src : "http://ilotok.de/catalog/view/theme/default/image/icon_user.png",
    	keepInParentRect : true,
    	drawPane : mainPane,
    	useMatrixFilter : true
    });
    
    isc.DrawLabel.create({
    	autoDraw : true,
    	drawPane : mainPane,
    	left : 150,
    	top : 45,
    	contents : "my name"
    }, {
    	fontFamily : "Arial",
    	fontSize : 11
    });
    
    form = isc.VLayout.create({
    		ID : "imageExportSideLayout",
    		width : 250,
    		membersMargin : 20,
    		members : [
    			isc.IButton.create({
    				ID : "getDataURLButton",
    				title : "Get Data URL",
    				click : function () {
    					var getDataURLRes = myDrawpane.getDataURL(function (dataURL) {
    							snapshotImg.setSrc(dataURL);
    						});
    				}
    			}),
    			isc.Img.create({
    				ID : "snapshotImg",
    				border : "3px solid blue",
    				width : 300,
    				height : 100
    			})
    		]
    	});
    
    isc.HStack.create({
    	width : "100%",
    	id : "test",
    	members : [mainPane, form]
    });
    Best regards

    #2
    From the docs:

    On legacy browsers (any version of IE in "quirks" mode, all versions of IE prior to 9.0), or if there is a DrawImage that loads a cross-domain image,
    You have a cross-domain DrawImage.

    Comment


      #3
      oh, sorry. I was experimenting and must have accidentially read over this part.

      thanks for the fast help.

      Comment

      Working...
      X