Navigation:  The Buzz > Forms and Controls > Buttons >

Image Buttons

Previous pageReturn to chapter overviewNext page

 

Ok I was trying to use some of Kieths excellent Get .Dll button images

as image buttons in 10 and having no luck. The images are designed to

work with Get .dll but I wanted to try to convert them for use in 10.

 

For one thing it doesn't seem to recognize the shape, I've used some

other button images and they worked fine, but these get scrambled. Fair

enough.

 

So I edited one into just a .jpg with the graduated white to blue color

shading that gives it that vista look.

 

I put that on the button as an 'image with text' , it looks great in

toolkit but at runtime the button is just blank - no text, no image,

nothing.

 

I tried this with some other images as well, I don't get anything at all

at runtime. Can somebody explain how the image buttons work in 10 ?

 

J

 

Hello Jean,

 

Although I am not using V.10 (using 9.4), I had encountered this

issue many years ago when starting with image buttons.

 

One cause is that the variable you have attached to the button may

not be long enough to hold the full path name of the image location.

In other words, if your image is called

"c:\magic\images\myimage.bmp", which is 27 characters in length, then

the variable that you will be updating with this path must be at

least 27 alpha characters in length.

 

Another thing to note... if you are using lots of image buttons in

your program form, you may want to update them in the task prefix

rather than initializing them in the task main. Unless you are

planning on changing the image during the program use, this will

prevent magic from reloading the image buttons over and over again at

runtime, since they will only be loaded once when you start the

program. When you have lots of images on your form it can make a

noticeable difference in program speed.

 

Hope this helps.

Andy

 

Jean,

 

Something simple: Hopefully you have the Get dll in the v10 runtime

directory and that the paths are set correctly in the logical names.

 

Keith

 

Yes sorry, I was trying to do this without get .dll in V10. I'm hoping

V10 should allow me to do it all natively in magic.

 

For 9.4 we can use them with Get .Dll.

 

I was trying with various formats, but I gave up on the button for now

and was trying another approach (an edit field with transparent color

over an image)

 

I tried the button both as a real field and as a form object with no

field associated. The path was hardcoded. I think the path is good

because it displays the image in toolkit.

 

J

 

 

 


Page url: http://www.magic-iug.com/MIUGWeb3/index.html?image_buttons2.htm