Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

aspSmartImage - addText

Status
Not open for further replies.

krabban

Programmer
Oct 18, 2003
131
SE
Code:
This is working:

oSmartImage.FontFace = strImageFontFace
oSmartImage.FontColor = strImageFontColor
oSmartImage.AddText  [b]"Test me!!"[/b], strVAlign, strHAlign

This is not working:

oSmartImage.FontFace = strImageFontFace
oSmartImage.FontColor = strImageFontColor
oSmartImage.AddText  [b]strImageText[/b], strVAlign, strHalign

How do I do to be able to insert dynamic text!?
 
You have done a Response.Write to make suyre the string is set correctly and isn't empty, etc?

Which version of ASPImage are you using? The properties your using don't appear to be avalable from looking at the 2.x documentation...?

-T

barcode_1.gif
 
aspSmartImage and ASPImage is not the same software.


Code:
Some more relevant code:

' ## ADD TEXT
IF strImageText <> "" THEN
response.write strImageText & "<BR>"  & typeName(strImageText)
	oSmartImage.FontFace = strImageFontFace
	oSmartImage.FontColor = strImageFontColor
	oSmartImage.FontBold = bolBold
'	oSmartImage.AddText  "Test me!!", strVAlign, strHAlign
	oSmartImage.AddText  strImageText, strVAlign, strHAlign
END IF


Errormessage:

this is a test...
String 

Microsoft VBScript runtime error '800a000d' 

Type mismatch: 'AddText' 

/admin/company/aspSmart_confirm.asp, line 104
 
Code:
This is working!

' ## ADD TEXT
IF strImageText <> "" THEN
response.write strImageText & "<BR>"  & typeName(strImageText)
    oSmartImage.FontFace = strImageFontFace
    oSmartImage.FontColor = strImageFontColor
    oSmartImage.FontBold = bolBold
'    oSmartImage.AddText  "Test me!!", strVAlign, strHAlign
    oSmartImage.AddText  [b]CStr(strImageText)[/b], strVAlign, strHAlign
END IF
 
Hmm, odd, they must have programmed that Image object to expect a literal string type, forgetting that everything in ASP is a variant (wel, in VBScript at least). The cStr forces it to pass a string type, satisfying their requirements.

Glad you worked it out, sorry I was on the wrong track before, I was working with ASPImage earlier in the day and must have missed the "Smart" in your post heading :p

-T

barcode_1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top