 |
|
 |
hi and thanks for your project
can i save images of swf to and image object not to a file
or is there source of swftoimage dll
thank you very much
|
|
|
|
 |
|
 |
Hello,
I got the solution to the problem where only a black image is being displayed after being converted from the swf file.
I did add the line "swfobj.FrameIndex = 100" after each extension declaration in the code. The total code is as below:-
-------------------------------------------------------------------------------------------
Imports SWFToImage
Imports System.IO
Partial Class _Default
Inherits System.Web.UI.Page
Dim ext, filenm As String
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim swfobj As New SWFToImage.SWFToImageObject
Dim fl As String = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName)
swfobj.InputSWFFileName = FileUpload1.PostedFile.FileName
Dim path As String = Server.MapPath("dumps/swf/")
FileUpload1.PostedFile.SaveAs(path & fl)
If DropDownList1.SelectedValue = "jpg" Then
swfobj.ImageOutputType = TImageOutputType.iotJPG
ext = ".jpg"
swfobj.FrameIndex = 100
Else
If DropDownList1.SelectedValue = "gif" Then
swfobj.ImageOutputType = TImageOutputType.iotGIF
ext = ".gif"
swfobj.FrameIndex = 100
Else
If DropDownList1.SelectedValue = "png" Then
swfobj.ImageOutputType = TImageOutputType.iotPNG
ext = ".png"
swfobj.FrameIndex = 100
Else
If DropDownList1.SelectedValue = "bmp" Then
swfobj.ImageOutputType = TImageOutputType.iotBMP
ext = ".bmp"
swfobj.FrameIndex = 100
End If
End If
End If
End If
filenm = fl.Substring(0, fl.LastIndexOf(".")) & ext
swfobj.Execute()
swfobj.SaveToFile(Server.MapPath("dumps/images/" & filenm))
Call display(filenm)
End Sub
Public Sub display(ByVal fn As String)
Image1.ImageUrl = "~/dumps/images/" & fn
End Sub
End Class
-------------------------------------------------------------------------------------------
Conclusion: As before, without the frameindex, the dll was fetching the frame with the index of 0(First index). Actually, video files consist of a lot of frames and usually, some black or white or some other "not related to the actual video" are displayed at the start time of any type of video and as the frames are very small in their size, so I did mention to the frame which is with the index of 100. Because, almost no videos will contain "not related to the actual video" contents at this index, so the actual image of the video will be created.
|
|
|
|
 |
|
 |
Hello,
I have done the settings for the big files and now I am able to upload big files.
But another problem is there, that is, when I did try to take the image of a swf, I got a black image of that swf file. I know the reason also, as the starting of that swf file is black for few seconds and as it is taking the very first image, then it is capturing that black image. So, is there any option to set the time like 5 seconds or 8 seconds before capturing the image for that swf? Then by that 5 or 8 seconds the swf video will start and the captured image will not be the black one.
Please provide me some advice and oblige me thereby.
|
|
|
|
 |
|
 |
Hello arinhere,
You have done a really good job as it is a very much effective project for those who want to attach and display videos in their ASP.Net websites.
But, a single question is there in my mind and that is, I have installed your project and have run it and it is working just greatly, but in case of big swf files, like 200MB,700MB and more; it is not working at all. So, may you please give some advice to resolve this issue and oblige me thereby?
|
|
|
|
 |
|
 |
Hi, this post is very useful.
how can I align the generated Image? it leaves lot of white area outside. how can we trim it to show only picture???
Thnks
|
|
|
|
 |
|
 |
Hi,
I think you are telling about the design page of the "Default.aspx", right? If yes, then why you don't try to redesign this page using Visual Studio? Then all the designing problems will be solved.
|
|
|
|
 |
|
 |
Did you ever encounter a white output image while making this post?
I thought I did everything, it seems the code works also, because there is an output image. But it is plain white.
Here is my code:
SWFToImageObject converter = new SWFToImageObject();
converter.InputSWFFileName = "images/header.swf";converter.ImageOutputType = TImageOutputType.iotJPG;
converter.Execute();
converter.SaveToFile(Server.MapPath("images/header.jpg"));
Maybe it's got something to do with the fact that I'm testing on a local server instance initiated by Visual Studio?
|
|
|
|
 |
|
 |
I think, it is not the problem as you are not using the visual studio; but your swf video file might start after few seconds and at the very first moment, the video has only a white back ground and not the video. I have also the same problem and I have got the black image as my swf video starts after few seconds and at the very first moments it shows a black background. The problem is, this technique is getting the image from the very first of the swf video where the video has nothing to display except a white background(in your case) and a black background(in my case), so the image is being the same.
I have also queried for this issue and waiting for the kind respond from the author of this article
|
|
|
|
 |
|
 |
Hello,
I got the solution to the problem where only a black image is being displayed after being converted from the swf file.
I did add the line "swfobj.FrameIndex = 100" after each extension declaration in the code. The total code is as below:-
-------------------------------------------------------------------------------------------
Imports SWFToImage
Imports System.IO
Partial Class _Default
Inherits System.Web.UI.Page
Dim ext, filenm As String
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim swfobj As New SWFToImage.SWFToImageObject
Dim fl As String = System.IO.Path.GetFileName(FileUpload1.PostedFile.FileName)
swfobj.InputSWFFileName = FileUpload1.PostedFile.FileName
Dim path As String = Server.MapPath("dumps/swf/")
FileUpload1.PostedFile.SaveAs(path & fl)
If DropDownList1.SelectedValue = "jpg" Then
swfobj.ImageOutputType = TImageOutputType.iotJPG
ext = ".jpg"
swfobj.FrameIndex = 100
Else
If DropDownList1.SelectedValue = "gif" Then
swfobj.ImageOutputType = TImageOutputType.iotGIF
ext = ".gif"
swfobj.FrameIndex = 100
Else
If DropDownList1.SelectedValue = "png" Then
swfobj.ImageOutputType = TImageOutputType.iotPNG
ext = ".png"
swfobj.FrameIndex = 100
Else
If DropDownList1.SelectedValue = "bmp" Then
swfobj.ImageOutputType = TImageOutputType.iotBMP
ext = ".bmp"
swfobj.FrameIndex = 100
End If
End If
End If
End If
filenm = fl.Substring(0, fl.LastIndexOf(".")) & ext
swfobj.Execute()
swfobj.SaveToFile(Server.MapPath("dumps/images/" & filenm))
Call display(filenm)
End Sub
Public Sub display(ByVal fn As String)
Image1.ImageUrl = "~/dumps/images/" & fn
End Sub
End Class
-------------------------------------------------------------------------------------------
Conclusion: As before, without the frameindex, the dll was fetching the frame with the index of 0(First index). Actually, video files consist of a lot of frames and usually, some black or white or some other "not related to the actual video" are displayed at the start time of any type of video and as the frames are very small in their size, so I did mention to the frame which is with the index of 100. Because, almost no videos will contain "not related to the actual video" contents at this index, so the actual image of the video will be created.
|
|
|
|
 |
|
|
 |
|
 |
I'm unable to locate SWFToImage.exe file from the source web site. Please provide the correct URL
|
|
|
|
 |
|
 |
you can find SWFToImage.exe at bytescout.com...it was a free component
Arin
Mail: arinhere@gmail.com
http://blogs.msdn.com/coding4fun/archive/2008/04/16/8399645.aspx
|
|
|
|
 |
|
|
 |
|
 |
You are completly wrong!!! For me it's very usefull!!!
|
|
|
|
 |