Reputation: 31
So I have the code to print a horizontal line on an image...
public void printH_line(int row, int thickness, int red, int green, int blue) {
Pixel[] pixels = pic.getPixels();
System.out.println("\nprintH_line");
for (int c = 0; c < 200; c++) {
Pixel pix = pic.getPixel(c, row);
pix.setColor(new Color(limitVal(red), limitVal(green),
limitVal(blue)));
Now I just don't know how to do the "thickness," meaning how thick the user wants the line to be. I will be asking the user to enter a number on how thick they want the line to be and that is "int thickness."
Upvotes: 1
Views: 886
Reputation: 168845
Use Graphics2D.setStroke(Stroke)
as seen in this answer.
Upvotes: 1