private void ConvertButton_Click(object sender, EventArgs e)
{
Bitmap original = new Bitmap(@"filepath.cover.png");
Bitmap clone = new Bitmap(original.Width, original.Height, PixelFormat.Format32bppPArgb);
using (Graphics conv = Graphics.FromImage(clone))
{
conv.DrawImage(original, new Rectangle(0, 0, clone.Width, clone.Height));
}
}
Hello everyone, i need some help.
I trying to convert PNG or JPEG files to TGA 32bit files and save them, I am still new to programming and could not find an answer here. I found only this code snip here and tried to get him to run, i tried alot of versions to get an output file, but nothing worked, sometimes I got a blank file, sometimes a corrupt one
thank you to everyone who helps me.
Edit: First of all, thank you, I tried your code and it gives me an empty file. I'm just trying this:
private void TgaConvert_Click(object sender, EventArgs e)
{
TGA original = new TGA(@"file.path.cover.png");
TGA clone = new TGA(original.Width, original.Height, TgaPixelDepth.Bpp32,
TgaImageType.Uncompressed_TrueColor);
using (??? conv = ???(clone))
{
conv.???(original, new ???(0, 0, clone.Width, clone.Height));
clone.Save(@"file.path.cover.tga");
}
}
at the places with "???" I can't get any further