CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: Picture Object

  1. #1
    Join Date
    Dec 2000
    Location
    Canada
    Posts
    59

    Picture Object

    Can anyone help??
    I need to pass a picture back from a function to the caller without writing the picture to the hard drive.
    Here is my code that doesn't work.


    public Function Create_picture(moSymbol as MapObjects2.Symbol, X as Integer, Y as Integer)

    set frmCreatePic.sym = moSymbol
    frmCreatePic.X = X
    frmCreatePic.Y = Y
    Load frmCreatePic
    frmCreatePic.Show vbModal
    Create_picture = frmCreatePic.ImageList1.ListImages(1).Picture
    End Function

    'This works but the caller of this function says
    '"Object required"

    'CALLER --->
    Picture1.Picture = obj.Create_picture(sym, 120, 50)





    Thank you
    Raistlin


  2. #2
    Join Date
    Apr 2000
    Posts
    737

    Re: Picture Object

    when you want to assign an object to other, should you put a set like this

    Set Picture1.Picture = obj.Create_picture(sym, 120, 50)

    instead of

    Picture1.Picture = obj.Create_picture(sym, 120, 50) ??



    HTH

    cksiow
    http://vblib.virtualave.net - share our codes

  3. #3
    Join Date
    Dec 2000
    Location
    Canada
    Posts
    59

    Re: Picture Object

    The set Object didn't work.
    Still says "Object required"

    I tried everything!!. If you have some code that work and was tested I would be happy.

    Thank you

    Fellow Dev
    Raistlin


  4. #4
    Join Date
    Apr 2000
    Posts
    737

    Re: Picture Object

    the following code will set picture2 to have the same picture as picture1, not sure whether it will help.


    private Function getpic() as IPicture

    set getpic = Picture2.Picture

    End Function


    private Sub Form_Load()

    set Picture1.Picture = getpic

    End Sub







    HTH

    cksiow
    http://vblib.virtualave.net - share our codes

  5. #5
    Join Date
    Dec 2000
    Location
    Canada
    Posts
    59

    Re: Picture Object

    THANK YOU.
    IT WORKED GREAT!!!!
    It was a pretty dumb question but I could figure it out.

    Anyways thank you to all Guru's
    Raisltin


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

Featured