Bordercontainer into .jpg file using php

hi
i have done one bordercontaine using flex 4.
that bordercontainer contain one image and label
i want to store that bordercontainer into jpg using php file
I give my mxml file and php
newflexphp.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->
    </fx:Declarations>
    <fx:Script>
        <![CDATA[
            import mx.controls.Alert;
            import mx.graphics.codec.JPEGEncoder;
            import mx.rpc.events.ResultEvent;
            import mx.utils.Base64Encoder;
            //import com.adobe.images.JPGEncoder;           
            import flash.utils.ByteArray;
            import flash.system.System;
            private var bmSave:BitmapData;
            public function resultHandler( event: ResultEvent ):void
                Alert.show( "Result "+String(event.result) );
            public function saveImg():void{
                var jpgSource:BitmapData = new BitmapData (bcont.width, bcont.height);
                jpgSource.draw(bcont);
                var jpgEncoder:JPEGEncoder = new JPEGEncoder(85);
                var jpgStream:ByteArray = jpgEncoder.encode(jpgSource);
                var header:URLRequestHeader = new URLRequestHeader("Content-type", "application/octet-stream");
                var jpgURLRequest:URLRequest = new URLRequest("http://localhost/jpg_encoder.php?name=sketch1.jpg");
                jpgURLRequest.requestHeaders.push(header);
                jpgURLRequest.method = URLRequestMethod.POST;
                jpgURLRequest.data = jpgStream;
                navigateToURL(jpgURLRequest);
        ]]>
    </fx:Script>
    <s:BorderContainer x="369" y="171" width="232" height="216" id="bcont">
        <mx:Image x="44" y="14" width="151" height="87" source="images/3.jpg"/>
        <s:Label x="44" y="132" text="Best wishes" width="94" height="44"/>
    </s:BorderContainer>
    <s:Button x="163" y="182" label="Button" click="saveImg()"/>
</s:Application>
jpg_encoder.php
<?php
if (isset($GLOBALS["HTTP_RAW_POST_DATA"]))
    // get bytearray
    $jpg = $GLOBALS["HTTP_RAW_POST_DATA"];
    // add headers for download dialog-box
    header('Content-Type: image/jpeg');
    header("Content-Disposition: attachment; filename=".$_GET['name']);
    echo $jpg;
?>
now i get the result seketch.jpg file
but the link is redircted to php
just i want to convert my bordercontainer into .jpg file using php.
how can i do .
regards
athi

Try this possible workaround:
1.— Take your original file (before any edits) and duplicate it.
2.— Work on the duplicate (exact clone) only.  Do all your Photoshop edits to your heart's content.  (Optional step: save the file, but don't close it so you don't compress the JPEG and deteriorate its quality.)  Do a select all (Command+A on the Mac, Control+A on Windows) to select the entire pixel content of the duplicate, and COPY that.  Now you have your edited image on your clipboard.
3.— Open the original file, and do a select all on it, but don't copy that!  Instead, DELETE all the pixel content of the original.  Now you have a blank image with only the metadata of the original.
4.— Paste the contents of your clipboard (the pixels of the edited clone) into the blank original.  Save.
With any luck, you'll have the edited pixels with the metadata of the original.
It should work, but there are no guarantees.

Similar Messages

  • How to extract text from a PDF file using php?

    How to extract text from a PDF file using php?
    thanks
    fabio

    > Do you know of any other way this can be done?
    There are many ways. But this out of scope of this forum. You can try this forum: http://forum.planetpdf.com/

  • How to include external .js file into .ear file using NetBean 5.5.1?

    is it possible to include external .js file into .ear file using NetBean 5.5.1? if not, then where should I placed the external .js file and how to write the src="xxx" element? (that is , how to write the path of "xxx"?)
    I am using JBOSS 4.2.2 GA as server
    thx!!

    Even this is also not possible because, the code in that package is developed by DWR and i am just adding it to my lib folder and importing the respective classes. In the same manner i need to include the *.js* file in the JSP.It took me about 3 minutes reading through the [DWR Getting Started|http://getahead.org/dwr/getstarted] page to learn that you don't have to do any of that. Perhaps you should read that page?

  • Spool SQl data into text file using dynamic sql

    Hi,
    I am spooling output data into text file using command
    select 'select t.mxname,bo.lxtype,t.mxrev'||chr(10)||'from mx_1234567'||chr(10)||
    'where <condition>';
    here mxname varchar(128),lxtype(128),mxrev(128) all are of varchar type.I want the output in format
    e.g Part|1211121313|A
    but due to column width the output,I am getting is with spaces.
    "Part then blank spaces |1211121313 then blank spaces |A"
    how can I remove these spaces between columns.I used set space 0 but not working.
    Thanks in advance.
    Your help will be appreciated.

    Hi Frank,
    I have seen your reply for SET LINE SIZE function. But, I could not be able to understand it.
    I am facing similar kind of issue in my present project.
    I am trying spool more than 50 columns from a table into flat file. Because of more column lengths in few columns, i am getting space. There are so many columns with the same issue. I want to remove that space.so that, data can fit perfectly in one line in .txt file without any wrap text.
    Below is my sample query.sql. Please let me know the syntax. My mail id : [email protected]
    --Created : Sep 22,2008, Created By : Srinivasa Bojja
    --Export all Fulfillments
    --Scheduled daily after 1:00am and should complete before 3:30am
    WHENEVER SQLERROR EXIT SQL.SQLCODE
    SET LINESIZE 800
    SET WRAP OFF
    SET PAGESIZE 800
    SET FEEDBACK OFF
    SET HEADING ON
    SET ECHO OFF
    SET CONCAT OFF
    SET COLSEP '|'
    SET UNDERLINE OFF
    SPOOL C:\Fulfillment.txt;
    SELECT SRV.COMM_METHOD_CD AS Method,
    SRV.SR_NUM AS "Fulfillment Row_Id",
    CON.LAST_NAME AS "Filled By"
    SRV.SR_TITLE AS Notes,
    SRVXM.ATTRIB_04 AS "Form Description"
    FROM SIEBEL.S_SRV_REQ SRV,
    SIEBEL.S_SRV_REQ_XM SRVXM,
    SIEBEL.S_USER USR,
    SIEBEL.S_CONTACT CON
    WHERE SRV.ROW_ID = SRVXM.PAR_ROW_ID AND
    SRV.OWNER_EMP_ID = USR.ROW_ID AND
    CON.ROW_ID= SRV.CST_CON_ID;
    SPOOL OFF;
    EXIT;

  • How we write into properties file using get class method

    Hi
    I want to set some value into properties file using given code
    can any one please tell me how i can do this.
    property file
    setting.properties
    Name     =     abc
    and code I use is
    java.io.InputStream oInputStream = this.getClass().getResourceAsStream("Setting.properties");
                   Properties obj = new Properties();
                   obj.load(oInputStream);
                   String myName = obj.getProperty("Name");
                   System.out.println("myName :"+myName);
                   obj.setProperty("Name","def");
                   FileOutputStream oOutput= new FileOutputStream("Setting.properties");
                   obj.store(oOutput, "");
    thanks.

    You can't.
    If you have properties that change dynamically, you should not be using a properties file that sits in the classpath, you should be using Preferences, or a properties file that sits in some application or possibly even user directory, but not one in the classpath. The proper way to do this, would be to have a properties file in your jar (or otherwise in your classpath) that contains the defaults, and another one outside of the classpath in one of the twwo above mentioned areas, then, you read the default one only if the other doesn't exist, or you read the default one first, then read the other overwriting the values from the defaults.
    Don't forget to save the properties again (right after loading if you loaded, or always load, the defaults) after every change.

  • Export batch data into CSV file using SQL SP

    Hi,
    I have created WCF-Custom receive adapter to poll Sql SP (WITH xmlnamespaces(DEFAULT 'Namespace' and For XML PATH(''), Type) . Get the result properly in batch while polling and but getting error while converting into CSV by using map.
    Please can anyone give me some idea to export SQL data into CSV file using SP.

    How are you doing this.
    You would have got XML representation for the XML batch received from SQL
    You should have a flat-file schema representing the CSV file which you want to send.
    Map the received XML representation of data from SQL to flat-file schema
    have custom pipeline with flat-file assembler on the assembler stage of the send pipeline.
    In the send port use the map which convert received XML from SQL to flat file schema and use the above custom flat-file disassembler send port
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • How can I split a pdf file into smaller files using Acrobat XI

    How can I split a pdf file into smaller files using Acrobat XI?

    Hi laforcej
    Open the PDF In Acrobat ...
    Go to Tools -> Pages -> Extract
    Now Select the Page Number you Want to Extract and Save them

  • Adding EXIF standards back into a JPG file using Photoshop

    Can anyone tell me how this is done?
    I'm trying to get photos (JPG files) I've edited in Photoshop and placed on an SD card to display on a Panasonic plasma television (TC-P42X1). The televison will only recognize JPG files with DCF or EXIF standards in tact. I'm assuming photos taken with a digital camera (unedited) already build in these stanards, as those photos view just fine. I'm also assuming that Photoshop strips the JPG file of these standards since the error I'm getting is "Cannot Read" with edited images.
    Of course Panasonic says, "It's an Adobe issue." Adobe would probably tell me "It's a Panasonic issue." Neither of those answers help solve my problem.
    Here is what I've tried so far, with little to no luck. Using Photoshop, I've opened an image, gone to File/File Info (given the photo a description), selected "OK" and saved the image as a JPG file (did not use the "Save for Web" path). This has gotten me a step closer. Now I can see a thumbnail image on the television when in menu view, but it still says, "Cannon Read" when trying to view the images with the slide show option. Does anyone know the trick is using Photoshop to correct this issue? I'm open to other options as well.
    Thank you in advance to anyone willing to help solve this problem!!!

    Try this possible workaround:
    1.— Take your original file (before any edits) and duplicate it.
    2.— Work on the duplicate (exact clone) only.  Do all your Photoshop edits to your heart's content.  (Optional step: save the file, but don't close it so you don't compress the JPEG and deteriorate its quality.)  Do a select all (Command+A on the Mac, Control+A on Windows) to select the entire pixel content of the duplicate, and COPY that.  Now you have your edited image on your clipboard.
    3.— Open the original file, and do a select all on it, but don't copy that!  Instead, DELETE all the pixel content of the original.  Now you have a blank image with only the metadata of the original.
    4.— Paste the contents of your clipboard (the pixels of the edited clone) into the blank original.  Save.
    With any luck, you'll have the edited pixels with the metadata of the original.
    It should work, but there are no guarantees.

  • Display jpg file using ADF Application!!!!!!!!!!!

    Hi All,
    I am opeing a .tif image file kept at a remote location using HttpServletResponse object:
    response.setContentType("application/x");
    response.setHeader("Content-Disposition", "inline; filename=\""+fileName+"\"");
    once this has been done, InputStream(the input stream of the file obtained using new FileInputStream(fileobj)) is piped into an OutputStream using some function.
    using this function the .tif file gets opened in MS picture viewer, but only one file(not like when files are viewed on local machine where all differnent jpg's are viewed using the next button).
    Now what client wants is when there are multiple files kept at the location, all of them should be accessible using next button of the MS picture viewer.
    It is possible to do so?
    Any help???

    ok, i agree with that and was trying for the same. i.e was taking array of InputStream[] , OutputStream[] and ByteArrayOutputStream[]. Write input streams into ByteArrayOutputStreamOBJ, write this ByteArrayOutputStreamObj to OutputStreamobj(ByteArrayOutputStreamObj .writeTo(OutputStreamobj[i]);).
    This method when run in loop runs for the third time throws an exception that connection was closed by remote host.
    Any Suggestions ????

  • Scanning multiple pages into one file using MAC

    How do I scan multiple pages and save them into one file or document using a MacBook Pro laptop?  My printer is an HP Photosmart 7520.  When I use this printer and scan from my PC, it does allow me to scan multiple copies and save as one document by just adding pages as I scan.  When I scan with my MacBook Pro, it scans each page, however, I don't get any option or choice to save as one document.  It automatically saves each page as a separate document.

    Try scanning from your Mac. Use Image Capture app in your Applications folder.
    Click once on the scanner on the left side, then click on Show Details along the bottom. Along the right side you will see LOTS of options for scanning and saving.
    One of those is Format, make the Format PDF.  Just below that will be a check box allowing you to scan multiple pages to one file.
    Say thanks by clicking "Kudos" "thumbs up" in the post that helped you.
    I am employed by HP

  • How to insert characters into a file using Labview

    I have collected acoustic data that I am turning into wav files. After the collection, I now know the file size and need to insert the wav file header on top of this file. Can anyone tell me how to concatenate two files, or insert the wav header (string) data into the other file? My current method is very inefficient. The collected data file can become extremely large, so I am trying to avoid reading this file. I would rather poke data into it without overwriting any existing data. Thanks in advance.

    hello
    See attached vi. It is a modification of NI warite wav vi. It only writes header. So Write a default header, append your data and write heder again using the number of bytes of audio.
    Hope this helps.
    "Qod natura non dat, Salmantica non praestat"
    Attachments:
    Cabecera_Wav.vi ‏77 KB

  • BCP data into a file using Runtime class

    Hi,
         I have a problem in using the Runtime class.
    I am trying to bcp a table's data into a file.I am working on a Unix environment.
    My bcp is not getting completed fully.The total records to be bcped is 1 million,but only one lakh records is getting bcped and then it hangs up..But if i issue the bcp command from my telnet session it is bcping it to the file without any problem.Can anyone help me out on how to overcome this..
    Is there anything specific with Runtime class..I am pasting the code that i tried out below.
    String l_s_bcpQuery="bcp mubstage.dbo.HousingUnitSampleMarket out /dun/d3nmb0/mariaps/subracheckprototype -c -t~ -Umariaps -Prykwz5ba -SD3NMB_MUB";
    try{
    Runtime time=Runtime.getRuntime();
    Process p=time.exec(l_s_bcpQuery);
    p.waitFor();
    System.out.println("The exit value is:"+p.exitValue());
    }catch(Exception ioe){
         ioe.printStackTrace();
         System.out.println("IOException"+ioe.getMessage());

    you might need to capture the stout & sterr from the process. see http://java.sun.com/j2se/1.4.1/docs/api/java/lang/Process.html, or many other similar questions on this forum.
    try this:
    try{
    Runtime time=Runtime.getRuntime();
    Process p=time.exec(l_s_bcpQuery);
    BufferedReader stout = new BufferedReader(new InputStreamReader(p.getInputStream()));
    BufferedReader sterr = new BufferedReader(new InputStreamReader(p.getErrorStream()));
    String out = stout.readLine();
    String err = sterr.readLine();
    while((out != null)||(err != null))
    if(out != null)
    System.out.println(out);
    if(err != null)
    System.err.println(err);
    out = stout.readLine();
    err = sterr.readLine();
    int exit_value = p.waitFor();
    System.out.println("The exit value is:"+ exit_value);
    }catch(Exception ioe){
    ioe.printStackTrace();
    System.out.println("IOException"+ioe.getMessage());
    }

  • Writing into Excel file using PL/SQL and formatting the excel file

    Hi,
    I am writing into a excel file using PL/SQL and I want to make the first line bold on the excel. Also let me know if there are any other formatting options when writing into excel.
    Regards,
    -Anand

    I am writing into a excel file using PL/SQL
    Re: CSV into Oracle and Oracle into CSV
    check that thread or search in this forum...

  • How to load decimal values into a file using bcp in SQL Server 2000?

    Hi everyone,
    I'm trying to load data from a database table to a text file using bcp on SQL Server 2000. When I'm loading the decimal values, the values before the decimal are not being loaded into the file. How could I load the values before decimals?
    Here are the DDLs and DMLs of what I'm trying to run:
    CREATE TABLE [dbo].[Product_Sales](
    [Year_of_Sale] [smallint] NOT NULL,
    [Product_Type] [varchar](25) NOT NULL,
    [Product_Group] [varchar](25) NOT NULL,
    [Category_Type] [varchar](25) NOT NULL,
    [Category_Group] [varchar](10) NOT NULL,
    [Product_Count] [bigint] NOT NULL,
    [Product_Amount] [decimal](19, 2) NOT NULL,
    [Category_Count] [bigint] NOT NULL,
    [Category_Amount] [decimal](19, 2) NOT NULL,
    CONSTRAINT [PK_Product_Sales] PRIMARY KEY CLUSTERED
    [Year_of_Sale] ASC,
    [Product_Type] ASC,
    [Product_Group] ASC,
    [Category_Type] ASC,
    [Category_Group] ASC
    ) ON [PRIMARY]
    ) ON [PRIMARY]
    INSERT INTO [Yearly_Sales].[dbo].[Product_Sales]
    VALUES(2010, 'Online', 'Web', 'Cameras', 'Electronics', 547, 0.00, 0, 0.00)
    EXEC [master].[dbo].[xp_cmdshell] 'bcp "SELECT * FROM [Yearly_Sales].[dbo].[Product_Sales]" queryout D:\Yearly_Sales\Product_Sales.dat -c -T -S'
    And the output I see in the file is:
    2010 Online Web Cameras Electronics 547 .00 0 .00
    The values before decimals are being truncated.
    Thanks,
    Bangaaram
    Known is a DROP, Unknown is an OCEAN.

    You can modify the decimal column(s) in the table to varchar type before export. But it does not look good.
    alter table [dbo].[Product_Sales]
    Alter column [Product_Amount] varchar(20)
    alter table [dbo].[Product_Sales]
    Alter column [Category_Amount] varchar(20)
    Does that make any sense?
    Known is a DROP, Unknown is an OCEAN.
    Basically you modify the decimal column to a varchar type before you run the bcp command for export. You can modify your source table or you can modify them on the fly. It is just a workaround.
    Modifying the source wouldn't be a good idea. Never do that if you can't get your desired output.
    Known is a DROP, Unknown is an OCEAN.

  • Can select, but cannot insert into oracle tables using php.

    I am having trouble inserting data into a tables in oracle using PHP. I can insert into the tables using baninst1, but nothing else. I can't even insert using the tables' owner. Every time I try I get the ORA-00492 error of table or view does not exist. However, I can run a select statement just fine. So far, baninst1 is the only user that can actually do inserts. I've triple checked all the table grants and everything is fine. Also, I can copy/paste the exact insert statement into SQL*Plus and it works with the correct user. It doesn't have to be baninst1. I've tried everything I can think of. I've tried putting the table name in quotes, adding the schema name to the table, checking public synonyms, but everything appears to be ok. I would greatly appreciate any suggestions others may have.
    I'm using PHP 5.2.3 with an oracle 9i DB.

    Here is the code that doesn't work. It works only with baninst1, no other username will work and all I do is change the my_username/my_password to something different. This is one example function where I try to do an insert, but it doesn't work on any of the tables I try.
    Thanks for looking.
    class Oracle {
         private $oracleUser = "my_username";
         private $oraclePassword = "my_password";
         private $oracleDB = "MY_DB";
         private $c = null;
         function Connect() {
              if ( !($this->c = ocilogon( $this->oracleUser, $this->oraclePassword, $this->oracleDB ) ) )
                   return false;
              return true;
         function AddNewTest($testName, $course, $section, $term, $maxAttempts, $length, $startDate, $startTime, $endDate, $endTime)
              $result = "";
              if( $this->c == null )
                   $this->Connect();     
              $splitIndex = strpos($course, " ");
              $subjectCode = substr($course, 0, $splitIndex);
              $courseNumber = substr($course, $splitIndex + 1);
              $insertStatment = "insert into szbtestinfo(szbtestinfo_test_name,
                                                                szbtestinfo_course_numb,
                                                           szbtestinfo_section,
                                                                szbtestinfo_max_attempts,
                                                                szbtestinfo_length_minutes,
                                                                szbtestinfo_start,
                                                                szbtestinfo_end,
                                                                szbtestinfo_id,
                                                                szbtestinfo_subj_code,
                                                                szbtestinfo_eff_term)
                                                                values( '" . $testName .
                   "', '" . $courseNumber .
                   "', '" . $section .
                   "', " . $maxAttempts .
                   ", " . $length .
                   ", to_date('" . $startDate . " " . $startTime . "', 'MM/DD/YYYY HH24:MI')" .
                   ", to_date('" . $endDate . " " . $endTime . "', 'MM/DD/YYYY HH24:MI')" .
                   ", szsnexttest.nextval" .
                   ", '" . $subjectCode .
                   "', '" . $term . "')";
              //return $insertStatment;
              $s = OCIParse($this->c, $insertStatment);
              try
                   $result = OCIExecute($s);
              catch(exception $e)
              return $result;
         }

Maybe you are looking for

  • HT204074 How do I re-associate a MacBook Pro to my Apple ID?

    Hey, Apparently - I have no idea how - my MacBook Pro has become dissassociated from my Apple ID. The primary symptom of this highly irritating situation is that content bought on other devices (using the same Apple ID) are now no longer available fo

  • Need help in automating text from xml into illustrator

    I have seen some examples of automation script for filling text from xml into illustrator, need some help in this matter. Need script (currently working in mac OS)

  • Ipod always changing symbols

    Hi, If anyone reads this can you please help. For about a week now, my ipod is not working. When i plug it into my mac the charge battery symbol comes up and then when i plug it into a power source the unhappy ipod face comes up. I have tried to fix

  • Assignment fields in edit mode in vf01

    Hi, Have requirement in  assignment fields in header of  vf01 as to make in Editable mode is there any  options in settings or through any enhancements(user exit name)  if there any please suggest how to do it. Regards, San Edited by: santosh jajur o

  • Java and Access

    Hi! I have one table "Student" and one "Course". They are connected via a many-to-many relationship. The database is Access. In the connecting table I register the grades the student get on a course. This works fine in some cases but not in others. I