DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
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

Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links