Is there a actionscript3 lib to create *.ico file - actionscript

Now, i need to create a .ico file in my actionscript project. But I can not find a lib.
Here is ICODecoder (actionscript lib) for reading ico file and get the bitmap data.
But what i really need is conver jpg/png to .ico file.

There is no library that I have ever seen to create an ico file; however, nothing is stopping you from creating a back-end service that when contacted by an ActionScript call, it creates the .ico file for you, stores it on the server, and your ActionScript fetches it when it's ready.

Related

Parse WRL file to X3D

Well the problem I have is that I need to transform a WRL file to a X3D xml file, but for this I can't find API's that can get code from the file.
Well first I manually saw what tags were needed for the X3D file, and then I was trying with open source software to modify it by exporting it to that file, but in some cases it doesn't work and I would like to do it by code.
view3dscene https://castle-engine.io/view3dscene.php is a part of the Castle Game engine project. view3dscene by itself is a very capable viewer of both .wrl files -- also known as VRML encoding -- and X3D files. WRL files read by view3dscene can be saved as X3D

Can I house an audio file on the form?

If I have an image file that I want to save to a stream, I can do so by placing an TImage on the form and using it as a container, like so:
Image1.Bitmap.LoadFromFile('ExampleFile.png');
Image1.Bitmap.SaveToStream(mybytestream);
Is there an equivalent for audio content, some object I can place on the form to house an audio file? If not, how do I use SaveToStream with audio?
begin
var myaudio := TByteStream.Create;
myaudio.LoadFromFile( 'myaudiofile.mp3' );
// do something with myaudio data
myaudio.SaveToFile( 'myaudiofile2.mp3' );
myaudio.Free;
end;
Is this what you're looking for? The example you gave does not "house" the image loaded on the form, so it's hard to decipher your question vs. your example.
Audio files are usually VERY LARGE and you'd want to store a compressed version as a resource in the app. But you'd want to use an audio player that can play a compressed file in the specified format saved in a run-time buffer like a TStream.
Yes, you can use a TImageList to save small images to your form, and it's loaded up when the program starts executing. You could create something like that to hold short audio samples like dings and chimes, but I wouldn't do it for something like an audiobook.
(People often ask how to attach a video to a PDF file, and they don't really think about the fact that the resulting PDF file may easily end up being over a gigabyte in size!)
You're better off having a folder that contains the audio clips, then loading them into an array of streams when the program starts up. That would be the simplest analogy to a TImageList but without the files being saved in the app itself.
An alternative might be to put the audio files into a zip file. Then you could attach the zip file as a resource to the app and extract the files from it. That would make it easier to build the app since you could change the contents of the zip file without having to change your build process at all.
Just be careful of referring to audios by name that might not be there. (This is a common problem that affects the use of fonts that may be attached to an app, and referring to one that's not there.)

How to loading outside .love save file? (love2d+ LUA)

I write editor and game and it requires a save game option.
I Just want use a Save folder in game folder. not inside.love
How to get a bug.
Start game
Enter menu by Escape key
Press save game - this create savegame
Press Load game - you get an error "File not exist" but you write this file seconds ago.
I successful save a game in savesm2k folder but it folder outside .love file and i don't know how correct load saved game.
Used engine: Love2d 0.10.2
OS: Linux Mint 18.1 x64bit
I read many manuals and I'm stuck.
For loading save game i use this commands
lsg=love.filesystem.getSaveDirectory().."/M2k-Saves/m2ksave"
lsg=love.filesystem.getSourceBaseDirectory().."/M2k-Saves/m2ksave";
data, size = love.filesystem.read (lsg);
leveldatacopy=freadbin (data);
Why does the program not try read existing file? and report no exist? I try using another command but using GetSaveDirectory broke function WriteMAP (requires for binary map and data writing) etc. but it write files which cannot be loaded in load section.
Maybe I should use LUA for reading files direct from folder but I don't know how to correct DO it.
example with bug.
https://github.com/dj--alex/m2ktest
file m2ktest-load-savegame-test.love
At this moment on every saving i manually replace saved game inside love archive (!) . This is not normal.
Anybody can tell me how i get and correct open saved file? Not from inside .love file . from outside of course. If levels and configs can be readed from love file inside save files must be outside. I can only can create files outside love file . i know love file is a zip archive.
If required i can post a .love file but is game completely done and have 150kb of clean code.
You should not prefix paths with love.filesystem.getSaveDirectory() or love.filesystem.getSourceBaseDirectory(). This is done automatically, internally to the love.filesystem functions. Saying
lsg = "/M2k-Saves/m2ksave"
data, size = love.filesystem.read (lsg)
leveldatacopy = freadbin (data)
should work, and will place the file in the save directory / outside of the .love file or game directory. (Love forbids writing anywhere except in the save directory.)
Love's filesystem model is like a "stack" of filesystems. For file reading, it first looks in love.filesystem.getSaveDirectory() with whatever path you pass in. If it finds a file, it uses that; otherwise it looks inside the love.filesystem.getSourceBaseDirectory() (or – if packed – inside the .zip / .love file). Writing files always goes to love.filesystem.getSaveDirectory(), you cannot write to love.filesystem.getSourceBaseDirectory() (because it may not be an actual directory but a zip file).

Opening a TIFF File from the Web Browser

I checked previous questions here on SO but I think I want my functionality to work a little different. I understand that .tif files are not natively supported in Internet Explorer and that an extension, such as AlternaTIFF, are available to remedy this. However, I would like the dialog to show up where the user can either save/open the file on the client side. I know that MS Windows Picture and Fax Viewer can open them, no problems.
The files are located on our servers and this will be an intranet site. Currently, I have a link to the files populate in the view but again, I'd like that option for the user to Save/Open the file.
I'm using MVC, which I'm a little unfamiliar with, and can't seem to figure this one out. Thank you.
You can do an action that returns a tiff by changing the headers so when someone clicks the link the file will get downloaded or using FileResult.
Example with FileResult (i find it easier): http://www.dotnetcurry.com/ShowArticle.aspx?ID=807
For saving them is just like uploading any file with MVC. This post can be useful http://haacked.com/archive/2010/07/16/uploading-files-with-aspnetmvc.aspx
My advice is that you convert them to .jpg or .png when uploaded using GDI+.
//You first upload the tiff to the server like the post above explains
//And then open and convert it to .JPEG
Bitmap bm = Bitmap.FromFile("mypic.tiff");
bm.Save("mypic.jpg",ImageFormat.JPEG);
And if you already have the urls of all the tiffs, you can always do a console app to convert all of them. Even if you need to use tiffs its a good idea to have .jpg versions to show on the web. You can even resize them to create previews and save some bandwith too! :-)

SWF file extraction

If I have a link to a SWF file - for example here http://redletterdaysb2b.co.uk/swf/our-video.swf
how can I extract it for use on another website?
I have downloaded the swf, but just get an error#2044 when I try and play it. does it need to go in some sort of wrapper?
thanks guys
You're trying to load a swf that in turn loads and displays a .flv using the FLVPlayback component. I'm guessing our-video.swf loads fine, but it probably keeps a relative reference to the .flv.
I can think of two ways to handle this:
Simple add a new FLVPlayback (or any other video player) on the other site but tell it to load the .flv file from the original site.
Try to copy the .flv file in the same folder as the new .swf on the new site.
With the FLVPlayback component there's another part that could cause the error: the skin which on the original site is here.
The #2024 IOError should also include an URL.
This is your best hint to how the our-video.swf is trying to load the .swf file (using a relative(./swf/redletterdays.swf) or an absolute(/swf/redletterdays.swf) path).
Based on this, if you decide to load the player from the original site (not just the .flv file), you can work out where to place the skin (i.e. in the in a folder named swf on the root of the new site)

Resources