• Post Reply Bookmark Topic Watch Topic
  • New Topic

GradientPaint problem  RSS feed

 
James Hodgkiss
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using the following code to paint my canvas:



The effect I am trying to get is to have the just a small top left corner area of the canvas yellow, with the rest of it blending into orange. But the above code makes the whole of the left side yellow.

Is there any way I can achieve the desired effect?

Cheers,
James
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Works for me:Perhaps your canvasHeight is wrong. Why not just getWidth() and getHeight() like I did?
[ March 31, 2006: Message edited by: Jeff Albertson ]
 
James Hodgkiss
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply Jeff.

Using getWidth() and getHeight() doesn't make any difference. (My width and height variables are ok anyway, as the title displays in the correct place.)

It's an AWT applet I'm developing - could it be anything to do with that?

Can you just confirm that you are getting the bottom left corner more orange than the (yellow) top left corner?

Cheers,
James
 
James Hodgkiss
Ranch Hand
Posts: 401
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've got it sorted now. Have moved xPos2 to 20, and yPos2 to 40 and it looks fine now. Thanks again for your help.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!