Results 1 to 8 of 8
- 04-30-2012, 11:09 AM #1
Member
- Join Date
- Apr 2012
- Location
- Bangalore
- Posts
- 4
- Rep Power
- 0
- 04-30-2012, 03:55 PM #2
Re: How to create JFrame having shape and size equel to image?
Moved from new to Java.
Java images are always rectangular, so first define what you mean by the 'shape' of an image.
How to Create Translucent and Shaped Windows (The Java™ Tutorials > Creating a GUI With JFC/Swing > Using Other Swing Features)
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 05-02-2012, 10:46 AM #3
Member
- Join Date
- Apr 2012
- Location
- Bangalore
- Posts
- 4
- Rep Power
- 0
Re: How to create JFrame having shape and size equel to image?
shape of image means suppose i have oval shape image (here i am referring to the opaque pixels only not the transparent pixels). How i can make the oval shape JFrame same as the size and shape of image .
- 05-02-2012, 03:37 PM #4
Re: How to create JFrame having shape and size equel to image?
I gave you a link to a tutorial. Did you go through it?
And by 'go through' I don't mean 'glance at'
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 05-05-2012, 09:20 AM #5
Member
- Join Date
- Apr 2012
- Location
- Bangalore
- Posts
- 4
- Rep Power
- 0
Re: How to create JFrame having shape and size equel to image?
I went through the article but one doubt i have how can we calculate the shape of image. So that we can use setshape function.
- 05-05-2012, 11:27 AM #6
Re: How to create JFrame having shape and size equel to image?
Do you know how to obtain the pixels of an image?
Do you know how to iterate over them?
Do you know how to identify a transparent color?
dbWhy do they call it rush hour when nothing moves? - Robin Williams
- 05-07-2012, 01:55 PM #7
Member
- Join Date
- Apr 2012
- Location
- Bangalore
- Posts
- 4
- Rep Power
- 0
Re: How to create JFrame having shape and size equel to image?
I know all the above mentioned points but how it will help to create the shape?
- 05-07-2012, 04:38 PM #8
Re: How to create JFrame having shape and size equel to image?
Read the API for Shape. Go through the list of classes that implement Shape. Find one that you can assemble from the non-transparent pixels, or from the boundary between transparent and non-transparent pixels.
This is your project, and it's not entirely trivial. You need to try out stuff yourself. Post back if you encounter a specific problem with which other members may (or may not) be able to help.
dbWhy do they call it rush hour when nothing moves? - Robin Williams
Similar Threads
-
create own shape
By kepep in forum Java 2DReplies: 2Last Post: 12-15-2010, 07:43 PM -
how to change the shape of the JFrame to a oval shape
By kiki2009 in forum Java 2DReplies: 1Last Post: 04-02-2010, 12:48 PM -
Change the shape of JFrame
By kiki2009 in forum New To JavaReplies: 4Last Post: 07-09-2009, 01:47 PM -
Setting frame size to the size of an image
By Yoruichi in forum AWT / SwingReplies: 5Last Post: 04-22-2009, 04:37 PM -
Image size in a JFrame
By nickbeacroft in forum AWT / SwingReplies: 2Last Post: 06-26-2008, 04:08 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks