-
Please Help
ok I am trying to call all pictures at this location
c:\tecmo\faces\"strtag".bmp
how do I load the pic so if
pic.tag = 15 then it loads c:\tecmo\faces\15.bmp
and so on??
i tried below and it didnt work
Private Sub pitcher()
Dim strTag As String
strTag = PIC.Tag
PIC = strTag & ".Bmp"
End Sub
thanks,
Matt
-
Use the LoadPicture-Method.
Set Pic = LoadPicture( strTag & ".Bmp" [,OptCode] )
Hope this helps,
Dennis.
-
whats
Set Pic = LoadPicture( strTag & ".Bmp" [,OptCode] )
OPTCODE???
thanks,
Matt
-
[, OptCode] should just indicate that there's more possible... ;)
In general you just use the Path-Param.
-
1 more thing here is my code now
Private Sub pitcher()
Dim strTag As String
strTag = PIC.Tag
Set PIC = LoadPicture(c:\tecmo\faces\strTag & ".Bmp")
End Sub
and I am getting a syntax error and expect list or seperater????
thanks I am still learning
MAtt
-
[, OptCode] = Optional Code, you can use it or you don't have to.
Here are your options that you can use beside the filename with the LoadPicture function.
LoadPicture([FileName], [Size], [ColorDepth], [X], [Y]) As IPictureDisp
Filename is required, all others are optional.
-
LoadPicture has several options:
LoadPicture([FileName], [Size], [ColorDepth], [X], [Y]) As IPictureDisp
I've bundled the rest... ;)
Code:
Private Sub pitcher()
Dim strTag As String
strTag = PIC.Tag
Set PIC = LoadPicture(c:\tecmo\faces\strTag & ".Bmp")
End Sub
This should work:
Code:
Private Sub pitcher()
Dim strTag As String
strTag = PIC.Tag
Set PIC.Picture = LoadPicture("c:\tecmo\faces\" & strTag & ".Bmp")
End Sub
Dennis.
-
I hate to write things somebody else wrote 5 minutes before ;)
-
The LoadPicture Command requires a String argument, the code you used need quotes around the path like this:
Code:
Private Sub pitcher()
Dim strTag As String
strTag = PIC.Tag
Set PIC = LoadPicture("c:\tecmo\faces\" & strTag & ".Bmp")
This should work because you are directly assigning the tag number to a string variable. Keep in mind, if you had used the Str() function to convert the tag number to a string, it would have had a leading space:
strTag = Str(PIC.Tag)
strTag would equal " 15"
To get around this, use the Format function:
strTag = Format(PIC.Tag)
strTag would equal "15"
It doesn't matter for the code above, but just for future reference. ;)
-
Try this:
Code:
Private Sub pitcher()
Dim strTag As String
strTag = PIC.Tag
Set PIC = LoadPicture("C:\tecmo\faces\" & strTag & ".bmp")
End Sub
-
Str() is the most useless function in vb I think...
Doesn't anybody know CStr() ? It converts everything to a string without leading spaces... Always seeing Trim(Str(*blah*))
-