Best way to get a part of a picture

Hi, I m doing a behavior with bitmaps but a little confused.

Objective:

(As shown in the attached picture)

I have a Movieclip with a static form on stage (Let´s for example... a star)

I would like to load an image (img1), then I would be able, rotation, zooming and panning of the image (img1).

Then I would only have the star but filled with the part of the image that has mounted this star.

I was trying to get the image bitmapData, then draw the star on the image... And in the end, compare the pixels of color and only get the ones I want... but I get a big mess with rotations, scaling, and the positions of the stars to exactly the place we need to draw the being...

Something tell´s me this I m missing a point and it would be easier...

Can someone give me sense?

It s a kind of mask, but I want to save this picture so only...

Thanks in advance!

extractStar.png

I'd do it:

(1) go and translate your image clip

(2) adjust the star under the mask

(3) once the mask applied, use BitmapData.draw to draw the image hidden in a new data bitmap

(4) TADA!

As far as I know, 'draw' should respect the masks? If not then you need to clip + mask inside an another DisplayObject and attract.  Some pseudo code (not tested and simplified):

// Parent object
var canvas : Sprite = new Sprite();
canvas.addChild( clip );
canvas.addChild( star );

// Manipulate your image
clip.rotation = 35;
clip.scaleX = clip.scaleY = 1.2;

// Set mask and position it
clip.mask = star;
star.x = 40;
star.y = 20;

// Create a bitmap data and draw to it
bitmapData = new BitmapData( Math.ceil(canvas.width), Math.ceil(canvas.height), true, 0x00000000 );
bitmapData.draw( canvas, ...... );

// You may need to use canvas.getBounds and create a matrix to get 'canvas' positioned correctly on the bitmapData

It will be useful,

Peter

Tags: Adobe AIR

Similar Questions

  • What is the best way to get rid of computer viruses?

    Original title: virus windows support system.

    the best way to get rid of this thing?

    Hi DavidStirling7777,

    (a) I recommend you run a virus scan online from the link given below and check if it helps.

    http://OneCare.live.com/site/en-NZ/default.htm?mkt=en-NZ

    Also, make sure that you have the latest update of the software antivirus installed on your computer, so that it works correctly.

    (b) If you don't have any software antivirus installed, you can download & install Microsoft Security Essentials on your machine.

    Hope the helps of information.

    Please post back and we do know.

  • I'm looking for the best way and the best way to get a product key for my windows 7 Edition family.

    Hello.  I'm looking for the best way and the best way to get a product key for my windows 7 Edition family.  Thanks Bob

    Original title: product windows keys 7

    The cheapest option is the OEM System Builder for Windows 7 Home Premium license, but has some license restrictions:

    Amazon.com: Windows 7 Home Premium 64 - Bit System Builder...

    The OEM of Windows 7 versions are identical to the versions commercial full license with the following exception:

    -OEM versions don't offer any free direct support from Microsoft technical support Microsoft

    -OEM Licenses are tied to the computer first you install and activate it on

    -OEM versions allow all hardware upgrades except for an upgrade to a different model motherboard

    -OEM versions does not move directly from an older Windows operating system

    What is OEM software? :
    http://support.Microsoft.com/GP/oemsupport_1/en-GB

    Licensing FAQ:
    http://www.Microsoft.com/OEM/en/licensing/sblicensing/pages/licensing_faq.aspx

    OR

    A detail that does not have these restrictions:

    Where can I still get Windows 7?

    Full version - Microsoft Windows 7 Home Premium

    Version upgrade - Microsoft Windows 7 Home Premium Upgrade

    Family Pack: Upgrade of Microsoft Windows 7 Home Premium Family Pack (3 users)

  • What is the best way to get certificate of secure Channel, including CCNA, expensive etc. without training?

    Currently, what is the best way to get certificate of secure Channel, including CCNA, etc.?

    In the past, there is a way to get VCP using CCNA without expensive training

    Path 2 on this page: VCP6-NV Certification

    There was already an expiration date on the possibility of using a Cisco certification have the implemented training obligation, but the expiration date has been removed.

  • What is the best way to get a SVG file generated from After Effects?

    What is the best way to get a SVG file generated from After Effects?

    Is there a script to do this? I use the SVG file directly in my work. I did research online, but find that it has no native support of EI to achieve.

    I found some scripts online, but they convert output Adobe AE to the JSON file. Is there something similar available for the SVG file?

    Thank you

    AE makes pixels not vectors, so it's not possible.

  • What is the best way to get Adobe Illustrator?

    What is the best way to get Adobe Illustrator?

    [Moved from Illustrator to cloud... MOD]

    Cloud https://creative.adobe.com/plans by subscription Plans, if you always have the latest updates

    Or Creative Suite 6 if you want to pay only once and can use a software 3 year and liked that receive more updates

  • What is the best way to get a comp from AE 2014 to Flash Professional CC?

    I created a training video for 10 minutes for a customer who wants this video for an interactive flash presentation now. Now that the XFL export is no longer an option for AE, what is the best way to get all of the animations in Flash without having to rebuild the entire project?

    The XFL format was not much more than what I mean. The files are huge and for a project that I built in AE by using export, time would have been better spent just making the whole project in Flash.

    In addition, if you are only working in Flash, you can create projects that work on mobile devices and use HTML 5 instead of the traditional Flash Player. And in my never humble opinion the SWF format is dead.

  • Size of the individual partitions - the best way to get

    Hello


    Using Oracle 11.2.0.3

    We have a table partitioned by date range.

    We want to create separate storage for each partition.

    What is the best way to get the size of each partition (MB/GB, etc.).

    Thank you
    select segment_name, partition_name, bytes/1024
    from user_segments
    where segment_name = '&table_name';
    

    Note: The nom_segment in WHERE USER_SEGMENTS is the name of the table. The name of the Partition appears in the column Where USER_SEGMENTS nom_partition.

    Hemant K Collette

  • Best way to get the content of the 1 page in a lot?

    Hi everyone - I just wanted to check with experts on the best way to get information from 1 html page.  For example, I have a page that shows every 1 '' Ribbons that we have in stock to be used on sandals, belts, bags, etc. dog collars;  (http://elizab.com/eb-1-inchribbons.html) I can do an iframe to pull this html page 1 to all others?  What is the best way to do it?

    Basically I just have to update only one page html (tapes 1 ") and then it is good on all other pages, instead of having me to go through and to update every page that uses ribbons 1" :-)

    I'm not sure what is always taken in charge and what is not recommended on this!

    Thank you-

    Use an SSI. Server Side includes. It's better than an iframe. Google for server-side includes.

    Usually, I use php for inclusions on server side, but your server must support php. If not, you can use .shtml server-side includes.

    You need only to update and download only one file when you want to make changes. So on what page/s you have included the SSI these pages updated as well.

    Although I am a little confused because your field of design takes a page in its entirety. How do you intend to include all of the information on other pages without doubt that contain other information as well?

    I guess that if you only have a small area in which to display all the different designs on your pages, then an iframe is probably the best solution for your because you can define its dimensions.

    Personally I would get really "upset" if I have to keep scrolling left and right and top and bottom, then maybe if you go the route iframe you can arrange at least all the vertical stripes so we don't have to scroll up and down or break designs down into smaller categories to its more manageable for the end user.

  • What is the best way to get a Table name in Oracle Applications: 12.1.1 (web)

    Hello friends...


    I need your help my friends...


    We are currently working on Oracle Applications: 12.1.1

    I would like to know the best way to get the name of the Table to form based on a Web...


    Concerning

    Yas.

    Hello

    Please see this thread and documents referenced in it.

    RECORD HISTORY (or) COLUMNS in R12?
    RECORD HISTORY (or) COLUMNS in R12?

    Kind regards
    Hussein

  • What is the best way to get several updates fail to install

    I have 32 updates that have failed to install.  How is the best way to go back and get to install them?

    You receive errors related to updates?

    1. Open Windows Update by clicking the Start button, all programs and then click Windows Update.
    2. In the left pane, click view update history.
      http://Windows.Microsoft.com/en-us/Windows-Vista/see-which-Windows-updates-are-installed
    3. Find an update for Windows that has failed to install, and then double-click the update to view more information.
      Updates that have failed to install will display failed under status, next to the name of update.
    4. In the Windows Update dialog box, next to the details of the error, review the error code for the update has failed.
    5. Follow the links in the Windows Update dialog box under more information or help and Support to resolve the problem, then try to reinstall updates by using Windows Update in Control Panel or by mail with the error code and maybe someone may be able to help others.

    Windows update General troubleshooting

    Suggestions:

    How to reset the Windows Update settings?
    http://support.Microsoft.com/kb/971058

    Diagnose and automatically fix common problems with Windows Update
    http://support.Microsoft.com/mats/windows_update/

    Cannot install updates in Windows Vista, Windows 7, Windows Server 2008 and Windows Server 2008 R2
    http://support.Microsoft.com/kb/2509997

    Or try to install the updates in a clean boot state, and run Windows Update: http://support.microsoft.com/kb/929135

  • BlackBerry Smartphones best way to get the best picture, the phone is off?

    I think it's true that when we send a jpeg image which was obtained using the camera of the phone it is compressed... to a certain extent.

    What is the best way to dload an image uncompressed computer desktop or such so that we can get the higher resolution image?

    Hey copperbeech,.

    You can also use the mass storage Mode to browse your BlackBerry Media Card of your computer to find the image and copy it to a folder on your PC.

    Thank you

  • What is the best/best way to get just Photoshop and first applications?

    Hello Adobe community.

    I'm curious the best about the ideal way to get just Photoshop and first. I have currently the library full of Adobe applications, and I noticed that I don't use the majority of the applications outside of these two. My subscription of the year ends in November (thank you for Black Friday deals). I want an idea of some of the things that I can do to save money and get the best value for both applications as the price of subscriptions is a little strange.

    After watching the price of subscriptions and their descriptions, is logical that the best option I have is to get the Plan of Single-App creative cloud for first ($19.99 per month) and also opt it for the Photoshop & Lightroom Plan ($ 9.99 per month)?

    The price, I was looking at: plans membership: pricing and subscriptions | Adobe Creative Cloud

    I appreciate any help I can get. See you soon!

    If you want these two programs (Lightroom does bundle special photographer, but there is of course no need to install or use) then what you described is the only way

    Don't forget to cancel your existing subscription before the end of your current period

    Cancel see answer #1 in https://forums.adobe.com/thread/2023066 - includes a link to Chat from Monday to Friday

    -or directly at this link https://helpx.adobe.com/creative-cloud/help/cancel-membership.html

  • What is the best way to get a customized version # from an ESXi host?

    Each quarter, we generate a sequence of updates (including patches and security scripts) which are performed manually on our 5.0 ESXi hosts. I don't have an internet connection and so I have to do it this way.  I would like to be able to identify the last quarterly update that has been run on the vCenter servers and/or Client VI.

    Right now, I think adding the quarter, example 1 Q 13 on the DCUI message, then help PowerCLI, vCenter to retrieve the message DCUI, crawled and paste the quarter in the field host Annotations on vCenter.

    Kind of ugly, but I cannot find a cool way to get data like this outside of the host.  I don't want to rely on my user manually set to nothing, for example the field of Annotations on vCenter that is also subject to errors.

    I really want something that can also be seen on the VI Client, too, as the annotations are only on vCenter.

    I have ideas about the best approach to tackle this problem.

    Thank you

    Not sure if this is the best way, but that's what I ended up doing.   It feels like there should be a better way.

    I've updated my quarterly script to add the version number at the bottom of the file, / etc/vmware/welcome, whenever it is run on an ESXi host (e.g. myScript version: v1.0 Date: 04June2013).  This file appears under the banner DCUI.

    Then, I wrote a script powerCLI to roughly the following:

    foreach ($vmHostObj in Get-VMHost-name *) {}

    # Get the full message of DCUI in/etc/vmware/welcome

    $msgObj = echo $vmHostObj | Get-VMHostAdvancedConfiguration-name Annotations.WelcomeMessage

    # Convert a hash of a string table welcome message

    $msgTxt = echo $msgObj.Item ("Annotations.WelcomeMessage")

    # find the clue for the string containing my script information, which is at the end of the welcome message.

    # This is important because the substring below function will extract everything after the index.

    $idx = $msgTxt.IndexOf ("version myScript :")

    If ($idx - gt 0) {}

    $label = $msgTxt.Substring ($idx)

    Set Annotation - remarks on the entity $vmHostObj - CustomAttribute - value $label

    }

    }

    This replaces the Notes field for each host, one day I can go back and make it more user-friendly where it replaces the version leaving the rest of the field notes intact.

  • best way to get XP for vmware fusion

    I have vmware fusion 3.1.3 on macbook pro. I currently have a virtual machine, I installed win 2K Server. too old, too big. I need to get xp and do an installation. I tried to make a snapshot of the existing machine, but seemed to make mistake on the OEM version and wants me register and pay as the new. I have a win 7 pro machine, I guess I could try to make instant, but I was wondering if v3.1.3 will even run that? So, what is the best way to way (see below) to get a XP installation for my installation of vmware fusion run? Fiscally constrained, won't be upgrading to fusion or pay retail for XP anytime soon.

    It will be VERY difficult to get copies of legitimate retail XP more.  Most of the things on eBay is also OEM, which is not available for use of the VM.

    Do not forget that you must purchase a license of said too (the version on the existing machine is probably an OEM version too).

    Why not just buy Win7 on amazon or costco?

    The only other option is a sort of MSDN license, but these licenses cannot be used for production purposes.

Maybe you are looking for