Download resized image.

Hi all

I have the image of InputStream FileConnection (png, gif, jpeg), and I want to resize the image to a fixed size. So I want to download the image resized to my server.

I tried to use this method:

-created EncodedImage byte [], then the image with image.scaleImage32

-received the getData() EncodedImage byte.

-bytes are ok, but the image remains with the same dimension, because the scaling are applied only on phase decoding

I tried with this other method:

I used EncodedImage for scaling of the image
-obtained the image Bitmap to EncodedImage
-obtained the ARGB bitmap table:

Original image bitmap = rescaled.getBitmap ();
int [] argb = new int [original.getWidth () * () original.getHeight];
original.getARGB (argb, original.getWidth (), 0, 0, 0, original.getWidth (), original.getHeight ());
         
ByteArrayOutputStream Baos = new ByteArrayOutputStream();
DataOutputStream back = new DataOutputStream (baos);
        
for (int i = 0; i)< argb.length;="" i++)="">
dos.writeInt (argb [i]);
}

but the resulting byte array contains a correct picture of the data

Finally, I used an external JpegEncoder and pure j2me solution:

CreateImage image = Image.createImage (new ByteArrayInputStream (data));
ByteArrayOutputStream out = new ByteArrayOutputStream();
OutputStream nuoviBytes = new DataOutputStream (out);
Jpgenc JpegEncoder = new JpegEncoder (createImage, 100, nuoviBytes);
Return out.toByteArray ();

There is an approach purely BB (hopefully faster) solve this problem?

You can use the following class:

PNGEncoder

Here's how to use it:

PNGEncoder encoder = new PNGEncoder(bitmapRescale, true);byte[] imageBytes = encoder.encode(true);

Reference link:

http://supportforums.BlackBerry.com/Rim/Board/message?board.ID=java_dev&message.ID=736&query.ID=2939...

Concerning

Bika

Tags: BlackBerry Developers

Similar Questions

  • Resizing images on download APEX XE

    Hello

    I want to re-size of the images that are uploaded through a download process in my application. Is this possible?

    ordimage. Process is not available in Oracle XE.


    I'd appreciate any help.


    Concerning

    Dominic

    Maguzzi wrote:

    I checked the suggested links. My application is hosted in a shared environment, so my privileges are limited.

    I managed to prevent the download of images > to a size specified by checking HTMLDB_APPLICATION_FILES. DOC_SIZE.

    Is there a way I can check the Dimensions (width and height). ?

    I copy the details of the Image (FILENAME, FILE_OBJECT_ID, BLOB_CONTENT, etc.) of HTMLDB_APPLICATION_FILES to the MAG_IMAGES table in the download process. The following code works perfectly (if the record is not removed from HTMLDB_APPLICATION_FILES)

    SELECT ''

    of mag_images;

    I'm assuming that the file_object_id is the location of the BLOB the BLOB HTMLDB_APPLICATION_FILES object?

    What is actually in the file_object_id? The location of the BLOB? ,

    This just seems to be long around in circles. As another poster of the latter, you jumping from a question of XY to try another to get instant results vaguely defined rather explaining the requirements in a way that would lead to a solution complete. If you have provided:

    • A full description of your environment, including the restrictions imposed by the hosting provider.
    • Some information about the application and requirements: what it does; how he uses images; the number of images concerned; the necessary formats/quality of image etc.

    It would greatly help us to understand your problems and to identify the best overall solution.

    Start with, I've created a little demo app in your workspace on apex.oracle.com, which demonstrates how it is simple declarative use of BLOB support to download and display images. This includes:

    • Page 1: home page [now] CSS slideshow based on a classic report with a model custom. I started the evaluation and experimentation with CSS slideshows only as your current slide show implementation is a little rough on the sides of the client and the server. (It is a work-in-progress as the demo code is excessively complex and unsuitable for the implementation by their SUMMIT. "I'll try to look at the improvements/alternatives in the next few days).
    • Page 2: Interactive report on recorded images and metadata, which demonstrates:
      • Declarative online display images using the mask of BLOB format
      • Display of images to aid online procedureapex_util.get_blob_file_src
      • Declarative added column links to images to helpapex_util.get_blob_file_src
      • Change the display size and the appearance of images in report using CSS
    • Page 3: Form on the table of the image, which shows:
      • Upload image file in a custom table using declarative BLOB
      • Showing a small version of the image by using a part of the Image display
      • Adding a contextual overview of the image using a dynamic action and the Fancybox jQuery plugin

    I hope that this will get your application to use the built-in support of BLOB properly end-to-end and remove the dependency on APEX_APPLICATION_IMAGES. From this base, it should be much easier to move forward on the most advanced image, manipulation of subjects.

    For viewing the image as above is so simple and effective and eliminates the need for re-sizing of images and changing the dimensions etc...

    It may seem simple, but it is not effective and does not eliminate the need for resizing and the treatment of the uploaded images. All that (and the CSS method in my demonstration) is to specify the dimensions of the image that should be used when it is displayed in the browser. The entire image file is always downloaded, and the browser must perform operations by intensive calculation to resize to the specified dimensions. If you store images as 1280 × 960 1 MB JPEGs and have a report that shows 10 images per page as 128 × 96 presents a preview using a CSS rule, and then you will always download 10 MB of image per page view information, more of which is lost in the scaling. If you had 128 × 96 photos stored on the server, then the report could ask those and reduce the download size of 90%.

    Resize/resample the images on the server allows image-intensive applications optimize their use of bandwidth by downloading the files different image according to the size and/or the quality required for different purposes.

  • Resize image to download

    Hello world

    I created a Blog page on our site and am set up a page for anyone in the company to update the blog with some text and a picture.

    Someone know how to set the code, so when the button is clicked that it will resize the image automatically to what I want it to be with the size of the pixels and the size of the file? I think I have be 200 pixels wide and height is not serious. Maybe the size of the file to 4K or more. It would be like Facebook when you upload a large file image, but it resizes it automatically.

    We SEE version 7, so I can't use the CFimage code that is in the 8 and 9. I found called imageCFC.resize (), but I do not understand how to use it or to incorporate it in my code.

    That's what I have on my pages now just to download an image file:

    Add Page:

    < td > < input type = "file" name = "Image1" id = "Image1" > < table >

    Add the Action Page:

    < cfif isdefined "(form. Image1") >

    < cffile action = "upload" filefield = "Image1" destination = "#ExpandPath("BlogPhotos/")" # "nameconflict ="overwrite">"

    < cfset uploadedfile = "test_file\ #file.serverfile #" >

    < input name = "Blog_Image" type = "hidden" value = "#file. ServerFile #">"

    < / cfif >

    < cfquery Datasource = '#application. DataSource #">"

    Insert in the Blog (Blog_Image)

    Values ('#file.) ServerFile #')

    < / cfquery >

    I then simply show the image on my blog as image src file page.

    Thank you.

    Andy

    I ended up using the code ImageCFC and managed to make it work. I have incorporated in my file download also, so when an image is uploaded, it gets resized to the dimensions I want immediately whether. Here's the code that downloads the image in the right folder and then also has resized it immediately:

    "",

    "http://www.ironwoodelectronics.com/blog/BlogPhotos/#file.serverfile#,"

    "\\Maple\Ironwoodelectronics\blog\BlogPhotos\#file.serverfile#,"

    200) >

    Andy

  • Download the image to the server using the message parameter.

    Hello experts,

    I want to download an image on the server by using the post method with parameter alongsome such as file name, status, tag, deviceid, name of the device.

    Server taking some as windows credentials. I connect a .html page which, in my url, it must be all the parameter and in action, he goes to the .php file and it image upload server-side.

    I use this code, I have my tent for the last 3 days but I get no success.

    Please help me...

    My code is: -.

    private String httpConn (String file) {HttpConnection conn = null; OutputStream os = null; InputStream is = null; String url = ""; int respcode = 0; path of the Web service from which image will be transferred. URL = "" http://usertest[email protected]/admin/image_upload_iphone_app.html ";" Try {conn = (HttpConnection) Connector.open (url); conn.setRequestMethod (HttpConnection.POST); String name = "file:///" + file; FileConnection fc = (FileConnection) Connector.open (name); is = FC.openInputStream (); / * byte [] imgData = IOUtilities.streamToBytes (is); is. Read (imgData); * / byte [] ReimgData = IOUtilities.streamToBytes (is); Resize Image according to setting. Byte [] imgData = reszieImage (ReimgData); is. Read (imgData); String limit = "---14737809831466499882746641449"; String body = ""; name of the file... body = "\r\n--" + limit + "\r\n"; body & = "Content-Disposition: form-data; Name=\"filename\"\r\n\r\n"+"test.jpg '; body += "\r\n--" + limit + "\r\n"; tag... body = "\r\n--" + limit + "\r\n"; body & = "Content-Disposition: form-data; name =-"tag\" \r\n\r\n "+ 'tag'; body += "\r\n--" + limit + "\r\n"; status... body = "\r\n--" + limit + "\r\n"; body & = "Content-Disposition: form-data; name =-"status\" \r\n\r\n "+ 'status'; body += "\r\n--" + limit + "\r\n"; Device ID... body = "\r\n--" + limit + "\r\n"; body & = "Content-Disposition: form-data; name =-"deviceid\" \r\n\r\n "+"deviceid"; body += "\r\n--" + limit + "\r\n"; DeviceModel... body = "\r\n--" + limit + "\r\n"; body & = "Content-Disposition: form-data; name =-"devicemodel\" \r\n\r\n "+"devicemodel"; body += "\r\n--" + limit + "\r\n"; image... body = "\r\n--" + limit + "\r\n"; body & = "Content-Disposition: form-data; name =------'URL '; filename=\""+"test.jpg"+"\r\n '; body & = "" Content-Type: application/octet-stream\r\n\r\n ";" body & = new String (imgData); body += "\r\n--" + limit + "-" + "\r\n"; conn.setRequestProperty ("Content-Type", "multipart/form-data;" + limit); OS = conn.openOutputStream (); OS. Write (Body.GetBytes ()); OS. Close(); / * / / SEND the IMAGE int index = 0; int size = 1024; {System.out.println ("write:" + index);} If ((index+size) > imgData.Length) {size = imgData.length - index ;} os.write (imgData, index, size);} size of the index of +=; } While (index

    {0) {}} while(len>0); * / respcode = conn.getResponseCode (); } catch (Exception e) {e.printStackTrace () ;} Finally {//System.out.println ("closely connected"); try {os.close () ;} catch (Exception e) {} try {is.close () ;} catch (Exception e) {} try {() conn.close ;} catch (Exception e) {}} return Integer.toString (respcode);}}} }

    Concerning

    Pankaj Perron.

    It is a solution guys: -.

    see...

    http://wiki.Forum.Nokia.com/index.php/HTTP_Post_multipart_file_upload_in_Java_ME

  • Items 11.  Resize image tool does not work.  I tried to chat online with Adobe - no help.

    I recently got a new computer (pc) and decided to download 11 elements instead of the old version that was on my old computer.   I discovered that the image resize tool does not work, even if the other functions seem to work well.

    I tried an online chat with Adobe.  Their suggestion was to buy another picture of them for $10 service. / month!

    You talk of Image > resize > Image size?

  • Problem to resize images

    Photoshop Elements 8.0

    iMac OSX 10.8.3 32 GB memory

    (1) PE see only 2010 MB RAM

    I understand it is this exact PE, is - limit? Latest version of PE will support more RAM?

    (2) I can't resized images. It does not work: if I change 'with' or 'High', the 'resolution' is so changed. Save the image shows the image, as it was before you try to resize it.

    Also the 'Document size' does not show "pixels."

    I can't uncheck 'constrain proportions' (or other boxes).

    In general "resizing does not work.

    PE-8.jpg

    I used PE on my iMac previeus - no problem.

    I uninstalled and downloaded (EP 8) for my new iMac - but it doesn't (as explained).

    Any suggestion?

    1 no, all versions of PES are 32-bit applications and that's just how the 32-bit applications.

    2. If you want to change the pixel dimensions you must first activate the check-box resample. Even to constrain proportions, since neither of the two, to change the number of pixels in your image. It is generally a bad idea to try to transform an image by turning out to constrain the proportions. It will give you a distorted image, not a cropped. Use the crop tool to crop.

  • Resizing images in flickr, but I don't want it.

    I set up a flickr with LR3 connection, which is very cool. However he resized the image to 1024 x 768, although I have nothing put under "resize". Why it does this?  What do I need to configure to resize at 9000 pix and not expand so he can keep the original size?

    Set the resolution to 9000 x 9000 won't make any difference. Or at least it didn't for me.

    It could be a limitation of Flickr (no Pro account). This is may be different with a Pro account.size file is being downloaded if you resize output, but you won't know if you don't have a Pro account.

    Indeed, since Flickr site: only smaller (resized) images accessible (even if the originals are saved in case you upgrade later)

    This suggests that your original file size is being downloaded if you resize output, but you won't know if you don't have a Pro account.

  • Whenever I have download an image with the command "save the image under...". ", it records in a useless file of 168 bits.

    As stated, whenever I have download an image with the command "save image under" he recorded in a useless file of 168 bits. This does not happen everytime I have save an image, but more often the not, and I don't have a lot of useless files hang out because of this. Is it possible to re - download each image 168 bits that he should have been downloaded in the first place? Is it possible to ensure that this does not happen?

    Here's what it looks like:
    http://i.imgur.com/yzgwwgC.gif?1

    This means that you are not allowed to do this action.
    The site could use a transparent overlay image to protect the actual image or otherwise has put in place a protection.
    You can check if see you the image in "tools > Page Info > Media ' and save it.

  • Dialog box controls 'Settings' 'automatic resizing Image.

    I have a signature that contains an avatar image (size 120px by 120px)
    Whenever I have 'send', one 'Auto Resize Image' > 'Settings' dialog box appears
    How can I bypass this until it becomes annoying.
    Most emails (98%) are not all other images embedded or attached.
    It started to happen after the upgrade to the latest version of Thunderbird, has never been a problem before.

    Doesn't sound like a standard Thunderbird pop up as I fell on it.

    Do you by chance an addon /extension as Auto Resize Image?

    If so, disable it and retest to see if the message stops.
    Make sure you use a current version.
    check to see if there are some parameters you can use to "do not ask again" or similar. Cannot say exactly as I do not use it.

    I use the standard settings of TB to settle for sizing when I insert an image initially.

  • How can I download raw images in the photos of el capitan?

    How can I download raw images in the photos of el capitan?

    What camera?

    What happens when you try?

    RAW + JPEG you use?

  • Download problems image cable Canon camera

    I have a brand new computer laptop Mac Book Pro with OS El Capitan, and I am trying to download my pictures from my compact camera Gx1 to the laptop via the camera download cable. Of course I've already installed the Canon Canon Utilities Window /Camera of its CD image software (has been attached to the camera when it was purchased). (The Canon EOS Utility software, which I also installed it, is exclusively for my Canon EOS camera models). However, the download of the image does not work either.

    Images are downloaded into the folder Mac (program?) "Bilder" (*) (Images (?) in the version of Mac OS English?) where I certainly don't want to, I want to download my images in my own folder structure that distinguishes for example camera model/date photo taken/RAW files or jpeg etc. The folder Mac (program?) "Bilder" (Images (?) in the version of Mac OS English?) may be authorized to store the images simple iPhone 6s I take, but certainly not Raw files of my actual cameras!

    (*) "Bilder" (Images (?) a multicolored a little icon circle in the operating system Mac - Mac (program?) file

    The thing very strange, as the first two weeks of use my brand new computer computer laptop Mac Book Pro, the image download to the Mac via the cable from my camera Canon G1x worked as planned, but AFTER I once (the first time ever to purchase date computer I tried to upload pictures to my iPhone 6 s new Mac) I downloaded images to the Mac from my iPhone 6 s via the cable of the iPhone, the camera G1x download system image failed. I seems as if my download of images from the iPhone 6 s "Insider" start-up of the Mac OS (program) folder

    the 'Pictures' folder (Images (?) in English Mac OS version?) and the laptop Mac assumes that I want to download all the images, as for example my G1x camera RAW files in the 'Pictures' folder (Images (?) in the version of Mac OS English?).. . DEFINITELY NOT!

    I am terribly frustrated now and do not feel the I get any understanding or assistance from Apple support.

    This description of the problem will also be sent to the camera of Canon Inc., informing them of my issues with Mac OS El Capitan.

    Someone experienced with Mac, a friend of mine, said that "as usual, Apple"cache"the images and makes them normally inaccessible in the Finder. If you want to work wth them in another program (also), you must export the images of "Bilder" * (Images ()) - not at all practical, which means that two copies of images.

    Joined 9 screenshots - .png and .jpg files (. png files show how Mac views are displayed, show the .jpg files "how it should be regarded with correct download cables", the screenshots of the interface come however from a laptop with XP Home, not Mac OS operating system.

    The first two weeks of work with my Mac, the 'Download desired cable interfaces"WERE EVEN in what concerns the PC referred to above.

    Hi CanalogSE,

    Welcome to the communities of Apple Support! I'm sorry to hear you're having problems with your new Mac. You're talking about the 'Bilder' application seems to be the new application Photos, replacement of preparations on the previous iPhotos. If you wish, you can read more about it here:

    Apple OS X - pictures.

    Start with Photos for OS X - Apple support

    From your description, it seems that if you have connected your iPhone to import your photos, she may have inadvertently changed the overall picture import settings by launching Photos for the first time (since importing default photos for devices iOS in El Capitan's Photos). If you want to change the application for importing photos by default for when you connect your Canon Gx1 (for example, for the Canon software), you should be able to get rid of it in another application called Image Capture; I'm not clear what would be the name translated, but it should have this icon:

    Image Capture help

    In the Image Capture with your camera connected, you should see an option in the lower left corner to opens the connection this [device]: which will allow you to select your preferred; application If you don't see this, you may need to click on the the icon to display these options.

    Concerning

  • HP Compaq 8200 Elite SFF: Downloading an image from Windows 7 Pro 64 bit with product key

    I have this machine and the product key for the operating system, but WHERE I can download an image or a file with she understood EVERYTHING?

    I donot want to download 10-20 different parts... just a bump - but where?

    Hello:

    You can legally download W7 wherever you more unless you have a product key from retail full version, (including one on your PC isn't the case).

    The best thing to do to reinstall W7 would call HP at this number (USA/Canada) and order a set of W7 for your PC recovery discs.

    1-800-334-5144 PC serial number handy to give to the customer service rep.

    A set should cost about $10 mailed to class 1.

  • Loading/downloading the images from the camera

    I downloaded the images from the camera to the computer, then accidentally deleted from the memory card.  Move them back to the memory card?

    I downloaded the images from the camera to the computer, then accidentally deleted from the memory card.  Move them back to the memory card?

    =====================================================
    FWIW... this task is easier to do than to explain.

    (1) connect the camera via a USB cable and turn it on... or insert the memory card in
    your Media Player.

    (2) go to... Start / my computer... your camera should be attached to a drive letter.
    The reader should be recognized as one or several removable disks... it can
    have several drive letters.

    Removable disk (e :))
    Removable drive (g)
    Removable disk (h :))

    Left 3) click on drive letters... When you identify the drive letter for the camera or
    Media Player... (it will be one that does not launch a dialog box indicating:)
    Please insert a disc in the drive?) ...

    Follow these steps...

    4) navigate to the folder in which the photos are... Open it and go... Edition/select all... good
    Click the group selected (highlighted), then from the menu choose... Send to /.
    Removable disk?

    Only a limited number of files can be copied to the root directory of the card... if you
    Transfer lots of pictures... they must be in one or more folders.

    If these files have been changed in any way, rename, rotate, changing the brightness...
    No matter what... the camera will recognize them is no longer, but they will always be on the map
    If you want to use as a backup. You can click on the left to see what is on the drive letter
    the map.

    Volunteer - MS - MVP - Digital Media Experience J - Notice_This is not tech support_I'm volunteer - Solutions that work for me may not work for you - * proceed at your own risk *.

  • Windows Movie Maker is not let me download Flip images because I don't have the correct codec?

    I have a Flip video Ultra, model U112OB, and I am trying to download his images on my PC so I can modify it with Windows Movie Maker.  But whenever I try to bring it on movie maker it says: the F:\DCIM\100VIDEO\***+ file. MP4 cannot be imported because the codec required to play the file is not installed on your computer. If you have already tried to download and install the codec, close and restart Windows Movie Maker, and then try to re-import the file.

    I visited a websight to support customer flip and ordered to download online with windows, but I was not able to find what I'm looking for.

    Any Suggestions?

    First... Download the video in a folder on your hard drive.

    There is some info on the following link:

    Movie Maker and Flip digital camcorders
    http://www.Papajohn.org/mm2-CamcordersFlip.html

    (FWIW in Windows Live Movie Maker 7...) MP4 files
    should be compatible)

    Then, convert the video to the. WMV format.

    There are many programs that can do conversions...
    The following freeware is an example...:

    (FWIW... it's always a good idea to create a system)
    Restore point before installing software or updates)

    Format Factory
    http://www.videohelp.com/tools/Format_Factory
    (the 'direct link' is faster)
    (the file you want to download is: > FFSetup260.zip<>
    (FWIW... installation..., you can uncheck
    ('all' boxes on the last screen)

    First, you will need to decompress the file or just open the
    Drag FFSetup260.exe out of the folder
    and drop it on your desktop. To install left click.

    Next, after the download and installation of Format
    Factory... you can open the program and
    left click on the toolbar, the "Option" button and
    "Select an output folder to" / apply / OK.
    (this is where you find your files after they)
    are converted)

    Drag and drop your video clips on the main screen...

    Select "all to WMV" / OK...

    Click on... Beginning... in the toolbar...

    That should do it...

    Now, the clamps must be compatible with Movie Maker.

    Good luck.

  • Help! I can't download recovery image to my PC from dell website system drivers

    I am trying to download recovery image from my PC operating system from the site of uk drivers dell under the product I own (inspiron aio 7459)

    Whenever I try to download the image, it will fail in the middle and the entire image file is corrupt, it always happens when I try to download the image and I seriously need this image. My PC has now gone unstable, I had to do a clean install of windows 10 but after a few months he gets corrupted with a lot of disk errors, this pc worked perfectly without error before that dell was told to remove the recovery partition, support technique dell ruined my computer.

    Can someone help me please? How can I stop it failing in the middle of the download?

    I feel like this system recovery is my only hope to get my PC to its State as if it was when I got this PC.

    (If it is not sorted then I am more satisfied with my PC and will just return it and get a refund, because even the technical support help not out me and rather corruption telling me I have to pay for the mistake, they did what I never do!)

    It's ok now, what I've done, is download the image of the system at midnight because fewer people using the internet and therefore less traffic to interrupt the download.

    I downloaded it at midnight and he succeeded, so for those struggling to download an image system for their PC, I'd download it somewhere near the off-peak hours.

Maybe you are looking for

  • Qosmio G30 repeatedly "blue screens".

    My G30 - 153 blue screens on several occasions in recent times.It will re-start blue screen then again after some time. I tried to recover with the recovery CD, but it before blue screens that can fill.My colleague considers that the fan does not wor

  • How do the drivers for the CIF single chip (FREE) web

    I need a download a driver for CIF single for my web cam (FREE) if possible and compatible with XP

  • Sansa Fuze frozen

    I recently bought a Sansa Fuze 2 GB and it has worked well up to that earlier. I add music to my laptop and it said there was a synchronization error so I plugged not Mp3. Now, he is frozen and says simply 'written' with a blue circle. My battery is

  • Netflix cannot show films due to server or proxy server problems when using Windows Media Center. How can I solve this?

    I can access Netflix without a problem, but when I select a movie to watch and click on play, a window opens stating could not display the page, the server is not responding or is something wrong with the proxy server.  Try again later or contact you

  • T120 network connection

    Just bought a DesignJet T120.  I can't get it get an IP address via a wired connection.  Each Hp Printer acquires IP after a minute or two, I installed.  This printer will not.  I changed the ethernet cable, ran a direct link to the switch with no re