现在用24位的白底已经不报错了,但是执行如下代码后,保存后的图片只是一个白底,子图片(cannon.jpg)没加进去,帮忙看下下面代码问题出在哪?
RasterImage parentImage = codecs.Load(Path.Combine(Application.StartupPath, @"..\..\Pic\SizeCommand1.bmp"));
RasterImage childImage = codecs.Load(Path.Combine(Application.StartupPath, @"..\..\Pic\cannon.jpg"));
// Combine them
CombineWarpCommand command = new CombineWarpCommand();
LeadPoint[] destPoints =
{
new LeadPoint(10,10),
new LeadPoint(childImage.Width-10,10),
new LeadPoint(childImage.Width-10,childImage.Width-10),
new LeadPoint(10,childImage.Width-10)
};
command.DestinationImage = parentImage;
command.SetDestinationPoints(destPoints);
command.SourceRectangle = new LeadRect(0, 0, childImage.Width, childImage.Height);
command.Flags = CombineWarpCommandFlags.Bilinear;
// Save it to disk
codecs.Save(parentImage, Path.Combine(Application.StartupPath, @"..\..\Pic\CombineWarpCommand.bmp"), RasterImageFormat.Bmp, 24); |