JES Jython help

Discussion in 'OT Technology' started by Ocelot, Apr 14, 2006.

  1. Ocelot

    Ocelot OT Supporter

    Joined:
    Aug 9, 2004
    Messages:
    1,187
    Likes Received:
    0
    Location:
    Chicago, IL
    Hey I'm pretty sure I have most of this code correct, but it keeps coming up with an error. Was wondering if anyone knew anything about JES Jython.
    I need to get this image:
    [​IMG]
    to look like this image:
    [​IMG]
     
  2. Ocelot

    Ocelot OT Supporter

    Joined:
    Aug 9, 2004
    Messages:
    1,187
    Likes Received:
    0
    Location:
    Chicago, IL
    This is the code i have so far...


    def hw3 () :
    file=pickAFile ()
    pict = makePicture(file)

    for pix in getPixels ( Pict ):
    # access the individual color value at the current pixel
    r=getRed(pix)
    g=getGreen(pix)
    b=getBlue(pix)
    wid = getWidth (pict)
    hgt = getHeight (pict)
    midWid = Wid/2
    midHgt = Hgt/2
    if (x < midwid and y < midhgt ):
    setRed(pix,0)
    if (x < midwid and y > midhgt):
    setGreen(pix,0)
    if (x > midwid and y > midhgt):
    setBlue(pix,0)
    openPictureTool (pict)
     
  3. Ocelot

    Ocelot OT Supporter

    Joined:
    Aug 9, 2004
    Messages:
    1,187
    Likes Received:
    0
    Location:
    Chicago, IL
    Nevermind i got it... i needed to identify the x and y variables. so something like this...

    x = getPixelX
    y = getPixelY
     

Share This Page