I've done some tests by trying to get a valid TBitmap out from TImageEnIO:
CodeSite.Send('ASVGFilePath', ASVGFilePath); // this shows the correct SVG file path
var ThisImageEnIO := TImageEnIO.Create(nil);
try
try
ThisImageEnIO.ImportFromFileSVG(ASVGFilePath, AWidth, AHeight, True);
ThisImageEnIO.IEBitmap.Write('test.bmp');
CodeSite.Send('ThisImageEnIO.IEBitmap.VclBitmap:', ThisImageEnIO.IEBitmap.VclBitmap); // This outputs a BLACK BITMAP!
ThisImageEnIO.Bitmap.SaveToFile('test.bmp'); // this is not executed
CodeSite.Send('ThisImageEnIO.Bitmap:', ThisImageEnIO.Bitmap); // this is not executed
except
CodeSite.Send('Exception'); // this is not executed
end;
finally
ThisImageEnIO.Free;
end;
This workaround seems to work, but randomly, the same SVG file does not:
ThisImageEnIO.ImportFromFileSVG(ASVGPath, AWidth, AHeight, True);
var bmp := TBitmap.Create;
try
ThisImageEnIO.IEBitmap.CopyToTBitmap(bmp); // randomly creates a BLACK square with the same SVG file that worked previously
CodeSite.Send('bmp', bmp);
finally
bmp.Free;
end;
So, how can I create a valid TBitmap in memory from TImageEnIO?