Loader changes the pixel value after loading as bitmap

Hi all,
My aim is to load two images and compare its color information pixel by pixel. For this purpose i used "flash.display.Loader" class to load the images, and once load completes i'll typecast the loaded content to bitmap object (loaderObj.content as Bitmap). Finally i'll get the bitmapdata from the bitmap of both the images and compare the pixels.
Now the problem is the color information of the original image and the loaded bitmap is slightly different. For example the color value of pixels of the attached image image1.jpg is 0xDDDDDD for complete 1366x768. And for the same image when it is loaded as bitmap the color value of pixels are different from the original value (For some pixels only, not all pixels are different).
I’ve given the source code and sample images.
Please can anyone help me out how to resolve this issue?
<?xml version="1.0" encoding="utf-8"?>
<s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                                                     xmlns:s="library://ns.adobe.com/flex/spark"
                                                     xmlns:mx="library://ns.adobe.com/flex/mx"
                                                     width="1376" height="800"
                                                     showStatusBar="false">
          <fx:Declarations>
                    <!-- Place non-visual elements (e.g., services, value objects) here -->
          </fx:Declarations>
          <fx:Script>
                    <![CDATA[
                              private function loadBtn_ClickHandler():void{
                                        var file:File = new File(File.desktopDirectory.nativePath);
                                        file.addEventListener(Event.SELECT, onFileSelectionHandler);
                                        file.browseForOpen("Open an image",[new FileFilter("Images", "*.jpg;*.gif;*.png;*.jpeg")]);
                              private function onFileSelectionHandler(ev:Event):void{
                                        var loadedFilePath:String = (ev.target as File).nativePath;
                                        loadImageAsBitmap(loadedFilePath);
                              /* Load image as bitmap using Loader */
                              private function loadImageAsBitmap(url:String):void{
                                        var loader:Loader = new Loader();
                                        // load content as bitmap
                                        loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onContentLoadComplete);
                                        loader.contentLoaderInfo.addEventListener(IOErrorEvent.IO_ERROR, onContentLoadFail);
                                        loader.load(new URLRequest(url));
                              private function onContentLoadComplete(ev:Event):void{
                                        var loaderInfo:LoaderInfo = ev.target as LoaderInfo;
                                        var bitmap:Bitmap = loaderInfo.content as Bitmap;
                                        printPixelValue(bitmap.bitmapData);
                                        container_ID.addChild(bitmap);
                              private function onContentLoadFail(ioe:IOErrorEvent):void{
                                        trace("Image Load Failed");
                              private function printPixelValue(bmData:BitmapData):void{
                                        var initPixelValue:Number = -1;
                                        //for (var countI:int = 0; countI < bmData.height; countI++) {
                                        var countI:int = 1;
                                        for (var countJ:int = 0; countJ < bmData.width; countJ++) {
                                                  var pixelValue:Number = bmData.getPixel32(countJ, countI);
                                                  if(pixelValue != initPixelValue){
                                                            initPixelValue = pixelValue;
                                                            // Print the pixel value only for one row
                                                            trace("Pixel Value at " + countI + "x" + countJ + " is: " + pixelValue);
                                        trace("Pixel Value at " + countI + "x" + countJ + " is: " + pixelValue);
                    ]]>
          </fx:Script>
          <s:Button id="loadBtn_ID" label="Load!" click="loadBtn_ClickHandler()"
                                x="5" y="5" height="20"/>
          <mx:UIComponent id="container_ID" x="5" y="30" width="1366" height="768"/>
</s:WindowedApplication>
Sample Image:

Thanks all,
Updating the sdk to 4.6.0 fixed the issue

Similar Messages

  • Is it possible to change the asset value after depreciation posted for 4 months

    Hi
    Is it possible to change the asset value from 50000 to 60000 after posting the depreciation for 4 months.
    If it is possible kindly share the process..
    Thanks
    Srikanth KVS

    1. In the explorer page, settings dialog, you can change the display format to show only name.
    2. We cannot use other freeform attribute as DisplayFormat, rather than Code Name. So there are 2 option here:
    a. Remove HierarchyName attribute and just use Name attribute. In the next release, we will allow give Name, Code attribute a displayname, so you can give Name display name as "HierarchyName" in the SQL Vnext release.
    b. Make a Business Rule to update Name when HierarchyName is changed.

  • How to change the location value after it is registered

    hello,
    I want to change the location (A) to a new schema. From what I am understanding, I need to unregister the old locatin(A) in repository browser, and then re-register it in control center, and change the schema name to my new target.
    Now, I have unregisted A in the repository browser. When I come back to control center, and click the register, everything is grey out which means I cannot change the value (but i need to change the value for service name and schema), except the password value. and on the top, it says 'this location has not been registered. please complete the location parameters'.But I know on the old version, like owb 9.0.5, the grey out means this location is registered. So I am really comfused now. The location is unregisted, why cant I change the value of this location?
    any suggestion will be appreciated.

    Here is what I was referring to - when in Control Center, I have the database locations. (sources, targets, OWF etc). Under a database location I selected the connector/location name under Connectors. When I select Deploy Action to Drop the connector/location name will remain. However, if you were to check in the database or the Repository Browser (Locations Report) you will see that the db link is gone. At this point you can safely modify the Locations info in the Connection Explorer (in Design Center). On the other hand, if you want the location to be deleted all together then now you can delete it in the Connection Explorer panel. If you did the prior drop step then at this point all db link info should be gone from the database.

  • Changing Budget amount values after the budget is released in Compensation.

    Hello All-
    Is there a way to change the budget amount in a budhget unit in Compensation management once its released? The budget value once released goes into Infotype 1520 Final Budget. Is there a way to change that value? I tried using PP01 and PP02 but I can not see the value to change it.
    Thanks-
    Chakri.

    HI,
    You can not change the budget value once it's ben released.. you can create a new budget and tag it to the compensation adjustment.

  • How can I change the default value of a command ?

    I want to be able to change the default value of a comand when the vi
    is running. (I know how to do that with a right click when the vi is
    not running).
    In fact I would like the user of the vi to be able to choose a new default value for a command.
    How can I do that ?

    You can't do this on a running VI. If you have an idle VI, you can open a reference to that VI and use an invoke node with the Make Current Values Default method, but that will only work in LV (i.e. not in an EXE) and will affect all the controls. What you can do is save the values to a file and load them when the program starts. OpenG's File I/O package includes some VIs which will help you with that.
    Try to take over the world!

  • In Pages 5.1 how do I change the default spacing after a paragraph? I used to be able to do this with the inspector. I no longer see the option.

    In pages 5.1 I was wondering how to change the line spacing after a paragraph.

    This is from the online Pages Help . You have the option to the Help in your Pages Help menu
    Adjust line spacing
    You can adjust the spacing between lines in a paragraph, and change the amount of space before or after a paragraph.
    Click in the paragraph whose spacing you want to change, or select one or more paragraphs.
    In the Text pane of the Format inspector, click Style.
    Click the disclosure triangle next to Spacing, then choose an option from the pop-up menu:
    Lines: Choose when the distance between ascenders (parts of letters that extend to the top of the line) and descenders (parts of letters that extend below the line) should stay the same. The space between lines is proportional to the font size.
    At least: Choose when the distance between lines should remain fixed (but not to overlap if the text gets large).The distance from one line to the next will never be less than the value you set, but it may be larger for larger fonts to prevent overlapping text lines.
    Exactly: The distance between the baselines.
    Between: The value you set increases the space between the lines, instead of increasing the height of the lines. By contrast, double-spacing doubles the height of each line.
    Click the arrows next to the spacing field to set the amount of space for the option you chose.
    To adjust the amount of space before and after the selected paragraph, click the arrows for Before Paragraph and After Paragraph

  • Unable to change the parameter value in the configtool

    Hi All,
    Error
    In the Configtool I have changed the custom value to u2018TRUEu2019 of the key u201Cume.superadmin.activatedu201D under Cluster-data -> instance -> server -> services -> com.sap.security.caore.ume.service. Now I am trying to change the value again to u2018FALSEu2019 but the value is not getting updated even after the server is restarted OS level. Please advise.
    System details:
    SAP: PI 7.0
    DB:   MS SQL 2000
    OS:   Windows 2003 server
    Thanks in advance.
    Regards,
    Dinesh

    Hi Dinesh,
    There are a variety of reasons why this is not getting reflected :
    1) When you make changes if you use an AS ABAP or LDAP directory as the data source. The default values of the UME properties assume the database of the AS Java as the data source. This requires you to reconfigure the data source before you can restart the AS Java.
    2) The cluster nodes have not been restarted after the changes
    3) Changes apart from global configuration have also been made elsewhere.
    4)properties as described in Editing UME Properties.
    Editing UME Setting:
    a) Start the Config Tool by executing
    \j2
    ee\configtool\configtool.bat.
    b) In the tree, navigate to Global server
    configuration services com.sap.security.core.ume.
    service.
    The list of UME properties appears.
    Regards
    joel
    Edited by: joel trinidade on Apr 15, 2009 12:29 PM

  • How do I change the property value priceInfo.amount?

    How do I change the property value priceInfo.amount?
    After changing the quantity field in the shopping cart and submit the form, I need to convert the field value priceInfo.amount and then set it again.
    How do I?
    Thank´s.

    Why do you need to convert this value and set it again?

  • Procedure to change the standard value key of a work center

    Hi Gurus,
    What is the procedure to change the standard value key of a work center.
    Thanks in advance,
    Regards,
    PPQMUSER

    Hi,
    Just go to CR02 and change std value key, system will give you an information massage 'Standard value key : parameter XXXX after changed' as per the parameters used in new std value key.
    If you want to change the customization for allready used STD value key, then you need dealocate that key from workcenter, and then change the customization.
    Tara
    Edited by: tara  bhapkar on Feb 29, 2012 7:39 AM

  • How to change the profile value in the pl/sql code without making change in the database

    How to change the profile value in the pl/sql code without making change in the database.

    I have program ,where if the profiles 'printer and nunber of copies ' are set at the user level, by default when the report completes the O/p will be sent to the printer mentioned in the set-up. but what user wants is
    if these Profiles are set for the user running this program automatic printing should not be done.

  • How can I change the initial value of the field approve_or_reject?

    Hello Workflow Gurus
    We are using SRM 5.00(SRM SERVER 550) and as per the requirement, I have to make the Reject radio button as default checked on the Approver's screen.
    We are using the SAP Standard Workflow WS14500015.
    I found out the Standard task TS14508044 (SC approval per Item)which has one field in its container i.e. approve_or_reject ,based on the Initial value of this field , the radio button is behaving...
    approve_or_reject EQ 0 i.e. Approve
    approve_or_reject EQ 1 i.e. Reject
    Now my requirement is to change the initial value of this field from 0 to 1 so that Reject radio button comes as checked by default into this standard SAP workflow task TS 14508044...
    Kindly help me and let me know the procedure to change this.
    PLEASE LET ME KNOW THAT IS IT WISE TO MAKE THE CHANGES INTO STANDARD SAP WORKFLOW ???
    Thanks and regards
    Ankur Goyal
    09823448654

    Well Iam not much sure about how you are trying to approve the shopping cart workitem b ut last week i faced a similar issue while apporving the workitems I was able to update the contianer element Apporve_or_reject element by using the FM BBP_PDH_WFL_WI_APPROVE and BBP_PDH_WFL_WI_REJECT ... These two fm will take the responsibility of updating the element with respective value as, if you approve the it will be populated with 0 and if you reject the the element will be updated with 1....
    Please check the thread where I updated the thread in [SRM Workflows|Problem while approving SC from Blackberry !;
    PLEASE LET ME KNOW THAT IS IT WISE TO MAKE THE
    CHANGES INTO STANDARD SAP WORKFLOW ???
    Modifying the standard workflow is not recommended.....

  • How do I change the pixel size of my photos?

    Hello,
    Please give me step by step instructions on how to change the pixel size of my photos from the time I log in.
    Thank you.

    There are basically two ways.
    Image>Image Size... This will adjust the quality of the image, allowing you to adjust the pixel dimensions and keep the full image.
    In the tool bar on left side of screen 5th icon down looks like a sliding picture frame. That is the crop tool, that will adjust the pixel size of a document by removing a portion of the image, allowing you to get rid of portions of the image you do not want.
    There are some other ways to accomplish the above, but these are the basics that everyone needs to know. I recommend playing with these tools on a copy of an image, that way you won't be afraid of destroying an image.

  • Is it possible to change the display value of a domain-based attribute?

    Hello,
    I've selected a domain-based attribute for one of the leaf member attributes in the same entity, aka parent id, since it's a self-referencing entity.  However, I cannot find a way to display anything but the code value in the drop-down (see below).
    Is there a way to change the display value so that I can choose the attribute from the entity from which I want the user to choose? In other words, I would like to display the hierarchy name instead of the code, which is really just the primary id.
    Thanks in advance!
    Ben Lezin

    1. In the explorer page, settings dialog, you can change the display format to show only name.
    2. We cannot use other freeform attribute as DisplayFormat, rather than Code Name. So there are 2 option here:
    a. Remove HierarchyName attribute and just use Name attribute. In the next release, we will allow give Name, Code attribute a displayname, so you can give Name display name as "HierarchyName" in the SQL Vnext release.
    b. Make a Business Rule to update Name when HierarchyName is changed.

  • How to change the variable value in fox formula?

    Hi All,
        Please help me achieve this scenario,
             in the variable selection screen , i wil give some i/p like, calyear(0calyear) = 2008.
          In planing function using FOX formula, i must be able change the variable value to 2009.
      Will it be possible to achieve this, can we change a variable value using FOX formula, if possible
    please let me knw how to achieve this.
    Thanks n Regards,
    Priya.

    Hi Priyadarshini,
    i dont know what is your requirement exactly.If you can give a better explanation of ur requirement we can help you. But to answer your question yes we can get new values for the variable in the planning function.
    for this you need to couple the planning function together with the planning filter in a planning sequence. This planning filter should have the variable that you wanted to change. In the WAD when you want to call this planning sequence there is an option to call variable screen. If you enable this, it will pop up the variable screen to get this value again.
    Guess this was helpful.
    Regards.
    Shafi.

  • How to change the characteristic value in a item of sales order by FM?

    Hi experts,
    I guess the FM BAPI_SALESORDER_CHANGE can implement my requirement. But I have made many testing program, that's all failed. I don't know which part is not correct. So could you give a very simple sample to me? Just change the characteristic value in a item of sales order, not do any change for other parts. Thanks in advanced.
    Regrads

    Hi Birendra,
    Thanks for you explain. I follow your guide to wirte abap program. But related characteristic value still not changed in SO main screen. could you give me some suggestion? Thanks a lot!
    type-pools: IBCO2,
                IBXX.
    data: l_CUOBJ type CUOBJ_VA,
          l_ibase type IBCO2_IBASE_REC,
          l_CONFIGURATION type IBCO2_INSTANCE_TAB2,
          w_CONFIGURATION type IBCO2_INSTANCE_REC2,
          l_ROOT_OBJECT type IBXX_BUSINESS_OBJECT.
    data: t_IBCO2_VALUE_TAB type IBCO2_VALUE_TAB,
          w_IBCO2_VALUE_REC type IBCO2_VALUE_REC.
    select single CUOBJ
      into l_CUOBJ
      from VBAP
      where VBELN = '0020030609'
        and POSNR = '000020'.
      CALL FUNCTION 'CUCB_GET_CONFIGURATION'
        EXPORTING
          INSTANCE                           = l_CUOBJ
        IS_BUSINESS_OBJECT                 =
        IV_MOMENT                          =
        IV_WITH_DB_INSTANCE                =
       IMPORTING
         IBASE                              = l_ibase
         CONFIGURATION                      = l_CONFIGURATION
        EO_CBASE_REF                       =
      EXCEPTIONS
        INVALID_INPUT                      = 1
        INVALID_INSTANCE                   = 2
        INSTANCE_IS_A_CLASSIFICATION       = 3
        OTHERS                             = 4
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    loop at l_CONFIGURATION into w_CONFIGURATION.
      l_ROOT_OBJECT = w_CONFIGURATION-OWNER.
    t_IBCO2_VALUE_TAB[] = w_CONFIGURATION-values[].
      read table w_CONFIGURATION-values into w_IBCO2_VALUE_REC with key ATINN = '0000000222'.
      w_IBCO2_VALUE_REC-ATWRT = 'TMP'.
      modify w_CONFIGURATION-values from w_IBCO2_VALUE_REC index sy-tabix.
      modify l_CONFIGURATION from w_CONFIGURATION index 1.
      clear: w_CONFIGURATION.
    endloop.
    CALL FUNCTION 'CUCB_SET_CONFIGURATION'
      EXPORTING
        ROOT_INSTANCE                      = l_CUOBJ
      IS_CBASE_HEADER                    =
      CHANGING
        CONFIGURATION                      = l_CONFIGURATION
    EXCEPTIONS
      INVALID_INPUT                      = 1
      INVALID_INSTANCE                   = 2
      INSTANCE_IS_A_CLASSIFICATION       = 3
      OTHERS                             = 4
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    CALL FUNCTION 'CUCB_CONFIGURATION_TO_DB'
      EXPORTING
        ROOT_INSTANCE                       = l_CUOBJ
        ROOT_OBJECT                         = l_ROOT_OBJECT
      FORCE_NEW_INSTANCE                  =
      IV_WITHOUT_COMMIT_UPDATE            = ' '
      IV_MATERIAL                         =
      IV_LOCATION                         =
      IV_TECHS                            =
    IMPORTING
      NEW_INSTANCE                        =
    TABLES
      EXP_NEW_NESTED_CUOBJS               =
    EXCEPTIONS
      INVALID_INSTANCE                    = 1
      INVALID_ROOT_INSTANCE               = 2
      NO_CHANGES                          = 3
      ALREADY_REGISTERED_FOR_UPDATE       = 4
      INSTANCE_IS_A_CLASSIFICATION        = 5
      OTHERS                              = 6
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

Maybe you are looking for

  • MW64,  cs6 bridge when I move or copy files the  context menu does not retain  recent folder destinations after I close the program

    W64,  cs6 bridge when I move or copy files the  context menu does not retain  recent folder destinations after I close the program. The context options that show are the ones from original install. The workspace I set up is also gone. I have every ex

  • Why is better Preview than Acrobat for reading

    When you install Acrobat Pro appears a window asking if you want to use it as default reader... SELECT NO!!!! and use Preview. This is the reason: Buggy Acrobat Pro (any version) can't handle large pages of PDFs and instead of Preview for Mac OS X th

  • Unlocking iPhone 5s

    I am considering upgrading to an iPhone 5s from my iPhone 4s.  I want to be able to use it overseas with a SIM card from another country (Spain, primarily).  What must I do to have the phone unlocked?

  • Problem about tdp for sap

    I installed tdp for sap and scheduled a online backup ,  after the backup finished, I checked the log. all data files were backuped successfully.  but there is an error about rman.  I do not know how to do about that?  Could you help me?    I think t

  • AAA Accounting Commands

    I have just started logging AAA accounting commands on my ACS. I am able to view all commands entered without any trouble. I would like to NOT see commands entered from one particular source. I have an IDS device that shuns to a router. The shunning