Save as Image JPG of the Playbook

Hello

I want to save the image bitmap Air application in JPG image. I use the JPEGEncoder Adobe. The app works well in the Simulator and also real playbook. He asks for the save image dialog box and the name of the image on the playbook, but the image is not saved on the playbook. The same code works fine on the desktop and records the images accurately.

I am using Flash CS5

package
{
    import com.adobe.images.JPGEncoder;
    import flash.display.Bitmap;
    import flash.display.BitmapData;
    import flash.display.Sprite;
    import flash.events.IOErrorEvent;
    import flash.events.MouseEvent;
    import flash.net.FileReference;

    public class Main extends Sprite
    {
        private var testBitMap:BitmapData;
        private var bitmap:Bitmap;
        private var file:FileReference;
        private var jpg:JPGEncoder;
        private var btnSprite:Sprite;

        public function Main()
        {
            testBitMap = new BitmapData(320,240,false,0x0000FF);
            bitmap = new Bitmap(testBitMap);

            btnSprite = new Sprite();
            btnSprite.addChild(bitmap);
            addChild(btnSprite);
            btnSprite.addEventListener(MouseEvent.CLICK,btnDown);
        }

        private function btnDown(e:MouseEvent):void
        {
            trace("clicked");
            jpg = new JPGEncoder(100);
            file = new FileReference();
            file.save(jpg.encode(testBitMap),"flash.jpg");
            file.addEventListener(IOErrorEvent.IO_ERROR,error);
        }
        private function error(e:IOErrorEvent):void
        {
        }
    }
}

Any ideas what goes wrong or any other solution to save the creation as image on Playbook?

Thank you

Patrice

Nice try but that is the wrong syntax, suggest that you can find a tutorial on the parameters and features of the playbook

access_shared

It is the correct syntax.

Tags: BlackBerry Developers

Similar Questions

  • How to save png or jpg in the library of Cloud?

    I have the idea that you simply move the objects of applications and it is in the library. However, if you wanted to Sage png, JPG, which are the exported on, PSD? It seems that if you import the png and jpg in, PSD or INDD and make them slide library, he adds that if the asset has been created in this program. Web browsers don't support not add them to the library - only when you purchase or download stuff on the market. You can add them through Bridge.

    At a time I remember being able to do this and use the asset in any application, but it seems that the feature is gone. Any help would be appreciated.

    And run an error that says "image type is prohibited" appears when you try to attach a screenshot here. So I hope that someone understands what I'm looking for help with.

    I do not work for Adobe. Generally, you will find personal Adobe in the forums.

    (1) "it seems that if you import the png and jpg in, PSD or INDD and make them slide library, he adds that if the asset has been created in this program.» This is how work CC libraries. For example, if you place a JPEG file in InDesign, and then drag the JPEG as well as InDesign libraries CC illustrations he does not keep a link to the JPEG file. You should incorporate the JPEG format in the InDesign file. When InDesign copies to a library, it includes a file of extract (useful for back into InDesign, where it can be restored) and a PDF file (useful if you place it in Illustrator or Photoshop).

    Then to circle back to your original question, "How do I save png or jpg in the...» Library? "You open them in Photoshop and let them slide to the library.

    (2) ' the web browsers don't support not add them to the library - only when you purchase or download stuff on the market. " You cannot add them by bridge. "Web browsers or bridge are currently part of a CC library workflow. As the diagram at the beginning of the first reference I gave you has pointed out, library workflow is based on the implementation of CC CC desktop applications and mobile applications and use the work in mobile applications and desktop applications.

    (3) "and run an error that says"image type is prohibited"appears when you try to attach a screenshot here.» You are running within the limits of the Jive, which is Adobe software licenses to run the forums. Only files such as PNG or JPEG can tie in the window using the "camera" icon image.

  • I can't save an Image file on the local disk

    Hello, I'm under this simple app to save an image on a local disk.

    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical">
    <mx:Script>
    <![CDATA[
    
         import mx.core.UIComponent;
         import mx.graphics.ImageSnapshot;
         import mx.controls.Alert;
         import mx.rpc.events.FaultEvent;
         import mx.rpc.events.ResultEvent;
         import mx.graphics.codec.JPEGEncoder;
         import mx.events.ColorPickerEvent;
         import mx.controls.Alert;
         
         
         import flash.display.Sprite;
         import flash.events.*;
         import flash.net.FileReference;
         import flash.net.URLRequest;
         import flash.net.FileFilter;
         import flash.net.FileReferenceList;
    
    
         public var aux1:int = 1;
         public var file:FileReference;
    
        private function capture():void{
              var jpgEncoder:JPEGEncoder = new JPEGEncoder();
              var bitmapData:BitmapData = new BitmapData(image.width, image.height);
              bitmapData.draw(image);
              var ba:ByteArray =  jpgEncoder.encode(bitmapData);
              
              file = new FileReference();
           file.save(ba,"image.jpg");
                
         }
    
    ]]>
    </mx:Script>
    
         <mx:Image id="image" maxHeight="600" maxWidth="800"/>
            <mx:Button label="Save file" click="capture()"/>
    
    </mx:Application>
    

    But when a running the application, in this line:

    file.save(ba,"image.jpg");

    I get this error:

    "1061: call to a method may not set save through a reference with satic type flas .net: FileReference.

    Please, what can I do?

    Thanks in advance,

    Pedro

    The feature that you want to use is specific FP10, to access, you need to include the playerglobal.swc of FP10 in your construction. FlexBuilder should do this automatically if you go to project-> properties-> Flex compiler and "Need Flash Player Version" value 10 or later.

    You can find versions 9 or 10 playerglobal.swc in "\frameworks\libs\player\". If I remember correctly, the first version of the SDK supported by FP10 was 3.2.

  • How can you save 2 images exprted of the Organizer in Photoshop format?

    Hello
    I selected 2 images from the organizer and switching in the editor. When I save the file and then reopen it later, only 1 of the images appear in the photo tray. How to stay there? Thank you

    You can leave it open in the image editor. You must select both again in the Organizer.

    If you do not close in the editor, you will see a red bar on the thumbnail of the Organizer "Edit in progress"

  • Why can't I save an image resized in the new size and the new CIO?  This just started happening 2 days ago.

    I have not been here before.

    For some reason any crazy when I try to save an image resized with a different dpi, PS6 says I saved.

    But if I'm going to re - open the same image, its in a different (but proportional) size and its original dpi.


    I also have the PS3 and if I open the image resized in the PS3, it opens in the new correct size and the new DPI!


    What is the problem with my SP6?


    Apparently her you open cab (and the resolution is there, in the blue link under the main image window).

    The default value of the cab was 240, now it is 300.

  • Save RAW as jpg in the original script file

    Hello

    1.

    I'm looking for advice for the rest of the script process.

    -Make changes to a series of images RAW (multiple files in multiple folders)

    -Save each set of RAW to JPG files in subfolders in the original folders. (plan B - it's ok to save in the original folders)

    -Close Photoshop

    2.

    Is it possible to apply a script when images are added to a directory or something like that, so that I can trigger the script in some way?

    Better and thank you in advance,

    / :-) Andreas

    If the Raw file records are a branch of the file system. in other words there is a root folder where all other raw files folders are subfolders of a branch.  X wrote this script for you. You can search Image Processor Pro download and install it.  Photoshop menu File > Automate > Image Processor Pro...   Its a plugin script and sound where other plugin is in file > controller.

  • Scalable Images (jpg) for the web.

    Sorry, but not looked at of course that this would even be the reference.

    I came across sites that have drag images (without flash) and no matter how small make you the web browser window, the image is reduced to fit or develops, according to what you do to resize the browser window.

    Pulling the bottom of the image, the sizes are huge 1900 x 1267 and some are not set at 72 dpi but 96 dpi.

    I mostly use Photoshop CS4 to export jpg files, but y at - it another way? Made it through Fireworks? How can I watch the way in which the image has been saved on these sites?

    Thanks in advance for you help.

    Yankees10 wrote:

    .. few are not set at 72 dpi but 96 dpi.

    "dpi" has no effect on the web images. Ignore it.

    To see the original image, right-click on it, save to your computer, see Photoshop.

    These images to scale through a simple setting in HTML/CSS. There is nothing special about the image file.

  • Colors of the images.jpg/.gif the. CHM and true (4BPP/8BPP) levels of grey in printed output?

    I do all my HR WinHelp first, then exit and Word 2003 document is created. I want to keep the color images in the CHM and that a majority of images become true monochrome gray in the Word doc.

    Yes, Word has an optopn of the OWL 'gray levels' for each image, but it leaves the 'channels' (24 bits per pixel) color and so our color copier prints always page using all colors CMYK (and it never seems to get 'real' grays anyway...)

    If I could somehow get the images to monochrome grayscale in HR, where there are already ones colors - I could save it as 'monochrome' and 'color' outputs.

    Ideas, tips, comments, suggestions, or batch files?

    Thank you!

    On reflection... it's the Fiery controller in the copy machine that makes all decide that what are the components, and unfortunately "it's not my Department', so at this point, the question is moot - this isn't an HR issue.

  • problem by sending the image (.jpg) in the regions of wifi network


    no response from the body, okay, I got solution my self.

  • Save an image as a .ico file

    I try to save an image (jpg or pdf file) as an icon to add to my calendar program - I can't seem to find a program that will allow me to save as .ico - any direction would be appreciated

    You must convert the .jpg in .ico using a program that can do it. I don't think you can convert a PDF one .ico as .pdf is not an image file.

    Try IrfanView - it's free and it's great. http://www.IrfanView.com MS - MVP - Elephant Boy computers - don't panic!

  • is it possible to save an image downloaded from net?

    Hi I need to save an image downloaded from the net? How can I make it possible? is it possible to result in the RecordStore? and then use it later when we want?

    am in a difficult deadline please help me!

    Hello

    use code below...

     String Imagedirectory= System.getProperty("fileconn.dir.photos");
    
                try
                {
                    System.out.println("Imageurl="+imageurl.trim());
                    HttpConnection ImagehttpConn = (HttpConnection)Connector.open(imageurl);//,Connector.READ_WRITE, true);
                    ImagehttpConn.setRequestMethod(HttpConnection.POST);
                //  ImagehttpConn.setRequestProperty("Content-Type", "Image/jpeg");
    
                    int status= ImagehttpConn.getResponseCode();
    
                    if(status== HttpConnection.HTTP_OK)
                    {
    
                        is = ImagehttpConn.openDataInputStream();
    
                        StringBuffer Imagedata=new StringBuffer();
                         int chr;
    
                            while ((chr = is.read()) != -1)
                            {
                                Imagedata.append((char) chr);
                            }
                            System.out.println("Imagedirectory"+Imagedirectory+imagename);
                            writeFile(Imagedata.toString().getBytes(),Imagedirectory+imagename);
                        }
    
                    if(is!= null)
                    is.close();
                     if(ImagehttpConn!=null)
                         ImagehttpConn.close();     
    
                }
                catch (IOException e)
                   {
                    Dialog.alert("IOException2");
    
                } 
    
    and this for write the image //
    
    private void writeFile(byte[] data, String fileName)
          {
                FileConnection fconn = null;
                try {
                        fconn = (FileConnection) Connector.open(fileName,
                                        Connector.READ_WRITE);
                } catch (IOException e) {
                        System.out.print("Error opening file");
                }
    
                if (fconn.exists())
                        try {
                                fconn.delete();
                        } catch (IOException e) {
                                System.out.print("Error deleting file");
                        }
                try {
                        fconn.create();
                } catch (IOException e) {
                        System.out.print("Error creating file");
                }
                OutputStream out = null;
                try {
                        out = fconn.openOutputStream();
                } catch (IOException e) {
                        System.out.print("Error opening output stream");
                }
    
                try {
                        out.write(data);
                } catch (IOException e) {
                        System.out.print("Error writing to output stream");
                }
    
                try {
                        fconn.close();
                } catch (IOException e) {
                        System.out.print("Error closing file");
                }
            }
    
  • I would like to know the command line options that are available to mspaint. I in bulk of images, I want to open in paint and then save it in jpg format in the paint.

    Hello

    I would like to know the command line options that are available to mspaint.
    I in bulk of images, I want to open in paint and then save it in jpg format in the paint.
    I want a script batch for the above procedure. Can anyone suggest me the script to do the same.

    Thank you
    Bodin

    original title: ms paint command line options

    Neither Windows XP nor paint offers all these capabilities.

    "BinduS" wrote in the new message: * e-mail address is removed from the privacy * _xp...

    Hello

    I would like to know the command line options that are avaulable to mspaint.
    I in bulk of images, I want to open in paint and then save it in jpg format in the paint.
    I want a script batch for the above procedure. Can anyone suggest me the script to do the same.

    Thank you
    Bodin
    - http://answers.microsoft.com/message/04b8dfae-1fa5-42db-81c2-b042652ecfc8
    Meta tags: images; windows_xp

    Tuesday April 10, 2012 08:23:14 + 0000: CreateMessage BinduS

  • When I right-click to save an image it won't let me save the image otherwise that as "all files".

    When I right click on an image to make a backup because it won't let me save the image in jpeg format, what is on the menu drop-down is "all files" that records under a bunch of numbers and letters, etc. It save it as an aspx file.

    Try to add the .jpg file extension yourself if Firefox does not when you save an image file.

    If you have already saved images with an incorrect file extension, then rename them and add a .jpg file extension. Check the properties of the file via the context menu to see if that worked.

  • How can you save only the image and not the whole page?

    We decided to use a tool to manage all media (mediastore), including Adobe illustrator files. Our mediastore display objects as thumbnails (small images) and is able to export in different formats, such as jpg images.

    The problem we have is we see the page through this mediastore, not only the image that we have learned with Amnesty International. So on the tile sometimes we see nothing because the image is small on the page (we see a small black spot on an empty table) and when we send the image (export), receivers had to crop the image to get only the photo...

    Y at - it HAVE any option to save in a format, but with photo only?

    We want to keep th HAVE format, because we want to be able to edit it with AI if we need to change.

    Example of tile:Example_AI_vignette.png

    Is this too much problems to scale the work plan to adapt to the work? When you're in "Modify the work plan" double-click on a group given image automatically dimensionnera the current work plan to adapt to the work.

  • When I add text to an image that starts as a RAW file, I have no problem. When I try to add text to an image that is only a jpg file, the size of the text is extremely low. Even when I change the the font size to 72 pt, it is always small. How can I fix i

    When I add text to an image that starts as a RAW file, I have no problem. When I try to add text to an image that is only a jpg file, the size of the text is extremely low. Even when I change the the font size to 72 pt, it is always small. How can I fix it?

    You set the font size to a size that is suitable for the size of the document.   Size of the document may vary everywhere.   To resolve this problem in action, I solved in scaling the document to a known size then use a font suitable for a document of this size.  When you resize an image using size with resample Images not only checked a single pixel is change everything that is changed is the DPI image resolution setting.  So if you size a picture 8 "wide you choose a font size is good for wide image 8" the Save action.  To work around the problem of changing the size of the printing I wrote a Script to use in such an action.  The script is used twice, there is a backup and restore script.   The first time that the script is used the script records the resolution DPI images in the metadata documents.  The second time that the script is executed, it retrieves the registered PID parameter deletes the record of metadata from images and set the DPI images that had been saved.    If the use of fonts for the document 8 "will be resized to fit the print original size.

    In a script, you can calculate a correct font size to use.  Actions cannot retrieve information or use logic. They need to use the Plug-ing and Script where logic is needed.  When you make using Photoshop UI you use your eyes and brain.

    Package of shares of crafts UPDATE August 10, 2014 added conditional measures Action Palette tips.
    Contains

    Example of
    Download

Maybe you are looking for