Borders


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Borders

  1. #1
    Join Date
    Oct 2004
    Posts
    151

    Question Borders

    Hi everyone,

    I have a question about the graphics 2d. I have a buffered image which i read in and what i want to do is to draw a simple black line around this image something like a simple border(nothing fancy).

    This is what i have so far

    Dimension Size4 = image.getSize();

    BufferedImage Image1= new BufferedImage(Size4.width, Size4.height,
    BufferedImage.TYPE_INT_RGB);

    Graphics2D g2 = Image1.createGraphics();

    Can anybody explain to me or show me any codings on how this can be achieved.

    I hope someone can help me with this

    Thank You

    Yours Sincerely

    Richard West

  2. #2
    Join Date
    Oct 2004
    Posts
    25
    your need something like this

    g2.drawImage(image,0,0,Size4.width,Size4.height,null);
    g2.setColor(Color.BLACK);
    g2.drawRect(0,0,Size4.width-1,Size4.height-1);

    best regards
    floaty

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center