CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 14 of 14
  1. #1
    Join Date
    Sep 2010
    Posts
    7

    java pixel grabber project

    hi all,im currently a electronic engineer student and i have totaly no knowledge about java. Due to the final year project, i need a java program which can assist to get more marks. But then i have no direction at all, hope any pros can point me the direction at least i could know something to google about. =)

    1) i wish to draw a circle table which look exactly like the attached picture. But donno which function allow me to draw such custom shape table. <-- this is the important part

    2) i wish to upload some picture, and then get the position of the pixel according to the table i drew. And it show only RGB,R+G,R+B,G+B, and white color in each box of table.

    3) Other than upload photo,i can draw myself like a paint too

    4) R = 0000001, G = 00000010 B = 00000011 and so on...Thus,i can get each row data.

    may i know how difficulty is this project? if this is pretty difficult,i might give up this due to the deadline is near already. =)
    Attached Images Attached Images  

  2. #2
    Join Date
    Jun 1999
    Location
    Eastern Florida
    Posts
    3,877

    Re: java pixel grabber project

    i have totaly no knowledge about java
    Given that you're not a java programmer, it will take you a while to learn enough java to be able to write this program. There are lots of code samples laying around. Have you tried Searching for code that uses the PixelGrabber class?
    Norm

  3. #3
    Join Date
    Sep 2010
    Posts
    7

    Re: java pixel grabber project

    yes,i have get plenty of pixel grabber code. but the problem is i cant try it because i need a array table. so i need a array table first instead of pixel grabber. Can u give me a hint what function can i make a table which exactly same with the attached file? a round shape table =)

  4. #4
    Join Date
    Sep 2010
    Posts
    7

    Re: java pixel grabber project

    errr,i feel the pixel grabber is not the neccesary yet. the most important 1 is i can create the round table, and then i can draw like the paint function so the each cell on the table contain their color data. =)

  5. #5
    Join Date
    Jun 1999
    Location
    Eastern Florida
    Posts
    3,877

    Re: java pixel grabber project

    I think it is possible. Look at the methods in the Graphics class.
    Norm

  6. #6
    Join Date
    Sep 2010
    Posts
    7

    Re: java pixel grabber project

    can u give me more clue? =D

  7. #7
    Join Date
    Jun 1999
    Location
    Eastern Florida
    Posts
    3,877

    Re: java pixel grabber project

    Can your describe what types of drawing you need to do?
    Make a list of what kinds of lines you want to draw. Look at the Graphics class and see what methods will draw those kinds of lines. If there are any types of lines you can't find a method for, please post questions describing the type of line that you can't find a method for.
    Norm

  8. #8
    Join Date
    Sep 2010
    Posts
    7

    Re: java pixel grabber project

    as u know im totaly blank for java..i dont even know what is graphic class, so i just wish u guys give me a direction so i can google for. Not i dont want to try, is i donno what to try, i hope u understand, ok well...i will google for the graphic class. =).thank lot

  9. #9
    Join Date
    Jun 1999
    Location
    Eastern Florida
    Posts
    3,877

    Re: java pixel grabber project

    You're going to have a hard time writing a java program if you're totally blank.
    Forget about the program code for now, try to come up with a design that answers the questions I asked: Can your describe what types of drawing you need to do?
    Make a list of what kinds of lines you want to draw. And any other details about what you want do draw.

    The API doc for the java classes is at: http://download.oracle.com/docs/cd/E...se/6/docs/api/
    Norm

  10. #10
    Join Date
    Sep 2010
    Posts
    7

    Re: java pixel grabber project

    hi norm,

    im about to draw the round table which contain of alot small small individual box. Let say only for black and white color, i draw by using paint function to the small small box and then it wil show out some picture let say a love shape. Thus, i can get the data by couting black = 1, white = 0, let say the circle contain a box every 1degree, so for 360degree there will be 360 row? i can get the 1st column is 10001100000, 2nd column is 1000010100 and something like this..

    but i dono which function(table) allow me to draw on it

  11. #11
    Join Date
    Sep 2010
    Posts
    7

    Re: java pixel grabber project

    and it is able to draw or upload photo(alternative) on the array. Thus i can get the data backend as shown at attached picture =)
    Attached Images Attached Images   

  12. #12
    Join Date
    May 2006
    Location
    UK
    Posts
    4,473

    Re: java pixel grabber project

    You really need to read a tutorial on drawing in Java such as the java 2D trail.

    In a nutshell you use a JPanel and override the paintComponent(Graphics g) method to provide your implementation to draw the table. This method is called whenever the panel needs to redraw itself and you use the graphics object passed in to draw on the panel
    Posting code? Use code tags like this: [code]...Your code here...[/code]
    Click here for examples of Java Code

  13. #13
    Join Date
    Jun 1999
    Location
    Eastern Florida
    Posts
    3,877

    Re: java pixel grabber project

    upload photo
    If you can use an existing image vs drawing one yourself that would be much easier.
    im about to draw the round table which contain of alot small small individual box. Let say only for black and white color, i draw by using paint function to the small small box and then it wil show out some picture let say a love shape. Thus, i can get the data by couting black = 1, white = 0, let say the circle contain a box every 1degree, so for 360degree there will be 360 rows
    What are rows and columns in the picture you show? Is a row a ring shaped band/strip and a column what is between two radiating lines? There would be 360 concentric rings and 360 radiating lines.
    If there are 360 rings then the width of the image would need to be much greater than (360+360)*2 pixels to allow 2 pixels per 'box'
    i can get the 1st column is 10001100000, 2nd column is 1000010100 and something like this..
    I'm not sure of the meaning of those binary looking numbers.
    Last edited by Norm; September 16th, 2010 at 03:03 PM.
    Norm

  14. #14
    Join Date
    Sep 2010
    Posts
    7

    Re: java pixel grabber project

    thanks everyone..i'll try google it nw =D

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured