• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

drawRect( ) with non integers arguments

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all
I'm trying to draw rectangles or any objects with passing parameters other than integeres to drawRect() or to object.setBounds() methods.The problem is i can't found a similar methods to accept floats or doubles .
i tried to use parse methods and convert my flots or doubles to integers and round() to round those nubers to the nearst int values,but when look into the graphs i see the same level
for all values that have decimal points between 0.5 to 0.9 and the same as 0.1 to 0.5.
I hope someone will help me with this.
thanks alot.
 
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't quite get what you mean. The graphical information is represented by pixels. And there is no way pixel wide can be less or greater than 1, so it's impossible to draw line from 0.1 to 0.5.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your time.
what i'm trying to do is to dev. a applet chart with Panel or canvas objects as bars.
i need to control the height of those objects using setbounds()
that accepts integers only.
i want to use floats or doubles to control the height of them.
for that when i pass the height value ffrom html file as 1.6 ,it will be as the height value 2 on the display screen and that is not right.
Thanks again.
 
reply
    Bookmark Topic Watch Topic
  • New Topic