thanks for reply. when i use following code for(i=0;i<512;i++) { var x =0; for(var l=0;l<512;l++) { if(bgarray[bgvar]==1) { var svgobj = svgDocument.getElementById("rect"); var newnode = svgobj.cloneNode(false); svgstyle = newnode.getStyle(); k++; //svgstyle.setProperty ('opacity', 0.3); svgstyle.setProperty ('fill', "red"); newnode.setAttribute ('id','bg'+k); newnode.setAttribute ('x', x); newnode.setAttribute ('y', y); newnode.setAttribute ('width',0.78); newnode.setAttribute ('height',0.78); newnode.setAttribute ('visibility','visible'); var contents = svgDocument.getElementById ('contents'); newnode = contents.appendChild (newnode); } bgvar =bgvar+1; x = x+0.78; } y = y+0.78; it is working fine , but it is taking more time, can any one help how shoud i reduce time. thanks and regards P.Chandra Shaker Reddy
________________________________ From: ddailey <ddai...@zoominternet.net> To: svg-developers@yahoogroups.com Sent: Wednesday, December 17, 2008 5:30:37 PM Subject: Re: [svg-developers] Please can any one help me ,how to fill color at particular point on image using svg Well, the filling of a region of contiguous pixels from one point, as with the paint bucket in MacPaint and its descendents (including Photoshop), is more of a bitmapped concept than a vector graphics concept. One does not really have access to pixels in SVG (though there are certainly times at which it would be nice if we did!). However, suppose we have a pre-existing vector map: a collection of basic elements like paths and rects and so forth. Then, using JavaScript, one can attach event handlers to all the elements of that vector map, let the cursor turn into a paint bucket shaped icon, and allow the click of the mouse on any particular element be translated into a command that colors that object with the actively chosen color, gradient or pattern. So if this is what you mean, then the answer would be with JavaScript as in: VM = [ list of basic elements ] for (var i in VM) VM.setAttributeNS( null, "onclick", "paintfill(evt) ") function paintfill(evt) { var O=evt.target O.setAttributeNS( null, "fill", activeColor) } This answer rather presupposes that you're building some kind of drawing app, of which several proofs of concept have already been demonstrated here and there. Hope this makes sense David Dailey ----- Original Message ----- From: chandra reddy To: svg-developers@ yahoogroups. com Sent: Wednesday, December 17, 2008 3:47 AM Subject: [svg-developers] Please can any one help me ,how to fill color at particular point on image using svg Hi All Please can any one help me ,how to fill color at particular point on image using svg Advanced Thanks. Regards P.Chandra Shaker Reddy [Non-text portions of this message have been removed] [Non-text portions of this message have been removed] [Non-text portions of this message have been removed] ------------------------------------ ----- To unsubscribe send a message to: svg-developers-unsubscr...@yahoogroups.com -or- visit http://groups.yahoo.com/group/svg-developers and click "edit my membership" ----Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/svg-developers/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/svg-developers/join (Yahoo! ID required) <*> To change settings via email: mailto:svg-developers-dig...@yahoogroups.com mailto:svg-developers-fullfeatu...@yahoogroups.com <*> To unsubscribe from this group, send an email to: svg-developers-unsubscr...@yahoogroups.com <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/