So here's an overview of my program. You select a folder, containing images. The program imports all images in said folder (with the .JPG extension). Then, it exports these images into an MP4. For this program, I don't need a visible timeline, just a way to export said images.
I'd like to be able to set a universal duration and I want to (if possible) have a Ken Burns effect on each image, where the image simply is scaled up by like a factor of 5%-10% (this part doesn't have to change each time). As of right now, this is my code:
private void btnOpen_Click(object sender, EventArgs e)
{
openFolder.Description = "Open a folder containing pictures for the slideshow!";
if (openFolder.ShowDialog() == DialogResult.OK)
{
var folderPath = openFolder.SelectedPath;
MessageBox.Show(folderPath);
var fileArray = Directory.GetFiles(folderPath, "*.JPG");
float duration = 4;
float startpos = 0;
foreach (var file in fileArray)
{
var filePath = $@"{folderPath}\{file}";
MessageBox.Show(filePath);
//add image to "timeline"
startpos += 4;
}
}
else
{
MessageBox.Show("Next time, select a folder and click open!", "Selection Cancelled", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void btnExport_Click(object sender, EventArgs e)
{
if (presetList.SelectedIndex == -1)
MessageBox.Show("Please select a preset!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
else
{
if (presetList.SelectedItem.ToString() == "720p, 30fps")
{
//export code here
}
else if (presetList.SelectedItem.ToString() == "720p, 60fps")
{
//export code here
}
else if (presetList.SelectedItem.ToString() == "1080p, 30fps")
{
//export code here
}
else if (presetList.SelectedItem.ToString() == "1080p, 60fps")
{
//export code here
}
}
}
I've looked at a few libraries so far, but none of them seem to fit my needs, and all of them seem to be ridiculously expensive.