• Post Reply Bookmark Topic Watch Topic
  • New Topic

Basic "Magnifier"

 
Edmond Corrola
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My program currently creates a line in memory and draws it. I want to create a line in memory, but draw a magnified version of it instead on screen. I use a buffered image and put my code below. I omitted code that is long and isn't relevant to my question and wrote brief comments instead. Any help would be great.
[ September 21, 2008: Message edited by: Edmond Corrola ]
 
Rob Spoor
Sheriff
Posts: 20822
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Edmond,

Please read your private messages regarding an important announcement.

Thank you,

Rob
 
Edmond Corrola
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to examine the pixels that are being placed on the screen. They're normally too small to be seen easily. I want to write a method that converts an image in memory to another image that represents each pixel by a square/rectangle (i.e. fat version of the pixel), but still the same color as the original picture. This is the same idea behind the magnifier used by the Windows OS.

I'm not a big java programmer, but I do not want to change the implementation, I want to use a buffered image. No drawing is going to be hard coded into the program. And even if it is, it would be done so via the buffered image.

Does this explain more what I am trying to accomplish?
[ September 18, 2008: Message edited by: Edmond Corrola ]
 
Rob Spoor
Sheriff
Posts: 20822
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
BufferedImage has methods called getRGB and setRGB; combined with getWidth and getHeight I don't think it would be hard to create a new BufferedImage that's X times as wide and heigh using just those 4 methods.
 
Craig Wood
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Edmond Corrola
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guy, what you guys gave me was a bit more "advanced" than I needed but it definitely helped me arrive at a solution. I just created two separate graphics objects with their own buffers. Than examined one buffer, scaled it onto the second buffer. Thanks.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!