Welcome to the Official BlackBerry® Support Community Forums. This is your resource to discuss support topics with your peers, and learn from each other. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
Zeeshan0581
Posts: 82
Registered: 01-09-2009

Graphics.drawFilledPath()

In the sample code that's provided with JDE 4.7, theres a project called MapFieldDemo.  It uses to the function Graphics.drawFilledPath in one of its classes.  I looked at the values of the xypoints[] arrays during runtime, and i got values for x to be in -20000 range, and y values to be in 12400 range.  I noticed its using the style for graphic to be DRAWSTYLE_AAPOLYGONS.  Now the points range does not make sense to me.

 

I also tried using this functio with values ranging fom 30-200, but nothing to show for on the screen.

 

Can someone elobrate on this function usage?

 

Thanks

Please use plain text.
Administrator
MSohm
Posts: 11,465
Registered: 07-09-2008
My Carrier: Bell

Re: Graphics.drawFilledPath()

The high range values are for buildings that are not currently visible on the screen (located elsewhere on the map).  If there are buildings shown in the map you are looking at you should see values to correspond to locations on the current screen.
Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Found a bug? Report it using the Issue Tracker
Please use plain text.
Developer
webmasterpdx
Posts: 558
Registered: 11-25-2008

Re: Graphics.drawFilledPath()

I'm trying to find out how to use this and drawPathOutline also and the other couple of variants.

I'm not seeing anything on the screen and I set the drawing style like you were....nothing.

 

Anybody used these????

 

Thx

-D

Please use plain text.
Developer
webmasterpdx
Posts: 558
Registered: 11-25-2008

Re: Graphics.drawFilledPath()

I got it working. This is very powerful. The reason it's put together the way it is is so you can do things like store your vertices and then put them together as triangles for maybe fast polygon fills that way (but it's already got polygon fills), or for assist in 3D rendering of surfaces, etc, etc..... The method allows you (if you wish) to keep your vertices seperate from your polygons....as there are typically less vertices than groups of vertices in a surface.

 

-Donald

Please use plain text.
Developer
Blanc
Posts: 638
Registered: 07-02-2009

Re: Graphics.drawFilledPath()

Hi all,

 

          How can i make use of the drawpathoutline of graphics object. is there any samples on it.

 

 

 

Thanks and Regards,

PraveenGoparaju 

Thanks and Regards,
PraveenGoparaju.
Please use plain text.
Developer
webmasterpdx
Posts: 558
Registered: 11-25-2008

Re: Graphics.drawFilledPath()

I tried to post my entire graphics library source, but it said it was too big, so this is just one function....

 

 

/** * Draw the outline of the paths. * * @param none */ public void draw() { int x[] = m_vx.toArray(); int y[] = m_vy.toArray(); fp2int(x); // convert to rounded ints. fp2int(y); if (m_types.isEmpty()) { if (m_offsets.isEmpty()) { m_g.drawPathOutline(x,y,null,null,true); } else { int offsets[] = m_offsets.toArray(); m_g.drawPathOutline(x,y,null,offsets,true); } } else { byte types[] = m_types.toArray(); if (m_offsets.isEmpty()) { m_g.drawPathOutline(x,y,types,null,true); } else { int offsets[] = m_offsets.toArray(); m_g.drawPathOutline(x,y,types,offsets,true); } } } // draw

 

 

 

Please use plain text.
Developer
Blanc
Posts: 638
Registered: 07-02-2009

Re: Graphics.drawFilledPath()

Thanks for your quick reply.
Thanks and Regards,
PraveenGoparaju.
Please use plain text.