Results 1 to 5 of 5

Thread: StdPicture Object

  1. #1

    Thread Starter
    Member mysql's Avatar
    Join Date
    Mar 2007
    Location
    System Root
    Posts
    42

    Talking StdPicture Object

    What is an stdpricture Object? Can Please explain me with a simple example?

  2. #2
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: StdPicture Object

    StdPicture is about the same as IPictureDisp. This object is exactly the same as the Picture object you can access in various controls such as PictureBoxes and Images.

    Code:
    Dim MyPicture As StdPicture
    
    Set MyPicture = LoadPicture("c:\test.bmp")
    
    Set Picture1.Picture = MyPicture
    
    Set MyPicture = Nothing
    
    ' array example
    Dim Pictures() As StdPicture
    
    ReDim Pictures(2)
    
    Set Pictures(0) = LoadPicture("c:\image1.jpg")
    Set Pictures(1) = LoadPicture("c:\image2.jpg")
    Set Pictures(2) = LoadPicture("c:\image3.jpg")
    
    Set Picture1.Picture = Pictures(1)
    
    ' clear memory
    Erase Pictures
    The difference between StdPicture and IPictureDisp is that StdPicture is provided via OLE Automation while IPictureDisp is natively in VB's runtime.


    Edit!
    I'll never learn out of [vbcode][/vbcode] tags.

  3. #3

    Thread Starter
    Member mysql's Avatar
    Join Date
    Mar 2007
    Location
    System Root
    Posts
    42

    Talking Re: StdPicture Object

    Thanks merri

    But what is the advantage using of a stdpicture object over Picture object access in various controls. in what situation i should go for a stdpicture object?

  4. #4
    VB6, XHTML & CSS hobbyist Merri's Avatar
    Join Date
    Oct 2002
    Location
    Finland
    Posts
    6,654

    Re: StdPicture Object

    If you want to store (a lot of) pictures you want to use the picture object instead of tons of PictureBox or Image controls. If you want to store images to memory so that they're not visible, but are instantly ready for use. If you want to use a picture object as internal working buffer for handling graphics data.

  5. #5

    Thread Starter
    Member mysql's Avatar
    Join Date
    Mar 2007
    Location
    System Root
    Posts
    42

    Talking Re: StdPicture Object

    Quote Originally Posted by Merri
    If you want to store (a lot of) pictures you want to use the picture object instead of tons of PictureBox or Image controls. If you want to store images to memory so that they're not visible, but are instantly ready for use. If you want to use a picture object as internal working buffer for handling graphics data.
    Thanks marrie. i really undestand.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width