Click to See Complete Forum and Search --> : Picture Object


Raistlin
June 25th, 2001, 04:37 PM
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

cksiow
June 25th, 2001, 07:35 PM
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

Raistlin
June 26th, 2001, 08:47 AM
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

cksiow
June 26th, 2001, 07:13 PM
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

Raistlin
June 27th, 2001, 09:40 AM
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