BitmapData, get/setPixel on scaled data. Real get/setPixel exist?

Ok... I've been staring at this all day long, so the answer might be screaming at me and I just don't see it....
Summary:  I need an Image to "show through" to the background, cutting through any other images that may be in it's way -- but not images on top of it (only below).
[Edit: Is there an on-screen get/setPixel alternative?  As it seems BitmapData's only let's you edit the raw (un-transformed) data.  I'd like to just write the actual pixels on the screen.  There has to be something that keeps track of all the pixels when the item is scaled.  ]
A picture is worth a thousand words, so I whipped up some examples in PS:
Imagine this is the app that consists of four Images.  The background (skyline), and the three layers stacked on top.  The smiley is the backmost, the heart is the frontmost, and the snowman is in the middle.
Notice how the snowman knocks out the smiley, but not the heart.  I'm achieving this by painting BitmapData with the background pixels wherever the clipart is not transparent. Also, if there was an additional layer (or any number of layers) "behind" the smiley, it would also be "knocked out" by the snowman.  This is why I'm pretty sure I have to do it this way with the BitmapData and manual get/setPixel. (Open to suggestions?)
This method does work perfectly... as long as the snowman isn't scaled or rotated.
Here, the snowman has been scaled up and rotated.  The problem is that the background image pixels get scaled up right along with the art. The outline of the snowman should only be visible when it knocks out the smiley, but instead you can see it clearly because the background pixels do not match, and are actually scaled/rotated along with the snowman.
This is how it should look even with the scaling and rotating.
Here is the code that is doing the "reverse mask":
this == Image
var thisWidth:uint      = this.width;
var thisHeight:uint      = this.height;
var targetWidth:uint      = this.x + thisWidth;
var targetHeight:uint      = this.y + thisHeight;
var data:BitmapData = Bitmap(backgroundImage.content).bitmapData;
var newdata:BitmapData = new BitmapData(thisWidth, thisHeight, true, 0);
newdata.draw(this);
this.content.visible = false;
newdata.lock();
for ( var x:uint = this.x, drawX:uint=0; x < targetWidth; x++,drawX++ ) {
     for ( var y:uint = this.y, drawY:uint=0; y < targetHeight; y++,drawY++ ) {
          color = data.getPixel(x, y);
          newdata.setPixel( drawX, drawY, color );
newdata.unlock();
this.addChild( new Bitmap(newdata) );
Anyone have any suggestions?
My current direction is....
1)  Is there a way to rasterize a transformed layer?  By that I mean make the current transformation permanent.  So, if an image was scale(1.5, 2)  you could function rasterize(image) and it would still stay scaled, but have scale(1, 1)
2) Do the calculations to figure out the inverse matrix and apply it to the bitmapdata before adding it as a child of the image.  This way, when the background pixels get scaled/rotated, they will end up in the right place.
3) Give up, quit my job, buy a sailboat and a lifetime supply of rum.

Winston, don't know how I missed this earlier, but in case you're still looking for some kind of insight, here's what I would suggest:
Keep your movies as .mov files, do not use .mp4
For 4:3 moves, use 768x576 or 720x540 as your size
For 16:9 movies, resize your movies to 1024x576 or 720x404
(Exactly what you use is more about how large you want your file sizes to be)
I know you've attempted very similar steps under the MPEG-4 options, but have you tried this:
Open Movie in QuickTime Pro
Press Command-E to bring up the Export dialog
Under Export: leave as Movie To QuickTime Movie but press the Options... buttons
In the Video pane, select the Settings... button, then set:
   Compression Type: H.264
   Frame Rate: Current
   Key Frames: Automatic
   Frame Reordering should be checked (this is crucial)
   Data Rate: Restrict to 3500 kbits/sec
   Optimized for Download
   Under Encoding, make sure Best Quality (Multi-Pass) is selected
   ... then click OK to exit this Compression Settings dialog
Now, back in the Movie Settings dialog, select Size and adjust that accordingly. (If you're using QT 7.1 or later, you can select whether or not you'd like to Deinterlace your video as well in this dialog. If you're restricting your use of these files to your computer via Front Row, you just might want to deinterlace DV-sourced material.) Then click OK.
Back in the Movie Settings dialog, deselect the Prepare for Internet Streaming option, then click OK to jump back to the QT Export dialog
Export your file (this is not a speedy process)
Or were you doing .mp4 files because .mov files weren't working out for you?
Dual 1.42 G4, 2GB RAM, 9800 Pro, 20" Cinema;   Mac OS X (10.4.6)   Final Cut Studio 5.1

Similar Messages

  • How to read scaled data in Matlab?

    I'm using the board PCI-6115, Labview and Matlab.
    I have some questions related to that scaling of data. I'm using as base of my program the example:'Cont Acq to File(binary)', present in Ni Help. I acquire the data as i16(unscaled) and then read it in Matlab using the low level I/O functions:
    fin=fopen('data.bin','r','b')
    data=fread(fin,[5000,4],'int16')
    Everithing is ok, but the data is unscaled.How can I scale the data?
    I tried to modify the program to write to the file scaled data, but when I read it in Matlab, using the same procedure, I only get a matrix with 0. Does anyone know what is the problem?
    Thanks in advance

    Hello
    Wow, I didn't expect an answer for me so quick and from you.
    Actually, I did follow every your writing. I'm a kind of new labview user (only 2 month),
    so I don't know much about the labview, but I think you're great.
    I also read the writing about the bug in Cont Acq&Graph Voltage-To File(Binary).vi. in other thread. 
    I don't know much about that, but I think you're right for that.
    You're exactly right for my labview.  I modified two vis from example, "Cont Acq&Graph Voltage-To
    File(Binary).vi" and "Grah Acquired Binary Data.vi".  Actually I only changed one part, save I16 and read I16.
    I need a 5MHz sampling data and it's so big.  That's why try to use Matlab.
    I copied, pasted your matlab code and made LVReadBIN.m file.
    When I run it with my data file, I got this error.
    ===============
    >> LVReadBIN(1000);
    ??? Undefined function or variable 'then'.
    Error in ==> C:\Th\LabView\NI_6115\10192006\LVReadBIN.m (GetHeader)
    On line 103  ==>     then
    Error in ==> C:\Th\LabView\NI_6115\10192006\LVReadBIN.m
    On line 23  ==> headerInfo = GetHeader(fileName,pathName,dataBytes);
    >>
    ================
    I'm not an expert for the Matlab, but I don't think the "then" is not right commend,
    so I deleted and run again.  And I got another error.
    ===============
    >> clear
    >> LVReadBIN(1000);
    ??? Error using ==> fread
    Out of memory. Type HELP MEMORY for your options.
    Error in ==> C:\Th\LabView\NI_6115\10192006\LVReadBIN.m (GetHeader)
    On line 104  ==>     userHeader=fread(fid,userHeaderLength,'uchar');
    Error in ==> C:\Th\LabView\NI_6115\10192006\LVReadBIN.m
    On line 23  ==> headerInfo = GetHeader(fileName,pathName,dataBytes);
    >>
    ============
    I attached 5MHz sampling data file. I have to change the name. It's not a txt file.
    You just change the name (extension) from "test-5M.txt" to "test-5M.bin".
    If you don't mind, could tell me what my problem is? Am I miss something or did wrong?
    I really appreciate for that.
    Thank you very much.
    Have a great day.
    Best regard.
    Aggie.
    Attachments:
    test-5M.txt ‏977 KB

  • How can I get an exist applicationModule reference in a servlet?

    JDev 9.0.3.5
    Purpose: to get an exist ADF applicationModule reference in a servlet, so can keep data operations in the same db transaction.
    here is the servlet side code, seems not work.
    ApplicationModuleRef appModRef = SessionUtils.getAmRefFromRequest(request, APPLICATION_ID, "demo.HelloAMLocal");
    return appModRef.useApplicationModule(false);
    package demo;
    import java.util.*;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpSession;
    import oracle.jbo.ApplicationModule;
    import oracle.jbo.JboException;
    import oracle.jbo.common.ampool.ApplicationModuleRef;
    import oracle.jbo.common.ampool.SessionCookie;
    import oracle.jbo.http.HttpContainer;
    import oracle.jbo.http.HttpSessionCookieFactory;
    import oracle.jbo.http.HttpUtil;
    public class SessionUtils {
    public static ApplicationModuleRef getAmRefFromRequest(HttpServletRequest inRequest,
    String inAppId,
    String inConfigName) {
    initialize(inRequest, inAppId, inConfigName);
    HttpContainer container = HttpContainer.getInstanceFromSession(inRequest.getSession());
    ApplicationModuleRef amRef = (ApplicationModuleRef)container.getSessionCookie(inAppId);
    if (amRef == null) {
    //throw new JboException(Res.format(Res.COOKIE_NOT_FOUND, inAppId));
    throw new JboException("Cookie not found when get am ref.");
    return amRef;
    public static void initialize(HttpServletRequest request,
    String appId,
    String configName) {
    int index = configName.lastIndexOf('.');
    String configPackage = configName.substring(0, index);
    String configSection = configName.substring(index + 1);
    // This instantiates an HttpContainer, and attaches the request app mod cookie to the
    // container.
    SessionCookie cookie = findSessionCookie(request,
    request.getSession(true),
    appId,
    configPackage,
    configSection);
    ApplicationModule am = cookie.useApplicationModule(); //no lock
    Locale locale = HttpUtil.determineLocale(request);
    // setup the Application Module's Locale based on the incoming request information
    if(locale != null)
    am.getSession().setLocale(locale);
    // keep id for passivation purposes. This inserts a record into the PS_TXN table.
    cookie.reservePassivationId();
    } // initialize
    protected static SessionCookie findSessionCookie(HttpServletRequest request
    , HttpSession session
    , String applicationId
    , String configPackage
    , String configName) {
    // Load the pool creation properties with the name of our custom
    // application pool class.
    Properties cookieProps = new Properties();
    cookieProps.put(HttpSessionCookieFactory.HTTP_SERVLET_REQUEST, request);
    // Specify property values to be used by the application pool. Please note
    // that these property values could also have been specified in the
    // application configuration file.
    Properties poolProps = new Properties();
    // This action instantiates an HttpContainer.
    SessionCookie cookie = HttpContainer.findSessionCookie(session
    , applicationId
    , configName // poolName
    , configPackage
    , configName
    , poolProps
    , cookieProps);
    return cookie;
    }

    Example VI
    Balaji PK (CLA)
    Ever tried. Ever failed. No matter. Try again. Fail again. Fail better
    Don't forget Kudos for Good Answers, and Mark a solution if your problem is solved.
    Attachments:
    Seperate variables.vi ‏8 KB

  • How can i get my existing itunes account to recognizes a new ipod

    How can I get my existing Itunes account to recognize a new ipod?

    just plug it in. there would be on-screen instructions to help with the set up.
    also consult the user guide that came with the device.

  • I downloaded itunes on a new computer and signed in, how can i get my existing music, etc onto my library without deleting it on my ipod, if I synch it will delete all my stuff and i will have nothing on my ipod

    I downloaded itunes on a new computer and signed in, how can i get the existing music, etc from my ipod to my library without losing it? HELP!

    Copy everything from your old computer, or your backup copy of your old computer, to your new one.
    The ipod is not a backup/storage device.

  • Scaling Data on report BPC 10.0

    Hi All,
    I would like to know if anyone had solve the problem on ScalingData. On our latest version (7.5) we had a drop-down list (€, K€, M€) which changed my entire report. In the new version I can't find a similar way, the ScalingData function doesn't allow you to perform it on the entire report.
    Is there a way to manage scaling data like the currency ?
    Thanks a lot.

    Hi,
    there is, but it is a bit hidden ....
    step 1: use the SCALING property in the account dimension to identify the accounts you want to scale (Y) versus those you do not want to scale (N). For example you probably would not want to scale number of employees etc.
    step 2: use the EPMSCALEDATA function in a report. The easiest way I have found to use this on the entire report is to use it via the formatting sheet.
    on the formatting sheet, go to the use cell, the example uses the default colum format
    double click and select & highlight content only
    select the override option on the right and enter your empscale data function
    confirm with the override button below.
    the formatting sheet should now look something like this
    cell c2 on the report sheet has the factor as a number such as 1, 1000, etc., cell d5 is the first column header and c6 the first row header. this is what the report for this example looks like
    As you can see, the empscaledata function has been inserted into every data cell of the report.
    Hope this helps.
    BR,
    Arnold

  • How do I get my existing photo library from iPhoto to Photoshop?

    How do I get my existing photo library from iPhoto to Photoshop?

    Hello MWWWB,
    Unlike iPhoto, Photoshop is only an editor. It does not store or organize images. In iPhoto preferences, you can choose Photoshop as an editor. You will then get a choice when you double click on an iPhoto thumbnail to use iPhoto or Photoshop to make edits. But Photoshop does not have a library to store images like iPhoto.
    You may want to use Adobe Bridge or Lightroom to help name and organize your pictures. You can Export your iPhoto Library to a folder and manage the exported images there.
    Personally, I hate the arcane manner iPhoto stores and organizes images. I use it only for photos from my iPhone.

  • What is "scaled data"? What indicators display scaled data?

    I have a third party (non-NI) VI that produces "scaled data". What is "scaled data"? I can't find an explanation of "scaled data" anywhere so I don't know what it is.
    How do I find out what indicators are compatible with "scaled data".
    thanks

    In data acquisition, there are two terms:
    a) raw data
    b) scaled data
    Raw data are the data directly received from the data acquisition device. These values are unsigned integer between 0 and 2^resolution.
    Scaled data are data you normally want to handle in your application. You want to have something like 5.5V or 1.2mA. So the raw data is taken and scaled appropriate to the daq-setting.
    hope this helps,
    Norbert 
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • Is the new microsoft 'critical' up date real? When I click to download nothing happens and it won't let me cancel.

    is the new microsoft 'critical' up date real? When I click to download nothing happens and it won't let me cancel.

    Choose About this Mac from the Apple menu, click on the version twice, append the last three digits of the computer's serial number to http://www.everymac.com/ultimate-mac-lookup/?search_keywords= , load the page, and check the computer's maximum OS version. If that's the current version, click here and read the entire page. If not, you can't use the Mac App Store version.
    (94480)

  • Display the date witch is not exist in my table

    Dear Sir
    I want to get the date which is not exist in this field C_DATE, when I compare between tow date, that is I let user enter from_date and to_date ,to get the date which is not exist in the CHEMICAL_CONSUMPTION table ,
    And my table structure as the flowing:
    SQL> DESC CHEMICAL_CONSUMPTION
    Name Null? Type
    C_DATE DATE
    C_JOB_NO NUMBER(8)
    C_BLOCK_TYPE VARCHAR2(10)
    C_COLOR_TYPE VARCHAR2(10)
    C_RUN_TIME NUMBER(6,2)
    C_OPER_CODE VARCHAR2(10)
    REMARKS VARCHAR2(450)
    C_YEAR NUMBER(4)
    C_DAY_REMARKS VARCHAR2(2000)
    ORDER_CODE NUMBER(12)
    RRQ_DOC_CODE NUMBER(12)
    Can I compare this table with the dual table to display the date witch is not in CHEMICAL_CONSUMPTION .
    Waiting for your valuable answer with example
    Best regards
    Jamil Alshaibani

    something like
    SELECT *
      FROM CHEMICAL_CONSUMPTION
    WHERE C_DATE BETWEEN (:BLOCK.FROMDATE AND :BLOCK.TODATE)
        OR C_DATE IS NULL;Just a guess.

  • Balance Forecast As Of Date falls within an existing Absence event-

    Hi,
    when I am trying to get by Absence balance details through Self service, I got below error. Please let know.
    "Balance Forecast As Of Date falls within an existing Absence event. Please enter another As Of Date. You can navigate to the Absence Request History page and review the dates of the existing requests."
    Thanks
    Reddy
    Edited by: 884646 on Sep 13, 2011 6:29 AM

    Hi Joe,
    in this case, the search function would have been really useful.
    Searching for WWV_FLOW_PAGE_DA_A_AR_FK would have - amongst others - returned this thread:
    Re: BUG in Export causing ORA-02291 (WWV_FLOW_PAGE_DA_A_AR_FK) - Reason
    The last posting shows how to find the dynamic actions that cause the problem.
    Best regards,
    Sabine

  • P16B Error : Entry pernr date VA does not exist in T5W/G

    Hi
    We are facing an error wherein we are not able to update the salary package details (FBP) using transaction P16B.
    It throws an error saying "Entry <pernr> <date> VA does not exist in T5W/G" before the screen loads.
    On debugging we found the error occurs in HR_SPA_VARIANT_GET function module where it checks for entry in the table T5W7G.
    The entry in the above table is not getting created even if update using P16B_ADMIN.
    The error is getting rectified if we manually create the entry in the table T5W7G and T5W7I for both VA and VB.
    I am unable to find a configuration node for creating the entries in the table's T5W7G and T5W7I .
    Please advice on how this error is to be rectified.

    Hi
    You have to either fix this in configuration through SPRO or If it is not solved through SPRO then you have search for an SAP note.
    Thanks & Regards
    Jyo

  • Data source does not exist

    Dear all,
    am extracting the data from Vistex datasource,IRM/LIS_RM_IPCRASP               IP CR Agreement Conditions
    after activating in RSA5 i can able to see in RSA6
    but while activating the data source after the extract structure has successfully generated,
    the system showing data source does not exist
    plz help me

    hi,
    when i click the maintain button save button will appear,
    but in my case this save button not highlighting...
    when i check in ST22 the system proposed error mesage is table illegal statement,
    i found this error in many forums but its not related to datasource actvation,
    plz anyone giv me solution as soon as possible...
    regards
    Edited by: gadhatharan thirunavukkarasu on Oct 15, 2011 7:57 AM

  • PURCHASE REQ,No data satisfying selection criteria exists(error msg:MEQ009)

    Hi,
    I am unable to view My Purchase requisition history in ME51N
    Error message "No data satisfying selection criteria exists" is displayed in the selecton variant
    message number: MEQ009
    pls. help me
    Regards

    Thankyou verymuch
    but my question is not that...
    in ME51n > Document overview on> selection variant>My purchase requisitions> i fine the error displaying" NO DATA SATISFYING SELECTION CRITERIA EXISTS"
    error msg number: MEQ-009
    pls. help me with this...
    Regards

  • Data source of an existing custom data library in DLL

    Post Author: tyakimov
    CA Forum: Data Connectivity and SQL
    Using Visual Studio .Net 2005
    I am trying to bind Crystal reports Data source to an existing custom data library, located not in the project code, but DLL. My library contains business object implementations.I am using the "Database Expert", creating a new connection to an ADO.NET source, selecting the .dll from the my directory, and selecting the Class Name from the list of business entities that Crystal Report has detected from the assembly.But when I try to expand the newly-added data source, "... no items found ..." is displayed instead of the properties of the business object. I use similar aproach (BindingSource) when I bind my custom objects to the grid. Is there any way to to bind to classes defined in a .dll located in a folder ?There are many examples if the class implementation is in my project code, but I could't figure out how to do that, using classes from a DLL Any suggestion/help is appressiated regards,Yakimo

    Post Author: bfs
    CA Forum: Data Connectivity and SQL
    No not yet, I'm still trying to find a solution.  If I find one or discover that this is not possible, I will post it here. 
    I've just sent an email to customer support pointing out this thread, hopefully they can provide some help.

  • How to extend data selection to the existing delta update without disturbin

    Is there any way to extend data selection to the existing delta update with out disturbing the delta mechanism? I mean, is there anyway to add new delta init for the new data selection to the existing delta update without disturbing?

    the scenario is we have existing delta, let's say, for the 2 company codes 0001 and 0002. I want to extract delta for the company code 0003 without disturbing the existing delta mechanism. I mean to say I want to extend the data selection for the existing delta from 2 comp codes (0001, 0002) to 3 company codes (0001,0002 & 0003) without disturbing the delta mechanism.

Maybe you are looking for

  • Sending binary data to Nativeprocess (C++)?

    Hello I am developing an AIR application, which uses lots of C++ libraries to do number crunching (OCR, taking screenshots,...) I need to send somehow BitmapData objects to the C++ app, and i need to do this a lot (like every 1-2 secs.) Until now, i'

  • Plotting multiple graphs on one waveform chart with dynamic data types

    I'm trying to put multiple graphs on one waveform chart and having data agreement errors. I'm wondering if it has anything to do with the fact that dynamic data is being used (I've had no problems with other datatypes in the past). Does anyone know h

  • Standalone FLA or SWF

    Sorry if this is a stupid question but I am new to Flash. I want users to be able to click a link on my website and have that link open a Flash movie in a separate window in the Flash Player. However, I have about 50 movies (about 2 minutes each) to

  • Messaging Bridge Migration to other Managed Server

              Hi           I had encountered a difficulty when I deployed the Messaging Bridge using the           Migratable Target. The Messaging Bridge stop function with no exception. I had           double check that in my Managed Server (serverA) I

  • New line command help

    How can I insert a new line wherever "<" in the following file? 1102,1145d1101 < Mar 2 10:00:03 judas.the-ark.com root: Solstice Backup Savegroup: (info) starting Weekly Backup (with 11 client(s)) < Mar 2 10:00:03 judas.the-ark.com root: Solstice Bac