UNE SOLUTION !!?? Youpi !!
PublicClass Form1
Private
Sub
Form1_Load(
ByVal
sender
As
System.Object,
ByVal
e
As
System.EventArgs)
Handles
MyBase
.Load
Dim
SWFToImage = CreateObject(
"SWFToImage.SWFToImageObject"
)SWFToImage.InitLibrary(
"demo"
,
"demo"
)SWFToImage.InputSWFFileName =
"C:\kiss.swf"
SWFToImage.ImageWidth = 64SWFToImage.ImageHeight = 64
SWFToImage.ImageOutputType = 0
SWFToImage.Execute_Begin()
SWFToImage.Frameindex = 10
SWFToImage.Execute_GetImage()
TextBox1.Text = SWFToImage.Framescount
TextBox2.Text = SWFToImage.BinaryImageSize()
Dim
X, Y
As
Integer
X = SWFToImage.ImageWidth
Y = SWFToImage.ImageHeight
Dim
image
As
New
Bitmap(X, Y, Imaging.PixelFormat.Format32bppRgb)
Dim
image_tab()
As
Byte
ReDim
image_tab(SWFToImage.BinaryImageSize)Array.Copy(SWFToImage.BinaryImage, image_tab, SWFToImage.BinaryImageSize)
'' Copies the Object array to the integer array.
image = BytesToImg(image_tab)
PictureBox1.Width = X
PictureBox1.Height = Y
PictureBox1.Image = image
End
Sub
Private
Function
BytesToImg(
ByVal
bmpBytes()
As
Byte
)
As
Image
Dim
ms
As
System.IO.MemoryStream =
New
System.IO.MemoryStream(bmpBytes)
Dim
img
As
Image = Image.FromStream(ms)
' Do NOT close the stream!
Return
img
End
Function
EndClass