Referencing Images At Runtime
hi
i'm evaluating the enterprise edition for use in multiple programs my company designs/distributes.
i am using the the code below to set substrings:
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim btApp As BarTender.Application
btApp = CreateObject("BarTender.Application")
Dim btFormat As New BarTender.Format
btFormat = btApp.Formats.Open("C:\Documents and Settings\johnl\My Documents\BarTender\Labels\Label5.btw", False, "")
'Set the substring data
btFormat.SetNamedSubStringValue("OrderCode", "WO222222-22")
btFormat.SetNamedSubStringValue("MaterialCode", "MATCODE12345")
'etc., etc.
btFormat.PrintOut(False, False)
btFormat.Close(BarTender.BtSaveOptions.btDoNotSaveChanges)
btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges)
End Sub
i need to add 1 to 3 icons to the label at runtime, by passing a name or path.
maybe i need to set pictures as placeholders and reference them.
is this possible - if so how?
regards
johnl
i'm evaluating the enterprise edition for use in multiple programs my company designs/distributes.
i am using the the code below to set substrings:
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim btApp As BarTender.Application
btApp = CreateObject("BarTender.Application")
Dim btFormat As New BarTender.Format
btFormat = btApp.Formats.Open("C:\Documents and Settings\johnl\My Documents\BarTender\Labels\Label5.btw", False, "")
'Set the substring data
btFormat.SetNamedSubStringValue("OrderCode", "WO222222-22")
btFormat.SetNamedSubStringValue("MaterialCode", "MATCODE12345")
'etc., etc.
btFormat.PrintOut(False, False)
btFormat.Close(BarTender.BtSaveOptions.btDoNotSaveChanges)
btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges)
End Sub
i need to add 1 to 3 icons to the label at runtime, by passing a name or path.
maybe i need to set pictures as placeholders and reference them.
is this possible - if so how?
regards
johnl
0
-
Legacy Poster
★ BarTender Hero ★
[quote name='johnl' timestamp='1313408996' post='370']
hi
i'm evaluating the enterprise edition for use in multiple programs my company designs/distributes.
i am using the the code below to set substrings:
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Dim btApp As BarTender.Application
btApp = CreateObject("BarTender.Application")
Dim btFormat As New BarTender.Format
btFormat = btApp.Formats.Open("C:\Documents and Settings\johnl\My Documents\BarTender\Labels\Label5.btw", False, "")
'Set the substring data
btFormat.SetNamedSubStringValue("OrderCode", "WO222222-22")
btFormat.SetNamedSubStringValue("MaterialCode", "MATCODE12345")
'etc., etc.
btFormat.PrintOut(False, False)
btFormat.Close(BarTender.BtSaveOptions.btDoNotSaveChanges)
btApp.Quit(BarTender.BtSaveOptions.btDoNotSaveChanges)
End Sub
i need to add 1 to 3 icons to the label at runtime, by passing a name or path.
maybe i need to set pictures as placeholders and reference them.
is this possible - if so how?
regards
johnl
[/quote]0 -
Legacy Poster
★ BarTender Hero ★
hi all
panic over - although it is called a picture and the name is picture1, picture2, etc.,
i found the way to do it in the help under Images!
johnl0 -
The easiest way of doing this is to place a picture on your label and set it to be data source via a link. You can set the path of where your picture files are located so that all you need to do in the data source is set the name of the image itself such as: Picture.png
Be sure to configure the print time error handling of the picture so that it never abort the print job if an image is not found or specified.
Then in your code you would set the sub-string value of the picture with the appropriate filename that you wish to print. Setting the sub-string value to nothing will cause the object not to print.0
Iniciar sesión para dejar un comentario.
Comentarios
3 comentarios