How do I use animated PNG in Delphi?
If you are still searching for a solution then you can take a look
here where I've found this library that can solve your trouble.
With this complete library you can open APNG file then get number of frames etc...
Related
In my IOS App I want to Convert GIF to MOV/Video.
I don't Know Where To start.
I researched much and finally I know is I have to use ImageMagic API for this But don't Know How to Apply It.
Is there any other way except using ImageMagick???
Please Guide me In this Case That how to do so. Thanks in Advance.
You can Get sequence of images from that GIF. And then you need to convert those all into .png and then you can play that frames as mov.
That's the nice solution. For both steps libraries and tutorials are available
I was trying to convert a GIF image (Ajax waiting like):
to AVI that will be used with TAnimate control (win32 animation control).
I have tried a few tools, but the problem is that the output AVI is either not suitable for the Animation control or not transparent.
Notes:
I don't use windows XP Themes manifest (D5).
the Common Avi's are transparent even if my program is not themed.
Using the GIF itself to show animation is not an option.
Do you know any tool that can help me with this conversion?
EDIT:
I have tried using ImageMagic with ffmpeg as described here. but I can't seem to set ffmpeg to encode to msrle.
Jasc Animation Shop is able to directly read an animated GIF and write out a compressed AVI. This is an old program that appears to be no longer offered by Corel (who acquired Jasc), but you may still be able to find the free trial version for example.
You could try the TGIFImage component (written for Delphi 5), which claims not only to support Animated GIFs, but also Transparency, as well as a means of converting a GIF to an AVI (and vice-versa).
Whether it does all that or not I cannot say as I haven't personally tested it. Like TLama mentioned in the OP comments above, I use my own means of playing each frame in an animated fashion (only mine uses a RES file and a TImage, where each frame is stored as a PNG for full semi-transparency support).
Many commercial tools do this conversion, including Corel Photo Paint, and others. A free trial is available for Corel Photo Paint, which comes included in the Corel Draw package. (Warning: It's huge, and expensive.) I don't think the transparency will be solved any more by corel photo paint's conversion than by anybody else.
Typing some words into Google, also reveals that DSPack from ProgDigy might help you.
The last time I did this, I abandoned the attempt to convert GIF transparency into AVI-with-transparency, because no AVI-encoding tool that I could find would preserve transparency. Thus the solution of leaving it as a gif, and putting a new control into your app (as LaKraven suggests) may be superior in the end, to fighting it.
I would suggest using GDIPlus native image renderer which can easily handle animated GIFs as well as many other image types, including multi-frame TIFFs (no MNG so far). I was able to find an example component which animates TImage instance:
http://www.progdigy.com/forums/viewtopic.php?p=13156
Please note I am aware that you are looking for a solution to AVI transparency, this is just an alternative way of presenting user with a "progress", which seems to be more lightweight (no dependency on windows media playback facilities) and flexible (such animation controller can be used on any image).
I got a jpeg image in which is 1020x780, I am trying to resize this to 111x85 (which is in proportion) but it comes out pixelated.
I am tried just
a) Assign the image to a TImage component and set the Scaled/Resize property.
b) The resize code here http://www.delphigroups.info/2/4/313095.html
c) The resize code here http://www.swissdelphicenter.ch/torry/showcode.php?id=1896
However they all come out pixelated.
If I resize in Photoshop then it comes out nice. Getting it THAT good would be ideal, however I know they spent a lot of time/code into resize so something even halfway between would be great.
Any suggestions?
Have a look at Graphics32 library. It implements various image resampling and transformation algorithms for 32-bit bitmaps.
In my blog I talk about resize images using/implementing antialiasing.
Read the article and test the code here. It's writed in Spanish but you can use authomatic translate. In any case you can read only the code.
See the difference of apply and not apply the code:
The code work with BMP, but you can convert the image first and apply it.
Instead of using the built-in TImage for scaling, you could use an external library or component, e.g. ImageMagick or some off-the-shelf component. There exists at least one Pascal wrapper for ImageMagick
http://wiki.freepascal.org/PascalMagick)
, but I've never used it myself.
I have successfully used HiComponents ImageEn library to resize an image down to approx 250 pixels. It was a while ago, but I recall that the results were quite pleasing. http://www.hicomponents.com/main/products/products-imageenvcl - it's free now, and well worth a look if you're doing any graphics programming in Delphi.
The TImage control doesn't support PNG. Is there some third party component that will?
Try PngComponents - as long as they are available...
A D2009 version can be found here
EDIT
On Google code the following link for older versions of Delphi:
http://code.google.com/p/cubicexplorer/downloads/detail?name=PngComponents.zip&can=2&q=
Try Delphi PNG and MNG libraries
GraphicEx will give you support for both png's and many other formats.
I have successfully used the TPaintBox component with the DevExpress TcxImageList which supports PNGs, and then drawn the images in the OnPaint using the list's facilities. Worked well. DevEx also have a TcxImage, but I've not tried that.
DevEx TCXImage component support PNG straight forward.
CXImage1.Picture.LoadFromFile(myimage.png)
Is it possible to save a .fla file as an animated gif from an actionscripted animation? I know you can do it from a tweened animation quite easily, but haven't been able to figure out a way to do it from a scripted one.
I am not 100% sure I understand your question.
If you want to write an actionscript animation to a file from the Flash IDE, you can try quicktime(.mov) by choosing:
File > Export Movie and choosing QuickTime as the output format. This will allow you save the rendering of your actionscript to a file. A handy video by Lee Brimlow is available here.
I don't think it's possible to save a gif from the IDE for actionscript, but if GIF is a must you can try rendering with actionscript into an array of BitmapData objects that you would feed to a GIFEncoder.
Have a look at this fun and easy to use GIF Encoder by Thibault Imbert. I found it really easy to get started with.
Have fun!
In case you're still curious, check Converting SWF into GIF file