-
3 Feb 2011 5:05 AM #11
At the moment it is "Just Use It".. hehe
I am new to open source and I have no idea.
I want people to be able to use it and modify it as they see fit. It would be great if people could send me any code changes so that I can merge them in if necessary. Any suggestions?
-
3 Feb 2011 5:08 AM #12
Weazil: I'll try to debug this and get back to you.
-
15 Feb 2011 11:49 AM #13
http://code.google.com/p/android/issues/detail?id=7901
it appears that only on honeycomb toDataURL API is fixed in 2.1 & 2.2 it is listed that i can use it but it doesnt work
Code:String ImageBuffer::toDataURL(const String&) const { // leaving this unimplemented, until I understand what its for (and what it really is). return "data:,"; // I think this means we couldn't make the data url }
-
16 Feb 2011 6:04 AM #14
Great stuff SimonFlack!
I noticed there is a 'getSignatureAsImage' which I'm assuming transfers the signature on the canvas to an image. But do you have a 'loadSignatureImageToCanvas' or something like that? Or would it just be a simple matter of assigning a 'src' property to the canvas element?
-
16 Feb 2011 7:13 AM #15
Do you want to be able to load an existing signature into the control?
If so you could just hide the signature panel and display the signature image instead. Maybe with 50% opacity so that the user knows that it is not editable.
Did I understand you correctly?Simon Flack
CEO and UX Designer
WhiteFox AS, Norway
Web: www.whitefox.no
Facebook: www.facebook.com/WhiteFoxAS
Twitter: @WhiteFoxAS
-
18 Feb 2011 7:11 AM #16
Thank you for your reply. I think so yes. So, at the point of the call to getSignatureAsImage, you have the image on the client side correct? I need to take that image and toss it over to the webserver, and be able to retrieve it from the server once again, and display it on the client side. Trying to wrap my head around it. I think this is all doable?
UPDATE: looking at the return data on the following line of code
If passed to sever side, and returned back to client, I'm hoping that is sufficient to resupply to the control. In other words, allow to sign signature, save to server and store, then retrieve back to client side...var strData = oScaledCanvas.toDataURL("image/png");
-
18 Feb 2011 8:49 AM #17
This call will give you a base64 encoded version (a string) of the image in PNG format.Ext.getCmp('signaturePanel').plugins[0].getSignatureAsImage('DATA')
You can send and receive this to and from your web server and store it in a database etc etc.
If you want to display the image after getting it from the server you could do something like this.
or you could just use .update() to set the inner html of a panel.Ext.getCmp('your_imagePanel').el.createChild({
tag: 'div',
style: 'background-image: url(' + [THE IMAGE STRING HERE] + '); width: 500px; height: 100px'
});
Ext.getCmp('your_imagePanel').doComponentLayout();
Hope that helps.<img src="data:image/png;base64,
iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAALGP
C/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9YGARc5KB0XV+IA
AAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q72QlbgAAAF1J
REFUGNO9zL0NglAAxPEfdLTs4BZM4DIO4C7OwQg2JoQ9LE1exdlYvBBeZ7jq
ch9//q1uH4TLzw4d6+ErXMMcXuHWxId3KOETnnXXV6MJpcq2MLaI97CER3N0
vr4MkhoXe0rZigAAAABJRU5ErkJggg=="/>Simon Flack
CEO and UX Designer
WhiteFox AS, Norway
Web: www.whitefox.no
Facebook: www.facebook.com/WhiteFoxAS
Twitter: @WhiteFoxAS
-
18 Feb 2011 12:56 PM #18
-
28 Feb 2011 6:40 AM #19
Simon doing some more research since Android does not allow for the todataURL at the moment doing saveasbmp works fine it just takes a second since the bmp is soo much bigger currently working to see if compression on the bmp can be enabled but what i wanted to tell you was on save i guess because of the transparency for a bmp it just turns the entire image black..
so when intializing the canvas i just filled the bg white
gives me a signature for the momentCode:iWidth = oCanvas.width; iHeight = oCanvas.height; new -- oCtx.fillStyle = "rgb(255,255,255)"; new -- oCtx.fillRect(0,0,iWidth,iHeight); oCtx.beginPath(); oCtx.strokeStyle = "rgba(0,0,0, 0.5)"; oCtx.strokeWidth = "4px";
and might help someone else trying to use it for android
-
3 Mar 2011 11:57 PM #20
A little bug to set stroke's width. Need to modify initCanvas function and replace :
byCode:oCtx.strokeWidth = "4px";
Code:oCtx.lineWidth = 4;
Similar Threads
-
Plugins vs extension
By pokerking400 in forum Ext 2.x: Help & DiscussionReplies: 6Last Post: 7 May 2008, 12:37 PM -
wRite a Plugins
By abys in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 3 Feb 2008, 12:15 PM -
[Solved]What are plugins?
By vendiddy in forum Ext 2.x: Help & DiscussionReplies: 1Last Post: 10 Jan 2008, 3:09 PM


Reply With Quote