I'm trying to load preview thumbnails of high resolution images and the application needs to be able to load 100 hi rez images at one time. The only way i know how to do this is if I use the Loader class and I have to load the ENTIRE file and then scale down the image and use the data as an image preview.
what i'd like to do is use imagemagick (or some other efficient image manipulation lib) to compress the image and return that result (without saving it as a file first... that would be optimal) back to my AIR application so that i can use it as a preview. This would be AWESOME.
Thanks in advance.
CommandProxy by Mike Chambers. Look it up (http://www.mikechambers.com/blog/2008/01/17/commandproxy-net-air-integration-proof-of-concept/). This nifty trick allows you to have a conversation between AIR and non-AIR apps.
Still have questions? Let us know.
Related
My meteor application need to be enriched with an image upload functionality. Since many free image upload services exist, I thought the best way of doing it would be by using an existing image upload service. My choice fell on imgur. I guess I somehow have to use imgur's image upload API, but this looks completely alien to me.
Here are my questions:
Is imgur appropriate for what I want? Do you know a better or simpler solution?
How do I upload an image to imgur from my meteor application?
You can assume that the image file comes from an html file input tag. Later on, when the mobile app catches up, the image should come from the camera, but let's just tackle one difficulty at a time.
FSCollection will be a great option here, you can use grids (to store images on the db) or use fs(to store in certain path)
For better explanation i made this tinny demo here is the DEMO and the code
Also i made this example using the progress bar, again here is the link to the DEMO and Source Code
A simpler solution would be to just store images in MongoDB or your filesystem using CollectionFS along with cfs:filesystem for your local file system or cfs:gridfs for MongoDB. The docs are clear and simple enough to get you up and running quickly.
If you wanted to use imgur, you'd need to be able to POST data and understand what you're doing. CollectionFS has a methods package which adds an HTTP POST method to Meteor, but honestly I think that'll just complicate things for you at this point. Keep it local for now.
I have downloaded some icons but they all come in .psd format. I'm new to all this, how can I use the individual icons in this way? There are about 20 of them on one sheet.psd?
Do I need to use photoshop? What do I have to do to get individual icons from this to use?
Thanks so much!
GIMP is the best out of the listed alternatives for actually manipulating your file after it's opened, which it sounds like you're planning to do. In my experience, it is an excellent replacement for most of Photoshop and Illustrator. YMMV.
The link to Photoshop alternatives doesn't mention a few important caveats.
Your OS may not recognize GIMP as being able to open .psd files, but if you open GIMP then use its open command, the file will open.
If the .psd is in the CMYK colorspace, you may need to download a plugin. If so, be warned that colors may change slightly (or not so slightly) and this will matter if you're sending it to a printer or to another designer who will make further edits in Photoshop. If so, do a test print, warn the other designer, and/or find a computer with Photoshop.
Not all capabilites of Photoshop are correctly converted (I'm looking at you, Paths!), so be sure to save to GIMP's native .xcf format and inspect the details of the icons you're interested in, then make your modifications from there. In particular, moving a Path in GIMP will not move its Stroke, this must be done manually.
If you must crop, crop to each icon then save-as to its own .xcf, then export to JPG or other formats as needed.
You might not have to crop the image depending upon your use. Often, web designs load a large picture with all the icons on a page, then do the cropping themselves, and if you resize the file you may break that functionality. If so, the .psd you have represents an "Image Sprite"
Go to a computer with Photoshop, and crop the image into multiple png icons.
Alternatives to photoshop:
http://www.makeuseof.com/tag/the-best-ways-to-open-a-psd-file-without-photoshop/
Is there any way where i can create a thumbnail image from a flash movie file(flv /swf) [NOT FROM A VIDEO File ] in ASP.NET ? Any samples of implementation ?
you can use ffmpeg to create thumbnails of the flash video
For .flv you can use ffmpeg to convert parts of the video (e.g. one frame) into an image (sequence)
I've used it as command-line application by calling Process.Start(), but there is at least one wrapper for .NET (I haven't tested it myself):
http://www.codeplex.com/ffmpegdotnet
For .swf I don't know any way to achieve this without some Adobe tool.
for flv it can be done easily, as others mentioned ...
for swf, it depends HIGHLY on the swf ... if the swfs visual appearence is determined by code, there is no other way than to embed a flash player in you app and either let the flash player make the snapshots, encode them as JPEG/PNG, and send them somewhere using TCP or LocalConnection (a flash<->flash communication connection, which can be used with C# as well) or try to somehow grab its output buffer yourself ... the first possibility should be no more than 10-20 lines of actionscript code ... don't know about the latter ...
other than that, you might use an external command line converter ... there are a few floating around the web ...
greetz
back2dos
Take a look at this article, it should point you in the right direction. It uses SharpFFmpeg to extract thumbnail images from movie clips from a variety of formats.
the only way to get an image, is to use a full flash client that starts playing and allows you to capture the first frame.
I would take a close look at flirt (they actually have an example that renders pngs)
Maybe some of the other flash libraries may be of help ( swfdec gnash swift tools gplflash)
Gnash is probably the best choice since its the most mature project out there, but i do not know how easy it is to integrate into command line tools or into your own projects.
We have been working on this in my company, and we got a proof of concept working pretty fast (but the project we made it for is on hold right now). I am not able to share the code, but I can give you some pointers.
It is not pure ASP.NET, but maybe you can still use it. We made a windows service that can be called from ASP.NET.
Basicly you install the flash plugin on the server, the windows services can then simply open the swf through the swf ActiveX component and then you can grap a picture of the whole thing. It works pretty well, notice that you do not have to actually render the ActiveX component on screen to capture the picture.
Check out this post. It does not tell you everything but I guess it provides the ground work required for it. You probably have to figure out how to get the object tag out of the flash-html you are trying to download from a web page. After that you'd have to figure out when to capture the frames. Its a long ride however. You don't need the asp.net part. Just concentrate on the windows project part. Hope this helps. :)
I'm looking at ways to embed PDF viewing in a Flex application.
Currently the only option I've seen is by using the flash.html.HTMLLoader class, which only works if you're using AIR. This isn't a big deal -- I'm willing to use AIR if I have to -- but based on my experimentation with viewing a PDF this way it appears that AIR simply integrates the embedded Adobe PDF browser Plug-in for viewing, which not only shows the PDF page(s), but provides all of the manipulation controls as well (zooming, printing, etc.) which I don't want to see.
I'm looking for something that works somewhat along the lines of the JPedal library for Java -- an embedded component that simply renders the PDF alone.
Has anyone found a way to do this with either AIR's built-in component or via some other method?
There are a couple of ways, but neither actually have the PDF in the Flex App:
Convert the PDF to SWF. Use this tool or one like it to convert the file over.
Use HTMLComponent, a method that uses an iframe over your flash/flex to make it appear like an external page is in your app. There are a few downsides to this method however - most of them described in detail at Deitte.com.
What you want is possible with AIR and described in this Adobe article:
http://www.adobe.com/devnet/air/flex/quickstart/scripting_pdf.html
Take a look at http://www.adobe.com/devnet/flex/quickstart/embedding_assets/ and see if it helps.
I don't think you can embed PDF files directly (but I'm not really sure) but if you totally need to do it and you don't want to open a new window you could convert the PDF to another format that can be inserted in your app.
If your goal is to simply display the PDF in the Flex environment then you could use the IFrame approach. You can find an example here http://www.deitte.com/archives/2006/08/finally_updated.htm
By using this approach you can load any HTML content which includes PDF's.
Take a look.
Okay guys here is the exact one we're looking
http://subinsugunan.blogspot.com/2009/06/embed-pdf-in-flex-application.html
Looking for a way to display a PDF in Flex. I'm sure there are several ways. Looking for the easiest to maintain / integrate / most user friendly. I'm guessing it's possible to display a browser window in the app and render it, but if it goes off of IE / FireFox it's not acceptable for this project.
Thanks...
This looks like a nice PDF viewer for flex http://www.devaldi.com/?p=212
We just did a large AIR app that used PDF quite a bit - make sure you save yourself some heartache and write some code to check the acrobat version or that it's even installed - if they don't have it you won't get an error, just a blank HTML control.
I know, it sounds obvious, but still...
Sorry to say so, but convertion PDF to kind of swf of flash things... doesn't that kill the PDF thoughts ?
I mean, PDF should be electronic paper right ? When creating a SWF file out of it, you just destroy that. No more editing, no more filling out a form.
The strange thing is, that PDF is an Adobe product... and Flex (Flash Builder) is a Adobe product.
Two products that Adobe wants to be world dominator off. But combining PDF into Flex... is not standard.
Check out: http://www.swftools.org/ for tools to convert your PDF to SWF, speifically pdf2swf- http://www.swftools.org/pdf2swf.html
Check out Share on Acrobat.com, there you can upload PDFs and make them embedable Flash files (sort of like YouTube for documents). Should be possible to load those into Flex. Not an ideal solution, but unfortunately you need to convert the PDF to an SWF somehow to be able to load it into a Flex application. I don't know of any good tools that do this. If someone else knows please share.
If you target AIR you can load a PDF into a HTML view, but that doesn't work when running in the browser (the HTML component is only available in AIR).
in Adobe Digital Edition, Adobe Load PDFs into flash (if you check the main file .exe you can see it), without any convert. therefore i think it is possible to do.
i decompiled it and found lot of classes related to pdf but i can't run it after recompiled it :(
if you solve this problem you should focus the Adobe Digital Edition product.
Oh sweet, this is an air app. I'll go with the HTML view. I can't convert them to SWF because the client will be uploading the files.
if AIR Application,
use HTMLLoader().