Dear Steve,
To remove border, you will have to set the
StyleChangeRecord.LineStyle=-2147483648. I have added few more following lines in the AddImage method.
--------------------------------------------------------------------------------------
DefineShape2
defshp = shapeManager.GetDefineShape(shpID);
StyleChangeRecord
scr = defshp.Shape.ShapeList[0] as StyleChangeRecord;
scr.LineStyle = -2147483648;
flashObjs.Add(defshp);
--------------------------------------------------------------------------------------
Here is a complete code that adds an image c:\sunset.jpg without any borders. I have also attached the generated out.swf file.
--------------------------------------------------------------------------------------
static void AddImageWithoutBorders()
{
FlashContainer flash = new FlashContainer();
/// set frame rate
flash.FrameRate = 12.0f;
/// set frame size
flash.FrameSize =
new Rect(0, 0, 11000, 8000);
//Add the background colour
flash.Add(
new SetBackgroundColor(new RGB(255, 255, 255, 255)));
//Add the image without borders
//Get all the objects needed for adding image in swf file
ArrayList flashObjs = AddImage(flash.NewIdentifier(), flash.NewIdentifier(), "c:\\sunset.jpg", 500, 500, 5000, 3000);
flash.Add(flashObjs);
flash.Write(
"c:\\out.swf");
}
static ArrayList AddImage(int imgID, int shpID, string imageFile, int X, int Y, int Width, int Height)
{
ArrayList flashObjs = new ArrayList();
FlashBitmap bmp = new FlashBitmap(imgID, FlashBitmapType.FlashBitmapJpeg, false, imageFile);
flashObjs.Add(bmp);
//Calculate scaling factor
double scaleX = ((double)Width) / (double)bmp.Width;
double scaleY = ((double)Height) / (double)bmp.Height;
//Create a rectangle shape with image as a fill via ShapeManager
ShapeManager shapeManager = new ShapeManager();
shapeManager.Add(
new SolidLine(1, new RGB(255, 0, 0, 255)));
shapeManager.Add(
new BitmapFill(FillStyleType.NonSmoothedClippedBitmap, imgID, new MatrixTransform(X, Y, scaleX, scaleY)));
shapeManager.DrawRectangle(X, Y, Width, Height);
//Add the shape and place it on display list
DefineShape2 defshp = shapeManager.GetDefineShape(shpID);
StyleChangeRecord scr = defshp.Shape.ShapeList[0] as StyleChangeRecord;
scr.LineStyle = -2147483648;
flashObjs.Add(defshp);
flashObjs.Add(
new PlaceObject2(shpID, 1, 0, 0));
return flashObjs;
}
Many Thanks and Kind Regards,
Shakeel Faiz
Support Engineer
Aspose Tyumen Team