I need to make swf file (slide show) from images and sounds (narrations).
I am trying to use SwfDotNet tool for it.
There is article which describes how to add images to swf http://www.codeproject.com/KB/graphics/jpeg2swf.aspx?fid=369197&df=90&mpp=10&noise=3&prof=True&sort=Position&view=Quick&fr=21#xx0xx
I can't add sound to swf.
I try to use next code, but it doesn't work.
Looks that DefineSoundTag works because file size is increased, but StartSoundTag doesn't work.
var soundId = swf.GetNewDefineId();
swf.Tags.Add(DefineSoundTag.FromFile(soundId, fileName));
var soundInfo = new SoundInfo() {
InPoint = 1,
OutPoint = 10000
};
swf.Tags.Add(new StartSoundTag(soundId, soundInfo));
Does anyone know how to add sound to swf via swfdotnet tool?
Related
New to Blazor (web-assembly), so go easy :)
I would like to be able to select an xml file from local disk (in the region of 100mb in size), via InputFile and have it loaded in to XmlDocument so I can interrogate it.
Upon trying to load a file of this size, it crashes out on XmlDocument.load(). Unsure why.
I can get it to load smaller file sizes via a OpenReadStream and setting the maxAllowedSize to like 105000000 but they take a complete age in comparison to say loading it from a WPF c# app.
I'm unsure whether the stream is causing the slowness, or whether I'm missing something fundamental in accessing local disk files during the XmlDocument load process of this size?
Any help is greatly appreciated.
So basically, all i want to be able to do is something like this...
<InputFile OnChange="LoadFile">Select file...</InputFile>
#{
private void LoadFile()
{
XmlDocument newXml = new XmlDocument();
newXml.load(ChosenFilePath); //ChosenFilePath or hardcoded path for testing purposes still fails i.e. #"C:\temp\TestFile.xml"
}
}
You need to accept the InputFileChangeEventArgs and get your file through it, that's relatively simple, your event handler should be this:
private void LoadFile(InputFileChangeEventArgs args)
{
// The argument is to increase the maximum size, by default it only allows
// you to open files less than or equal to 500KiB, the number below is 200MiB
// Alternatively you could pass 'args.File.Size' to allow opening an arbitraily large file
var fileStream = args.File.OpenReadStream(200 * 1024 * 1024);
var newXml = new XmlDocument();
newXml.Load(fileStream);
}
I want to process an (RTSP) stream from an IP camera in an UWP app which every x seconds grabs and analyses an image. The simpliest way I found is to use VLCMediaElement (github). My idea is to use vlcel.MediaPlayer.takeSnapshot() method to save the image to a file, reload it and then process it.
When I try to use this method no file is created.
vlcMediaElement.MediaPlayer.takeSnapshot(1, "e:\\img", 1280, 738);
// or
vlcMediaElement.MediaPlayer.takeSnapshot(1, "ms-appdata:///local/image", 1280, 738);
If I try to use the full path to the folder I obtain the same result - no file created.
var fldr = ApplicationData.Current.LocalFolder;
var img = fldr.CreateFolderAsync("image", CreationCollisionOption.OpenIfExists).GetResults();
vlcMediaElement.MediaPlayer.takeSnapshot(1, img.Path, 1280, 738);
Does someone have any idea of what I'm doing wrong (some inputs required to manifest, some options to media instance, etc)?
I have c# dynamic aspx page after new property add I create for record brochure
http://veneristurkey.com/admin/Brochure.aspx?Admin=PropertiesBrochureA4&id=36
but I want to this convert image file I am searching on internet but all with webbrowser and windows forms. I need on page load show not css type also image file. jpg, png or tiff how i can do this. i need to see sample code..
saving aspx page into an image 2
As I mentioned in my comment, your best bet is to opt for attempting to render HTML to an image.
Here is the link for a library that will allow your to render html to an image:
http://htmlrenderer.codeplex.com/
Here is code that does exactly what you're asking:
http://amoghnatu.wordpress.com/2013/05/13/converting-html-text-to-image-using-c/
Now all you have left is to get the html, since I'm assuming you don't want this to render to the browser prior to generating this image - you should look into grabbing the rendered html from the aspx page on the server prior to returning it, and then just return the image. To render a page:
https://stackoverflow.com/a/647866/1017882
Sorted.
If you do not mind using a commandline tool you can have a look at wkhtmltopdf. The package include a wkhtmltoimage component that can be used to convert HTML to image, using
wkhtmltoimage [URL] [Image Path]
Codaxy also wrote a wkhtmltopdf c# wrapper available through the NuGet package manager. I'm not sure if the wkhtmltoimage component was included, but it should be easy enough to figure out how they wrap the wkhtml components.
i fixed my problem with screenshot machine API they are my code..
public void resimyap()
{
var procad = WS.Satiliklars.Where(v => v.ForSaleID == int.Parse(Request.QueryString["id"])).FirstOrDefault();
var imageBytes = GetBytesFromUrl("http://api.screenshotmachine.com/?key=xxxxxx&size=F&url=http://xxxxxxx.com/a4.aspx?id=" + procad.ForSaleID);
string root = Server.MapPath("~/");
// clean up the path
if (!root.EndsWith(#"\"))
root += #"\";
// make a folder to store the images in
string fileDirectory = root + #"\images\a4en\";
// create the folder if it does not exist
if (!System.IO.Directory.Exists(fileDirectory))
System.IO.Directory.CreateDirectory(fileDirectory);
WriteBytesToFile( fileDirectory + + procad.ForSaleID + ".png", imageBytes);
Yes i also try wkhtmltopdf c# wrapper but in pdf or image converting time my computer fan goin crayz. also i must upload server exe file and my hosting firm didnt support them
I need some help in reading/writing meta data inforamation of audio/vido file. I have searched alot but not find anything thing helpful. Taglib sharp is an open source library that provide help in reading/writing metadata. Using tag lib i'm able to edit some of values but not all like.
TagLib.File videoFile = TagLib.File.Create("test.mp4");
videoFile.Tag.Title = "Test";
videoFile.Tag.Comment = "Nothing";
but i'm unable to edit following properties like Author url, producers etc. How i edit these properties ??
I've never done this for video files before but I have for mp3 files. You can get access to those frames like this:
TagLib.File file = TagLib.File.Create(mp3FileName);
file.Tag.Title = "some title"; // you've got this
TagLib.Id3v2.Tag tag = (TagLib.Id3v2.Tag)file.GetTag(TagTypes.Id3v2);
tag.SetTextFrame("WOAR", "some url"); // WOAR = Official artist/performer webpage
file.Save();
You can find a list of the text frame identifiers at Wikipedia:
ID3v2 Frame Specification (Version 2.3)
I don't know if video files give you the same range of frames that ID3 does, though notice that Wikipedia also says (Implementation in non-mp3s and alternatives)
MP4 also allows the embedding of an ID3 tag, and this is widely supported.
So I would guess this also works for mp4 files like you're trying.
You will need to use AppleTag. This will work. For mp4 file you have to write value into dashbox. Like this:
TagLib.File videoFile = TagLib.File.Create("test.mp4");
TagLib.Mpeg4.AppleTag customTag = (TagLib.Mpeg4.AppleTag)f.GetTag(TagLib.TagTypes.Apple);
customTag.SetDashBox("Producer","Producer1", "value");
f.Save();
f.Dispose();
And you can get the value like this:
var tokenValue = customTag.GetDashBox("Producer", "Producer1");
I need to play Music Library files using file URL, that I will set to MediaPlayer object in a XAML c# object.
I constructed URI as followed
StorageFile file = await KnownFolders.MusicLibrary.GetFileAsync(track.Id);
return new Uri("file:///" + file.Path);
URI looks like this: streamingUri = {file:///C:/Users/user/Music/04 - A Train Makes A Lonely Sound.mp3}
I need URL based scheme to play so that I can reuse same logic for web streaming too.
How do I make this work?
Take a look at
this sample. It should give you some ideas of how to do media playback from file.
While I notice you are saying you need a URI-based, you should use a stream for a local file. The only part you need to extract is a call to set the MediaElement's Source. You can just make a function with 2 overrides and it should be relatively clean.
So, for a web stream:
void SetMediaElementSource(Uri webStreamUri)
{
MyMediaElement.Source = webStreamUri;
}
And for a local file:
void SetMediaElementSource(StorageFile file)
{
var stream = await file.OpenAsync(Windows.Storage.FileAccessMode.Read);
MyMediaElement.SetSource(stream, file.ContentType);
}