Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #21558

Re: drawImage

Newsgroups comp.lang.java.programmer
Date 2013-01-18 16:44 -0800
References <aff1a9e3-cee8-4b14-8dbb-eb103c6963b4@googlegroups.com> <xzjKs.12227$O02.3391@newsfe18.iad>
Message-ID <6f917b7b-0916-4146-8b81-43d99c6f327a@googlegroups.com> (permalink)
Subject Re: drawImage
From Lew <lewbloch@gmail.com>

Show all headers | View raw


Daniel Pitts wrote:
>bob smith wrote:
>> I'm looking at the drawImage routines in the Graphics class:
>> http://docs.oracle.com/javase/1.4.2/docs/api/java/awt/Graphics.html
> 
>> I noticed all of them take integers for the x, y, width, height.
>> This is not necessarily the best thing since you may have a matrix that scales
>> the canvas by� say 1000 times.  Then, it might make sense to have a float passed in.
>> Maybe there should be drawImageF versions or something so we can pass floats in?
> 
>> Any ideas?
> 
> First off, you're looking at the wrong class.
> Second off, you're looking at a very old version of the wrong class.
> 
> <http://docs.oracle.com/javase/7/docs/api/java/awt/Graphics2D.html>
> 
> If you look in here, you'll see there is a method which takes an image 
> and an AffineTransform instance.

And on other methods you'll see, e.g., not two but four 'drawString()' overloads that, like 
the 'drawImage()' overloads, do not bother with naming the method differently. 

That "F" wart in the name 'drawImageF' is not necessary. Also, it is not compliant with the 
Java Coding Conventions.

Some argue against overloads. I say use them if they suit. One place they do not is factory 
methods.

-- 
Lew

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

drawImage bob smith <bob@coolfone.comze.com> - 2013-01-18 13:53 -0800
  Re: drawImage Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-01-18 13:57 -0800
    Re: drawImage Lew <lewbloch@gmail.com> - 2013-01-18 16:44 -0800
  Re: drawImage Roedy Green <see_website@mindprod.com.invalid> - 2013-01-18 14:53 -0800

csiph-web