Toggling Embedded Graphics

Label printing integration (NiceWatch middleware and ActiveX programming interface)

Moderators: Georges, milos, NiceLabel Support Team

Post Reply
M. Thompson
Newcomer
Posts: 5
Joined: Wed Aug 08, 2007 11:33 pm
Location: Andover MA

Toggling Embedded Graphics

Post by M. Thompson » Wed Aug 08, 2007 11:40 pm

Hi,

I have an application where I need to toggle on or off Agency logos programmatically using the ActiveX interface.

These logos are bitmaps that I have embedded in the label files.

Is there a way to do this?

Thanks.

User avatar
lpatty
NiceLabel
NiceLabel
Posts: 60
Joined: Mon Sep 11, 2006 4:15 pm
Location: Milwaukee, WI
Contact:

Post by lpatty » Fri Aug 10, 2007 12:02 am

The only way to do this is to make the graphic positions as variable fields on your label design. At runtime, you will have to provide a path and image file name to the variable positions that you need a graphic to print in through the API.

M. Thompson
Newcomer
Posts: 5
Joined: Wed Aug 08, 2007 11:33 pm
Location: Andover MA

Post by M. Thompson » Fri Aug 10, 2007 12:09 am

Thank you for the reply. I was afraid of that.
I had hoped to keep the Graphics embedded in the label files for portability.
I'm surprised that the IGraphics interface doesn't expose the Status property (Normal / Non Printable).
Does anyone know why?

M. Thompson
Newcomer
Posts: 5
Joined: Wed Aug 08, 2007 11:33 pm
Location: Andover MA

Post by M. Thompson » Fri Aug 10, 2007 6:00 pm

Not to keep beating this bush but it really is kind of a big deal for us.

I can "Read" the object status as Normal (0) or Not Printable (2) from the Object interface. For example, using the NiceLabel interface opened already in the VB example:

Code: Select all

Dim i As Long
Dim LabelObj As ObjectList
Dim IObj As Object
Const otBitmap = 303

  For i = 1 To LabelIntf.Objects.Count     'Walk through List of objects
     Set IObj = LabelIntf.Objects.Item(i)
     If IObj.Kind = otBitmap Then          'See if it's a bitmap
         VariablesList.AddItem (IObj.Name & "  " & IObj.Status)
     End If
     If IObj.Name = "CE" Then   'See if it's agency I made "Non-Printable"
         IObj.Status = 0        'Throws "Invalid Property Assignment" 
     End If
  Next i
In the Programming Guide Version 20070510-17, it doesn't list what the Access Rights are for this property but VB sees it as Read-Only.

Is Read/Write capability for this available in the SDK version of the software? It seems like it's so close to not having to use dependancy files for the label.

It seemed from the literature that anything I can do in the NiceLabel Pro application, I could do via the API.
Is this something that's being looked at for a future NiceLabel release?

D
Valued Contributor
Posts: 46
Joined: Wed Dec 06, 2006 4:22 pm

Post by D » Fri Aug 10, 2007 6:29 pm

Hi,

This may be of no use at all, but...

Are your graphics stored as variables with a default value? If so, you may be able to disable all but the ones you want to print - the IsDisabled property of IVar is listed as read-write (at least in NL4).

HTH,

Duane

M. Thompson
Newcomer
Posts: 5
Joined: Wed Aug 08, 2007 11:33 pm
Location: Andover MA

Post by M. Thompson » Mon Aug 13, 2007 8:04 pm

Hi Duane,

Thanks for the response. It seems that if I store the graphics as variables, I'm unable to embed them into the label file.

I still end up with my portability problem.

There also does seem to be a performance hit when loading the bitmaps. My load time goes from aprox 500mS to a high of 3300mS as I load bitmaps in.

I was hoping that by having the bitmaps already loaded and just toggling an attribute, I would save time. lpatty is right.

I was hoping to hear a response to my Aug 10 post about the Read/Wite access of the Object "Status" parameter, if the SDK allows a write.

User avatar
jurk
Addict
Addict
Posts: 175
Joined: Wed Sep 27, 2006 1:10 pm
Location: Sencur, Slovenija
Contact:

Post by jurk » Mon Oct 08, 2007 12:01 pm

Try to use Graphics Lookup Tables (Data->Lookup Tables and check Graphics Table) 8)
NiceLabel Development

User avatar
Saso
NiceLabel
NiceLabel
Posts: 2974
Joined: Mon Sep 04, 2006 8:09 am
Contact:

Post by Saso » Tue Jan 08, 2008 3:13 pm

In NiceLabel v5.1 there is the option to programmable change the visibility state of the label objects.

INiceLabel interface has a new method for setting Object visibility on the label. You can change the object state to visible/not visible.

The method is the following:

Code: Select all

bool SetObjectVisible (string ObjectName, bool Visible)

Parameters:
ObjectName: the name of the object, for which the visible property should be changed
Visible: true/false - visible status after the call. If parameter is false, the object will get status Phantom.
See the NiceLabel Programming Guide for additional information.
Saso Fleiser
Senior Technical Product Specialist

Post Reply