Referencing Images At Runtime Follow

0
Avatar
Legacy Poster

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

3 comments

0
Avatar
Legacy Poster

[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
Avatar
Legacy Poster

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!

johnl
0
Avatar
Ian Cummings
Moderator

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.

Please sign in to leave a comment.