|
-
Apr 28th, 2001, 04:46 PM
#1
Thread Starter
Addicted Member
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
-
Apr 28th, 2001, 05:01 PM
#2
Addicted Member
Use the LoadPicture-Method.
Set Pic = LoadPicture( strTag & ".Bmp" [,OptCode] )
Hope this helps,
Dennis.
Code that I author is neither elegant nor efficient. It is, however, functional. Once I get something that works, I'm generally satisfied with myself - I mean, if it works, that's good enough, right?
Originally posted by aknisely
Sorry, but I feel uncomfortable on CC with clothes on
__________________
The truth ... is out there!
-
Apr 28th, 2001, 05:07 PM
#3
Thread Starter
Addicted Member
whats
Set Pic = LoadPicture( strTag & ".Bmp" [,OptCode] )
OPTCODE???
thanks,
Matt
-
Apr 28th, 2001, 05:09 PM
#4
Addicted Member
[, OptCode] should just indicate that there's more possible... 
In general you just use the Path-Param.
Code that I author is neither elegant nor efficient. It is, however, functional. Once I get something that works, I'm generally satisfied with myself - I mean, if it works, that's good enough, right?
Originally posted by aknisely
Sorry, but I feel uncomfortable on CC with clothes on
__________________
The truth ... is out there!
-
Apr 28th, 2001, 05:12 PM
#5
Thread Starter
Addicted Member
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
-
Apr 28th, 2001, 05:15 PM
#6
[, 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.
-
Apr 28th, 2001, 05:20 PM
#7
Addicted Member
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.
Code that I author is neither elegant nor efficient. It is, however, functional. Once I get something that works, I'm generally satisfied with myself - I mean, if it works, that's good enough, right?
Originally posted by aknisely
Sorry, but I feel uncomfortable on CC with clothes on
__________________
The truth ... is out there!
-
Apr 28th, 2001, 05:22 PM
#8
Addicted Member
I hate to write things somebody else wrote 5 minutes before
Code that I author is neither elegant nor efficient. It is, however, functional. Once I get something that works, I'm generally satisfied with myself - I mean, if it works, that's good enough, right?
Originally posted by aknisely
Sorry, but I feel uncomfortable on CC with clothes on
__________________
The truth ... is out there!
-
Apr 28th, 2001, 05:23 PM
#9
Hyperactive Member
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.
-
Apr 28th, 2001, 05:25 PM
#10
Try this:
Code:
Private Sub pitcher()
Dim strTag As String
strTag = PIC.Tag
Set PIC = LoadPicture("C:\tecmo\faces\" & strTag & ".bmp")
End Sub
-
Apr 28th, 2001, 05:27 PM
#11
Addicted Member
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*))
Code that I author is neither elegant nor efficient. It is, however, functional. Once I get something that works, I'm generally satisfied with myself - I mean, if it works, that's good enough, right?
Originally posted by aknisely
Sorry, but I feel uncomfortable on CC with clothes on
__________________
The truth ... is out there!
-
Apr 28th, 2001, 05:27 PM
#12
Thread Starter
Addicted Member
thanks guys it works
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|