A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Get Color of X/Y Pixel

  1. #1
    Senior Member
    Join Date
    Jan 2003
    Location
    Nebraska
    Posts
    448

    Get Color of X/Y Pixel

    Ok, I know I've seen that one of the new abilities will be the ability to get the color of X/Y pixel in movieClip or Bitmap perhaps. Been ready to dive in and try some things with this feature, however not sure where to begin. Searching on any keywords in help brings up the entire help, so if someone could give me some guidance on starting with this, much appreciated thanks.
    ecards - My full flash site.

  2. #2
    Senior Member
    Join Date
    Jan 2003
    Location
    Nebraska
    Posts
    448
    Heh, ok got a little impatiant. Found it:

    BitmapData.getPixel (x,y);

    That is after you create a myBitmapData object. I have another question on that. In order for me to getPixel(x,y) of a certain movieClip I had to draw(movieClip) on my bitmapData clip and then attach that into a blank movieClip. Is there a way to just transform the existing movieClip to get this data without the need to make a copy first? Probably jumping the gun on questions here, so answer at your leisure...
    ecards - My full flash site.

  3. #3
    Senior Member
    Join Date
    Oct 2000
    Location
    Sweden
    Posts
    102
    I was playing with the bitmap-manipulation functions last night. Really cool! Been waiting for this sort of thing for a long time!

    Didnt put a lot of work into it, but atleast i got a hang of how it works.

    http://www.salomonsson.se/f8/pixels1.html (getPixel, setPixel)
    http://www.salomonsson.se/f8/pixels2.html (copyPixels)


    (fla-files:
    http://www.salomonsson.se/f8/pixels1.fla
    http://www.salomonsson.se/f8/pixels2.fla
    no comments in the code... sorry)
    /Tommy Salomonsson
    www.salomonsson.se

  4. #4
    Junior Member
    Join Date
    May 2007
    Posts
    2

    tommysalo want to see you code but links are broken

    Dear tommysalo,
    I would like to see that code that you have written to
    exercise the bitmap manipulation functions - problem
    the links in you posting are broken.

    Thanks,
    W

  5. #5
    Ryan Thomson EvolveDesigns's Avatar
    Join Date
    Oct 2001
    Location
    British Columbia
    Posts
    3,338
    Quote Originally Posted by wgross
    Dear tommysalo,
    I would like to see that code that you have written to
    exercise the bitmap manipulation functions - problem
    the links in you posting are broken.

    Thanks,
    W
    right-click the link and 'save as', worked for me although clicking the links didn't
    Evolve Designs Interactive Media
    the natural selection

  6. #6
    Junior Member
    Join Date
    May 2007
    Posts
    2

    Errors opening HTML and .fla files

    Dear Tommysalo,
    When I do a saveAs on HTML links then open, I get
    The system cannot find the path specified.

    Then when I try to open the .fla files in
    Flash CS3 Professional
    I get error:
    Unexpected file type.

    Would it be possible for you to include this content as plain text?

    Thanks,
    W

  7. #7
    Senior Member
    Join Date
    Oct 2000
    Location
    Sweden
    Posts
    102
    I had that files on another computer, and I did a quick check without finding it. It has to be in one of my backup-cd:s. I'll do another check.

    It wasn't that fancy. On mouse down it copied a rectangular area of the image beneath the mouse, and on second click it pasted that area on the new position of the mouse. Just copyRect of the BitmapData class.

    Is there something special you are intrersted in concerning BitmapData?
    /Tommy Salomonsson
    www.salomonsson.se

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

HTML5 Development Center