Skip navigation
Wimpie
Currently Being Moderated

GetPixel value never below 808080... mystery!

Jun 27, 2012 11:30 AM

I have a strange problem... I'm looping over a bitmap, and getpixel never returns a value below hex 808080, even if the value should be pure black. Pure white returns FFFFFF, only values below 808080 pose problems. Has anyone seen this behaviour???

 

Wim

 
Replies
  • Currently Being Moderated
    Jun 27, 2012 3:18 PM   in reply to Wimpie

    #808080 is a intermediate value of #FFFFFFand #000000,

     

    have you a filter?

     
    |
    Mark as:
  • kglad
    72,212 posts
    Jul 21, 2002
    Currently Being Moderated
    Jun 27, 2012 5:08 PM   in reply to Wimpie

    you should be using something like the following. 

     

    var bmd:BitmapData = new BitmapData(mc.width,mc.height,true,0x00000000);

    var mat:Matrix = mc.transform.concatenatedMatrix;

    mat.tx=0;

    mat.ty=0;

    bmd.draw(mc,mat);

    stage.addEventListener(MouseEvent.CLICK,clickF);

    function clickF(e:MouseEvent):void{

        trace(bmd.getPixel32(e.stageX-mc.x,e.stageY-mc.y).toString(16));

    }

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points