Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Builder.drawTo(Grapgics2D g, ...) method #28

Closed
GoogleCodeExporter opened this issue Jul 25, 2015 · 2 comments
Closed

add Builder.drawTo(Grapgics2D g, ...) method #28

GoogleCodeExporter opened this issue Jul 25, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

Please add Builder.drawTo(Grapgics2D g, ...) to write the thumbnail to existing 
graphics directly.

Original issue reported on code.google.com by m.zd...@gmail.com on 16 Nov 2011 at 8:45

@GoogleCodeExporter
Copy link
Author

Once again, thank you for your suggestion.

I'm trying to think of an exact use case for this function.
Perhaps, passing a pre-tranformed `Graphics2D` object to which the thumbnail 
should be drawn on?

Internally, the smallest unit used for processing is a `BufferedImage` object, 
and any drawing is done by first obtaining an `Graphics2D` object from the 
`BufferedImage` rather than passing around `Graphics` objects. (Reworking the 
internals to pass around `Graphics` objects would be a very large endeavor 
which I feel doesn't have a good return on investment.)

Therefore, a hypothetical `Builder.drawTo(Graphics g)` method would just be a 
method which internally draws the `BufferedImage` onto the given `Graphics` 
object.

If that's all that's needed, it shouldn't be too difficult to add to the 
`Builder` class, but I feel that's something that could be done just as simply 
outside of the Thumbnailator API:

  Graphics g = getGraphicsFromSomewhere();

  BufferedImage img = 
    Thumbnails.of("path/to/image")
      .size(100, 100)
      .asBufferedImage();

  g.drawImage(img, 0, 0, null);

Original comment by coobird...@gmail.com on 26 Nov 2011 at 8:09

  • Added labels: Type-Enhancement
  • Removed labels: Type-Defect

@GoogleCodeExporter
Copy link
Author

This issue has been open for more than 6 months without much interest (only a 
single star has been given), and I find it difficult to find an use case for 
this addition, so I'll be closing this issue without additional action.

Original comment by coobird...@gmail.com on 9 Jun 2012 at 6:40

  • Changed state: WontFix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant