Sign UpSign Up   Sign InSign In Welcome Guest,
Live ChatLive Chat

How do you display PlaceObject2's image?

Last post 06-21-2010, 8:39 AM by shiver21. 7 replies.
Sort Posts: Previous Next
  •  06-17-2010, 4:20 AM 243877

    How do you display PlaceObject2's image? .NET

    Hello,

    How do you display PlaceObject2's image on PictureBox using its name property? I mean, every PlaceObject2 in external SWF file should be added on ArrayList and should be viewed in PictureBox.

    I have here the code snippet that views any flashbitmap found on the external SWF file. It populates the arraylist and araylist will be used on displaying images in picturebox. But I am using here FlashBitmap, I want to use PlaceObject2 to show each image using its name.

    My Goal is not to include the background image coz in this code, it will get included.

    Private Sub ViewImages(ByVal strFC As String)
            Dim flash As New FlashContainer(strFC)
            Dim imageNumber As Integer = 0

            For Each obj As Object In flash.Objects

                If TypeOf obj Is FlashBitmap Then
                    imageNumber += 1
                    Dim image As FlashBitmap = CType(obj, FlashBitmap)
                    If image.Bitmap IsNot Nothing Then
                        myAList.Add(image)
                        image.Bitmap.Save(tempFolderPath & "\image" & imageNumber & ".png", _
                                          System.Drawing.Imaging.ImageFormat.Png)
                    End If
                End If
            Next
            MaxVal = imageNumber
            If MaxVal <= 1 Then
                HScrollBar1.Visible = False
            Else
                HScrollBar1.Visible = True
            End If
            HScrollBar1.Minimum = 1
            HScrollBar1.Maximum = MaxVal + 9
            HScrollBar1.Value = 1

            Dim fs As FileStream
            If File.Exists(tempFolderPath & "\image" & HScrollBar1.Value & ".png") Then
                fs = File.Open(tempFolderPath & "\image" & HScrollBar1.Value & ".png", FileMode.OpenOrCreate, FileAccess.Read, FileShare.None)
                picboxImage.Image = Image.FromStream(fs)
                fs.Close()
            Else
                Exit Sub
            End If
        End Sub

    Please Help,
    Neil John


    Neil John
     
  •  06-17-2010, 10:42 AM 244002 in reply to 243877

    Re: How do you display PlaceObject2's image?

    Hi Neil,

    As far as I understand, you're trying to find all the images which are related to the PlaceObject2 objects. If so, you can find those images using the following steps:

    1. Find the DefineShape2 object where PlaceObject2.CharacterID = DefineShape2.ShapeID
    2. Get the BitmapID of the BitmapFillStyle of the above DefineShape2 object
    3. Find DefineBitmapJPEG2 object where DefineShape2.FillStyles.BitmapFillStyle.BitmapID = DefineBitmapJPEG2.CharacterID

    This DefineBitmapJEPG2 object will contain the required image which is related to a particular PlaceObject2 object. You can similarly find all the images.

    If you think I haven't understood your requirement properly, or this doesn't work for you then please share a sample SWF file, so we could test it at our end. You'll be updated accordingly.

    We're sorry for the inconvenience.
    Regards,


    Shahzad Latif
    Support Developer
    Aspose Sialkot Team
    About Us
    Contact Us
     
  •  06-18-2010, 2:59 AM 244152 in reply to 244002

    Re: How do you display PlaceObject2's image? .NET

    Attachment: Present (inaccessible)
    Hi, 

    PlaceObject2 doesn't have a member called CharacterID if I am not mistaken, only PlaceObject3 has a member CharacterID. So how do I supposed to relate DefineShape2 with PlaceObject2. My SWF file doesn't have an object PlaceObject3 and DefineShape2. I have attached the sample1.swf for your reference.

    Thanks,
    Neil John


    Neil John
     
  •  06-18-2010, 4:18 PM 244352 in reply to 244152

    Re: How do you display PlaceObject2's image?

    Hello John,

    you can use PlaceObject2.ObjectId property to get object's identifier.

    Please check the link below to read details about this member


    Regards,

    Alex M., Product Developer,
    Aspose Odessa Team
    Contact Us
    Aspose - The .NET and Java Component Publisher
     
  •  06-21-2010, 1:17 AM 244421 in reply to 244352

    Re: How do you display PlaceObject2's image?

    Hi,

    How about the DefineShape? How do we link PlaceObject2 with DefineShape only? I have encountered a sample swf file which do not have an object DefineShape2, but DefineShape exist. Can't seem to link these two objects and retreive the image related to PlaceObject2.

    Please Help,


    Neil John
     
  •  06-21-2010, 4:39 AM 244467 in reply to 244421

    Re: How do you display PlaceObject2's image?

    Hi Neil,

    I would like to inform you that DefineShape object also provides a property called ShapeID which can be used to link to the PlaceObject2 i.e. PlaceObject2.ObjectID = DefineShape.ShapeID.

    Moreover, as I can see in the attached sample file, you're using DefineSprite to place the shape object on the display. In this case, you'll have to go to the particular image through the following steps:

    1. First of all find ObjectID of a particular PlaceObject2 object
    2. Find the DefineSprite object where PlaceObject2.ObjectID = DefineSprite.SpriteID
    3. Now, get the PlaceObject2 objects inside the DefineSprite object
    4. Find the DefineShape object where PlaceObject2.ObjectID = DefineShape.ShapeID
    5. Now, from this DefineShape match the FillStyle to the DefineBitsJPEG2

    I hope this helps. If you have any further questions, please do let us know.
    Regards,


    Shahzad Latif
    Support Developer
    Aspose Sialkot Team
    About Us
    Contact Us
     
  •  06-21-2010, 4:42 AM 244468 in reply to 244467

    Re: How do you display PlaceObject2's image?

    Hello,

    Thanks for the quick response. I'll try with these steps later on.


    Regards,


    Neil John
     
  •  06-21-2010, 8:39 AM 244531 in reply to 244467

    Re: How do you display PlaceObject2's image?

    Hi,

    I got it working, thank you very much for the help.


    More Power,


    Neil John
     
View as RSS news feed in XML