How to upload BitmapData in flex 4 to server with preloader? - file-upload

Hy,
Im creating a upload component that do these things:
select multiple images
convert to BitmapData
resize if is too large
create a thumb(itemRenderer) and add it to a list
And the problem is how to upload them with a preloader for each image when a button is pressed. Anybody know how to do it?
thanks ;)

You could use the FileReference.browse() method to select the images and then upload them by using the FileReference.upload() method. That allows you to show an upload progress bar for every image.
FileReference class

Related

How does image sizing work?

I'm not the best at using bootstrap but trying to learn. I have a row and 3 col-md-4's I put a image in each column and they look and fit great with the thumbnail class. But without that class the images are their full size and overlap and when I scale the browser down they stay big and you have to use the scroll arrow. I thought the col-md-4 would determine the display of the image but it seems not. When not using the thumbnail class do I have to just resize my photos to the size I want them to display? Please help me understand. Thank you
Try using max-width="100%" (or the class img-responsive). See the bootstrap docs for more info.

Do repeated images increase the loading time of a website?

I'm trying to optimize the loading time of my website.
Does requesting the same image in different places of the code increase load time?
For example, I'm using an image as background of a button and I'm loading the same image in different places of the website.
Is this a problem or since the file is the same in all the buttons the browser only loads it once?
If it's a problem, how can I optimize it? Thanks a lot!
no, repeating the same image multiple times should load it only once. You could even go further and actually use css sprites to have multiple images in one (one image which is a grid of images as a background within a smaller containing div and move it around with background position property)

XAML event for background image rendered off screen

I am setting a background image on my XAML Grid with a Uri. The Uri points off to a HTTP url, where it will fetch, and then render the image as a background for a Win8 metro app.
I've been trying to figure out if there is an event or something I can hook into to let me know that WPF has loaded it into memory, AND finished rendering it out of view.
Currently, a small image will load fast enough, and smoothly fade in. However, if I load a larger, slower image, it will take 100s of ms to show up as the background, which means it either pops up mid-fade, or after the fade effect has completed. This looks quite poor.
The goal is to have a fade transition between app pages (I already have this), without the inconsistency of the background image popping up whenever it's done.
Any suggestions would be welcomed.
You don't say exactly how you're loading the image but there's a DownloadCompleted event on BitmapImage, e.g.
BitmapImage bmp = new BitmapImage(imageUri);
bmp.DownloadCompleted += ReadyToDisplay;
Like Phil said, but then for Windows Store apps:
BitmapImage bmp = new BitmapImage(imageUri);
bmp.ImageOpened += ReadyToDisplay;
ImageOpened Occurs when the image source is downloaded and decoded
with no failure. You can use this event to determine the size of an
image before rendering it.
source: MSDN

Objective C, Download a photo from web and show as a full screen

Let's say I have a thumbnail image and I have an original image(about 1200 * 1600) on my server. What is the best way for users to see the full screen of the original image on iPhone?
I could send HTTP request to download the image but how can I show the image on the full screen? Also. If I download the full size image then is this bed for memory management?
Use a UIImageView in your UI, download the fullscreen image to disk, create a new image using UIImage's imageWithContentsOfFile:
+ (UIImage *)imageWithContentsOfFile:(NSString *)path
and eventually assign the image property of your UIImageView instance to this newly created image.
To download the fullscreen image, do not use synchronous methods like NSData's dataWithContentsOfURL or it will block your UI. Instead use the asynchronous methods of NSURLConnection.
See the Loading Data Asynchronously section of NSURLConnection Class Reference.
The full image seem to be appr. 12 times larger than the standard iPhone 320x480 screen. I think you can pre-render a down-scaled image to download for this and not feel about that.
Automator is a simple way to batch process this for you. See this vid.
http://www.youtube.com/watch?v=q7p081Ui9WY

Save edited image to the iPhone gallery

am working on an app where i am loading one image from the bundle and with the help of quartz i am adding two red circles on that image, the image is loaded in the instance of the UIImageVIew class.
I want to save the image with the red circle, so far i have found only one method and thats
UIImageWriteToSavedPhotosAlbum(UIImage * image,id completionTarget,SEL completionSelector, void * contextInfo)
but its not working as it is saving the image from the bundle only, in some post i have read that it can be done using CALayer but i found no useful link to do that, i would be glad if you can post me the answer or any tutorial link to do that.
Here's a trick! Refer to Capture UIView here, you can capture the UIImageView snapshot and save it using UIImageWriteToSavedPhotosAlbum.