Adobe Dreamweaver Forums



Last 10 THreads :         Word Index importing problem (Last Post : js- - Replies : 9 - Views : 10 )           »          Importing from a database (Last Post : ntsiii - Replies : 2 - Views : 6 )           »          change of state (Last Post : Mainmanian - Replies : 0 - Views : 1 )           »          Could not find the included template (Last Post : Ian Skinner - Replies : 1 - Views : 2 )           »          uploading site (Last Post : hrggroup - Replies : 6 - Views : 7 )           »          linking to a database using xml (Last Post : Twocans - Replies : 18 - Views : 19 )           »          Using AS3 tile list to load video? (Last Post : wendydnew - Replies : 0 - Views : 1 )           »          How to have button in down state as page opens (Last Post : designut - Replies : 2 - Views : 7 )           »          Conditional loop (Last Post : pkonshak - Replies : 0 - Views : 1 )           »          debugger causing browser to crash (Last Post : ntsiii - Replies : 1 - Views : 2 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 11-20-2008, 03:43 PM
CmdrDoc
 
Posts: n/a
Diggs:
Default Color query, at specific point on screen

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



Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 11-20-2008, 04:42 PM
atta707
 
Posts: n/a
Diggs:
Default Re: Color query, at specific point on screen

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

Reply With Quote
  #3 (permalink)  
Old 11-20-2008, 04:53 PM
Amy Blankenship
 
Posts: n/a
Diggs:
Default Re: Color query, at specific point on screen


"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.


Reply With Quote


  #4 (permalink)  
Old 11-20-2008, 06:07 PM
CmdrDoc
 
Posts: n/a
Diggs:
Default Re: Color query, at specific point on screen

[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?


Reply With Quote
  #5 (permalink)  
Old 11-21-2008, 03:17 AM
atta707
 
Posts: n/a
Diggs:
Default Re: Color query, at specific point on screen

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

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 06:47 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Cheap Car Insurance - Compare Motor Insurance
Endsleigh Car Insurance Natwest Car Insurance
More Than Car Insurance Norwich Union Car Insurance
Prudential Car Insurance Zurich Car Insurance
Inactive Reminders By Mished.co.uk