Hi~ Aspose.
I'm using Aspose.Imaging for changing image format to png.
after changed format, mobile app will get the files over the web service.
then using android's native code (BmpFactory.decodeByteArray()) to show image, but it returns null (means decode fail).
even it shown correctly any other viewer (or browser).
I knows files are all right.
But other image files (output of Aspose.cell, slide, word, pdf.) are handled with same function as well. so very confused.
I think, this is a issue of Android.
or maybe it depends on png file format?
May I ask you, some idea about this?
I attache files (source, target[converted by aspose])
And source code likes below.
Thank you.
Source code
public Stream Convert(Stream source)
{
source.Position = 0;
var opt = GetOption();
using (Aspose.Imaging.Image image = Aspose.Imaging.Image.Load(source))
{
Stream stream = new MemoryStream();
image.Save(stream, opt);
return stream;
}
}
private Aspose.Imaging.ImageOptionsBase GetOption(double ratio = 100)
{
double rate = ratio; // some value
var de = new PngOptions();
return new PngOptions
{
ResolutionSettings = new ResolutionSetting(rate, rate),
ColorType = Aspose.Imaging.FileFormats.Png.PngColorType.TruecolorWithAlpha,
};
}