Results 1 to 1 of 1
- 04-17-2010, 09:22 AM #1Member
- Join Date
- Aug 2009
- Richmond, Canada
- Rep Power
SWT ImageData -- How to obtain number of channels
I'm wondering how I can obtain the number of channels for a loaded image, using SWT technology.
Let's have a look at the following website first.
Taking a look at SWT Images
ImageData ideaImageData = new ImageData( getClass().getResourceAsStream("Idea.jpg"));Java Code:
Help - Eclipse SDK
Nothing can be found to tell "number of image channels", in the class "ImageData".
What I would like to find is something like a function getNbOfChannels();
If the loaded image "idea.jpg" is a color image, then, the function returns 3
If it is a gray image, then, the function returns 1.
Can anybody help to give me a hand ?
JIA PeiWelcome to Vision Open
- By sumayaji in forum Advanced JavaReplies: 2Last Post: 07-26-2011, 04:53 PM
- By Azuxard in forum AWT / SwingReplies: 1Last Post: 03-23-2009, 04:33 AM
- By arturmoniswork in forum Reviews / AdvertisingReplies: 0Last Post: 12-30-2008, 06:56 AM
- By Java Tip in forum java.netReplies: 0Last Post: 04-07-2008, 08:01 PM
- By Java Tip in forum java.netReplies: 0Last Post: 04-07-2008, 08:00 PM