teşekkürler ancak bu işlemi kod ile yapmam gerekiyor :/
yani c# a fotoğrafları vereceğim, o da bana swf ye dönüştürülmüş halini verecek. aslında kısmen bu işlemi gerçekleştirdim ancak swf ye eklemiş olduğum fotoğrafları videoda göremiyorum, sadece bir tanesini görebiliyorum, swf dosyasından resimleri çekmeye kalktığımda ise eklemiş olduğum bütün resimlere erişebiliyorum. aşağıdaki kod bloğu ile 3 fotoğrafı swf dosyasına ekleyebiliyorum ancak sadece bir tanesini görebiliyorum. benim amacım c# ile eklemiş oldğum üç resmi de ard arda swf dosyası oynatılırken görebilmek
private void button1_Click(object sender, EventArgs e)
{
string inputfilename = "";
string outputfilename = "";
//openFileDialog1.ShowDialog();
//inputfilename = openFileDialog1.FileName;
saveFileDialog1.ShowDialog();
outputfilename = saveFileDialog1.FileName;
try
{
/*if (File.Exists(inputfilename) == false)
{
MessageBox.Show("Can not open Image file" + inputfilename);
return;
}*/
//First load the picture as System.Drawing.Image
Image img = Image.FromFile(@"C:\Users\Public\Pictures\Sample Pictures\0.JPG");
Image img1 = Image.FromFile(@"C:\Users\Public\Pictures\Sample Pictures\44.JPG");
Image img2 = Image.FromFile(@"C:\Users\Public\Pictures\Sample Pictures\55.JPG");
int posX = 0;
int posY = 0;
int imgWidth = img.Width;
int imgHeight = img.Height;
//Create a new Swf instance
Swf swf = new Swf();
//Set size in inch unit (1 pixel = 20 inches)
swf.Size = new Rect(0, 0, (posX + imgWidth) * 20, (posY + imgHeight) * 20);
swf.Version = 7; //Version 7 (for compression, must be > 5)
swf.Header.Signature = "CWS"; //Set the signature to compress the swf
//Set the background color tag as white
swf.Tags.Add(new SetBackgroundColorTag(255, 255, 255));
//Set the jpeg tag
ushort jpegId = swf.GetNewDefineId();
//********************************************************////////////////////////
//Load the jped directly from an image
//In fact, this line will load the jpeg data in the file as
//a library element only
swf.Tags.Add(DefineBitsJpeg2Tag.FromImage(jpegId, img));
//Now we will define the picture's shape tag
//to define all the transformations on the picture (as rotation, color effects, etc..)
DefineShapeTag shapeTag = new DefineShapeTag();
shapeTag.CharacterId = swf.GetNewDefineId();
shapeTag.Rect = new Rect(posX * 20 - 1, posY * 20 - 1, (posX + imgWidth) * 20 - 1, (posY + imgHeight) * 20 - 1);
FillStyleCollection fillStyles = new FillStyleCollection();
fillStyles.Add(new BitmapFill(FillStyleType.ClippedBitmapFill, ushort.MaxValue, new Matrix(0, 0, 20, 20)));
fillStyles.Add(new BitmapFill(FillStyleType.ClippedBitmapFill, jpegId, new Matrix(posX * 20 - 1, posY * 20 - 1, (20.0 * imgWidth) / img.Width, (20.0 * imgHeight) / img.Height)));
LineStyleCollection lineStyles = new LineStyleCollection();
ShapeRecordCollection shapes = new ShapeRecordCollection();
shapes.Add(new StyleChangeRecord(posX * 20 - 1, posY * 20 - 1, 2));
shapes.Add(new StraightEdgeRecord(imgWidth * 20, 0));
shapes.Add(new StraightEdgeRecord(0, imgHeight * 20));
shapes.Add(new StraightEdgeRecord(-imgWidth * 20, 0));
shapes.Add(new StraightEdgeRecord(0, -imgHeight * 20));
shapes.Add(new EndShapeRecord());
shapeTag.ShapeWithStyle = new ShapeWithStyle(fillStyles, lineStyles, shapes);
swf.Tags.Add(shapeTag);
//Place the picture to the screen with depth=1
swf.Tags.Add(new PlaceObject2Tag(shapeTag.CharacterId, 1, 0, 0));
//Add a single frame
swf.Tags.Add(new ShowFrameTag());
//swf.Tags.Add(new EndTag());
///////////////////////////*************************************/////////////////
ushort jpegId1 = swf.GetNewDefineId();
swf.Tags.Add(DefineBitsJpeg2Tag.FromImage(jpegId1, img1));
DefineShapeTag shapeTag1 = new DefineShapeTag();
shapeTag1.CharacterId = swf.GetNewDefineId();
shapeTag1.Rect = new Rect(posX * 20 - 1, posY * 20 - 1, (posX + imgWidth) * 20 - 1, (posY + imgHeight) * 20 - 1);
FillStyleCollection fillStyles1 = new FillStyleCollection();
fillStyles1.Add(new BitmapFill(FillStyleType.ClippedBitmapFill, ushort.MaxValue, new Matrix(0, 0, 20, 20)));
fillStyles1.Add(new BitmapFill(FillStyleType.ClippedBitmapFill, jpegId1, new Matrix(posX * 20 - 1, posY * 20 - 1, (20.0 * imgWidth) / img.Width, (20.0 * imgHeight) / img.Height)));
LineStyleCollection lineStyles1 = new LineStyleCollection();
ShapeRecordCollection shapes1 = new ShapeRecordCollection();
shapes1.Add(new StyleChangeRecord(posX * 20 - 1, posY * 20 - 1, 2));
shapes1.Add(new StraightEdgeRecord(imgWidth * 20, 0));
shapes1.Add(new StraightEdgeRecord(0, imgHeight * 20));
shapes1.Add(new StraightEdgeRecord(-imgWidth * 20, 0));
shapes1.Add(new StraightEdgeRecord(0, -imgHeight * 20));
shapes1.Add(new EndShapeRecord());
shapeTag1.ShapeWithStyle = new ShapeWithStyle(fillStyles1, lineStyles1, shapes1);
swf.Tags.Add(shapeTag1);
//Place the picture to the screen with depth=1
swf.Tags.Add(new PlaceObject2Tag(shapeTag1.CharacterId, 1, 0, 0));
//Add a single frame
swf.Tags.Add(new ShowFrameTag());
//swf.Tags.Add(new EndTag());
///////////////////////////****************************////////////////////
ushort jpegId2 = swf.GetNewDefineId();
swf.Tags.Add(DefineBitsJpeg2Tag.FromImage(jpegId2, img2));
DefineShapeTag shapeTag2 = new DefineShapeTag();
shapeTag2.CharacterId = swf.GetNewDefineId();
shapeTag2.Rect = new Rect(posX * 20 - 1, posY * 20 - 1, (posX + imgWidth) * 20 - 1, (posY + imgHeight) * 20 - 1);
FillStyleCollection fillStyles2 = new FillStyleCollection();
fillStyles2.Add(new BitmapFill(FillStyleType.ClippedBitmapFill, ushort.MaxValue, new Matrix(0, 0, 20, 20)));
fillStyles2.Add(new BitmapFill(FillStyleType.ClippedBitmapFill, jpegId2, new Matrix(posX * 20 - 1, posY * 20 - 1, (20.0 * imgWidth) / img.Width, (20.0 * imgHeight) / img.Height)));
LineStyleCollection lineStyles2 = new LineStyleCollection();
ShapeRecordCollection shapes2 = new ShapeRecordCollection();
shapes2.Add(new StyleChangeRecord(posX * 20 - 1, posY * 20 - 1, 2));
shapes2.Add(new StraightEdgeRecord(imgWidth * 20, 0));
shapes2.Add(new StraightEdgeRecord(0, imgHeight * 20));
shapes2.Add(new StraightEdgeRecord(-imgWidth * 20, 0));
shapes2.Add(new StraightEdgeRecord(0, -imgHeight * 20));
shapes2.Add(new EndShapeRecord());
shapeTag2.ShapeWithStyle = new ShapeWithStyle(fillStyles2, lineStyles2, shapes2);
swf.Tags.Add(shapeTag2);
//Place the picture to the screen with depth=1
swf.Tags.Add(new PlaceObject2Tag(shapeTag2.CharacterId, 1, 0, 0));
//Add a single frame
swf.Tags.Add(new ShowFrameTag());
swf.Tags.Add(new EndTag());
//////////////********************************************//////////////////////////
//Write the swf to a file
SwfWriter writer = new SwfWriter(outputfilename);
writer.Write(swf);
writer.Close();
img.Dispose();
MessageBox.Show("File Created & Stored");
}
catch (Exception ex)
{
MessageBox.Show("Error Occurred \n " + ex.Message.ToString());
}
}