![]() |
![]() |
||||||
|
|||||||
| Tags: |
![]() |
|
|||
|
I need to query the color value at a specific x,y point on the global stage,
regardless of whether there is an image/canvas/etc there or not. I'd use getPixel(x,y) but that depends on there being BitmapData to check, and like I said: I want to investigate regardless of screen content. Can anyone help? Thanks |
| Sponsored Links |
|
|||
|
Here is how you'll take a snapshot of your application:
var app:Application = Application.application as Application; var bmd:BitmapData = new BitmapData(app.width, app.height); bmd.draw(app); var bm:Bitmap = new Bitmap(bmd); var uic:UIComponent = new UIComponent(); uic.addChild(bm); addChild(uic); You can change 'app' in above code with stage and it should work. the most important piece for you is the instance of BitmapData; this class methods like getPixel and getPixel32 that might do the trick for you! Hope this helps. ATTA |
|
|||
|
"CmdrDoc" <webforumsuser@macromedia.com> wrote in message news:gg40ag$hfa$1@forums.macromedia.com... >I need to query the color value at a specific x,y point on the global >stage, > regardless of whether there is an image/canvas/etc there or not. I'd use > getPixel(x,y) but that depends on there being BitmapData to check, and > like I > said: I want to investigate regardless of screen content. > > Can anyone help? Thanks Not sure if this is the best way, but if you tke an ImageSnapShot, you'd have BitmapData. |
|
|||
|
[q]Originally posted by: atta707
Here is how you'll take a snapshot of your application: var app:Application = Application.application as Application; var bmd:BitmapData = new BitmapData(app.width, app.height); bmd.draw(app); var bm:Bitmap = new Bitmap(bmd); var uic:UIComponent = new UIComponent(); uic.addChild(bm); addChild(uic); You can change 'app' in above code with stage and it should work. the most important piece for you is the instance of BitmapData; this class methods like getPixel and getPixel32 that might do the trick for you! Hope this helps. ATTA[/q] This worked, thanks! In order to gain a bit of speed (maybe) can a certain area (say a canvas) be snapshot into the BitmapData area, instead of the entire app window? |
|
|||
|
Absolutely. You can and you should. BitmapData.draw() method takes an instance
of IBitmapDrawable, an interface that's implemented by DisplayObject thru which it trickles down to almost every Flex component. So pass away any display object to the draw() method and you'll have smaller bit map hence faster processing. ATTA |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
- Contact Us
-|-
Adobe Dreamweaver Forums -|-
Archive -|-
Top -|-Rules/Disclaimer-|-Help/Support-|-Advertise