Changing Image assigned to Slot
joseanio
Posts: 42
Hi there,
Could some one please let me konw if is there a way to change the image (Bitmap) assigned to Slot by netlinx code .
Something like this :
send_command dvTP," .. 'image.bmp' .. Slot=23.. " or an other
Thanks in advance
Could some one please let me konw if is there a way to change the image (Bitmap) assigned to Slot by netlinx code .
Something like this :
send_command dvTP," .. 'image.bmp' .. Slot=23.. " or an other
Thanks in advance
0
Comments
Or you just include the entire button image in the bitmap file and you don't have to worry about layering two separate images.
Thanks guys by your point of view.
I know that I can change the buttons' bitmap or Icon . But in this case i should change all over the Pages' Images from my project.
I am looking for a way to change all of them with only one command.
The idea about the dynamic image is good , but i would like to put all solution on the box.
I will still study and opened to suggestions.
The biggest problem with icon slots is that they don't transfer well between projects. I can't tell you the times I've copied pages from a download module that used icon slots, and then had to manually go through each and every button to correct the images. If you copy a page into your project that is using icon slots that are already in use, it just assigned them to available slots. But the property refers to the original slots, and the wrong image is displayed. And since everyone who writes a module for distribution uses the lowest slot numbers, it happens pretty much every time.
So my advice is, don't use them.
I have to strongly disagree with your assessment as icons being obsolete. While I use them more often than not at some point, it's for exactly what you said: overlaying two images.
In some of my designs, I have a bitmap that can be used for multiple buttons - think a gradient that spans 800 pixels and has a height of 100. (And others that are 40, 50, 60, 80, 120, etc. in height.) I know several people that do this and have seen it in some of AMX's designs, so it's not a new concept. So that takes up the "Bitmap" property, so if I want an icon or image of say a Wii or an XBox on it I shouldn't have to actually layer two buttons - that is when I use an "Icon." I can resize the button as much as I want and keep the icon where it's supposed to be in relation to the button. I don't have to move a second button and align it where I want . . . now do this for say 8 buttons, and then you have to add a 9th, or remove one and re-align them all. There's an option to space buttons evenly - with your two button scenario - it just doesn't work.
And I haven't even touched on changing the Icon property from code. Do you have two button addresses? One for the passthrough "icon" button and one for the other if you need to change any property? When using icon slots - you can change it all with a single BMF command.
Everything you've described is too much work for me, so I'll stick with the obsolete icon and not have to worry about moving two buttons.
We all do things the way we feel most comfortable with. I use modules extensively, and I create panels with the express intent to copy and paste pages from one project to another. This is where icon slots fail. Every third party that creates panel pages uses the same set of slots. If you have several dozen modules of there own, it's impossible to create a slot scheme where they will never overlap. Therefore, it's impossible in either situation for the icons to be correct when copied into another design.
If you hand-craft every page from scratch for every project, it won't be an issue. But that's not how I work, so they don't work for me.
The managing of icons can be a pain - I totally agree - but my opinion of dealing with two buttons to get the image-on-image look still stands.
. . . I wish there was a better saying than "There's a million ways to skin a cat" and hold the same sentiment.
Paul
I wonder if you can use an integer array in the ^ico command like you can with ^sho. That might clear up the original poster's question.
You still need to have all of your images preloaded, but it would let you change a big number of buttons with one command.
Something like this: