Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: What kind of buttons do you use for skinning?  (Read 1645 times)

0 Members and 1 Guest are viewing this topic.

unclet

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3561
  • Last login:March 17, 2025, 11:51:15 am
What kind of buttons do you use for skinning?
« on: February 05, 2007, 08:49:03 pm »
I have a VB6.0 application in which I use a lot of normal VB command buttons.   This makes my application look really "Windows-ey".  I would like to replace those crappy looking buttons with nice buttons (ie: ovals, circles, box with round corners, etc...), however, I am not sure how most people do this.  I have been looking around for some user controls which other people have created but nothing seems worth while (at least with the ones I found).

For those of you with VB experience in using nice buttons, how do you recommend I go about doing this?   

1) Do most people simply use Image controls in place of an actual command buttons, thus allowing people to skin each button with their own design? 

2) Do people actually allow people to skin each "button" in the application with an image (or color)?   

3) How does skinning really work when buttons are involved?

Thanks for any insight you can provided me here.    I would really like people to have the ability to skin my application but have no idea how this is done when buttons are involved.


headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: What kind of buttons do you use for skinning?
« Reply #1 on: February 06, 2007, 05:18:34 am »
I don't really code in VB6 anymore and if I was to write jukebox software it would be using Direct Draw or prefereably Direct3D. If worse came to worse I would use GDI+, but I would definately try to avoid writing anything graphical like jukebox software in a Windows form. I'm not trying to put down your software, I'm just saying the way I would do it (so in most cases I won't be much help with your app). Having said that I do understand your plight and remember tackling the issue myself back when I was learning VB6.

I just had a look through some old archives and found an old VB6 app I wrote that skinned a normal app to make it look a little like OSX. It's not ideal since you wouldn't want to load the buttons images when you roll over an image like I have done. I would have everything in an ImageList or something. There are some great VB6 forums that I used to visit called Xtreme VB Talk. There are plenty of people that can help you with anything related to VB6 over there.

unclet

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3561
  • Last login:March 17, 2025, 11:51:15 am
Re: What kind of buttons do you use for skinning?
« Reply #2 on: February 06, 2007, 07:05:56 am »
I have never used any of those tools you mentioned before.   Too late to start trying right now anyway  :>)

I will have a look at your attached project.   Also, I will go to the site you recommended as well.  Thanks

youki

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1612
  • Last login:November 19, 2016, 01:07:33 pm
  • Atomic Front End Creator
    • Atomic Front End
Re: What kind of buttons do you use for skinning?
« Reply #3 on: February 06, 2007, 11:16:48 am »
I didn't code in VB since a long long time...

But i think what i would do  is to use image .  In fact as VB 6 Like OCX , i think i would build my own GraphicButton button OCX that would be configurable with properties like "normalImage" , "ClickedImage", "RollOverImage" where you simply define image you want for these state.  And may be a property like "TransparentColor".
Then i would use this ocx everywhere i need a graphic button.

I talk about OCX, but it could be a simple Class. But i think the advantage of the OCX in VB is that you will be able to drag and drop the button on your form from the U.I and configure it with the property editor.

But i'm pretty sure that this kind of OCX already exists.


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19428
  • Last login:Today at 11:06:50 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: What kind of buttons do you use for skinning?
« Reply #4 on: February 06, 2007, 12:32:33 pm »
I don't even bother with real 'buttons' in such cases because they aren't needed. 

A picturebox or image control can display literally anything, has  mouse-over/down ect events and that all important click event.  Remember, those fancy looking, "non-windowsy" apps like winamp use such a technique (although at this point I think they have moved on to dx or soemthing hardware accelerated.  Like hk said though, anymore when I use vb for something "purdy" I use dx rendering.  Vs6 just has too much flickering to implement animation and blend effects, and gdi+ is slow and harder to work with imho. 

unclet

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3561
  • Last login:March 17, 2025, 11:51:15 am
Re: What kind of buttons do you use for skinning?
« Reply #5 on: February 06, 2007, 02:00:41 pm »
Where can I read about "dx rendering" (ie: what it is ... how to code with it... etc)?

Unless I could utilize dx rendering on top of my VB6.0 application, then it is too late for me to switch from using VB6.0 as the programming language since I do not want to rewrite all the logic behind it. 

Does anyone know of a good VB6.0 OCX which offers an Image Control as a button and has the features Youki mentions? 

headkaze
When you mentioned "ImageList" above .... were you recommending I load all Image files (which I require in my app) at one time during loading in store them into an array of Image controls so changing between images did not have to keep reading the harddrive image file all the time?   Basically, does "ImageList" mean an array of Image controls?


Howard
What do you mean "flickering" when using an image control?   Do you mean when the Image control is resized then flickering occurs during the repaint cycle or perhaps you mean loading a new image into the Image control causes some flickering so if I had many Image controls as buttons then it would be very noticible?

I would need to use Image controls since PictureBox controls do not automatically resize the image within the control when the control is resized I believe.




« Last Edit: February 06, 2007, 02:09:16 pm by unclet »

Chris

  • Trade Count: (+2)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4574
  • Last login:September 21, 2019, 04:59:49 pm
    • Chris's MAME Cabinet
Re: What kind of buttons do you use for skinning?
« Reply #6 on: February 06, 2007, 02:14:04 pm »
I'm using C and not VB, but to answer the second part of your question, yes, I allow the user to specify on and off images for each control.  If the off image is not specified, I copy the background at the button's coordinates into a buffer for the off image, and if the on image is not specified I take whatever's in the off image buffer, shift that image right and down a couple of pixels and store it in another buffer for the on image.  All of the images are loaded, scaled, and rotated at startup to account for resolution, aspect ratio and orientation so I don't have to do any of that on the fly.

--Chris
--Chris
DOSCab/WinCab Jukebox: http://www.dwjukebox.com

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 19428
  • Last login:Today at 11:06:50 am
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: What kind of buttons do you use for skinning?
« Reply #7 on: February 06, 2007, 06:36:34 pm »
Where can I read about "dx rendering" (ie: what it is ... how to code with it... etc)?

Unless I could utilize dx rendering on top of my VB6.0 application, then it is too late for me to switch from using VB6.0 as the programming language since I do not want to rewrite all the logic behind it. 

Does anyone know of a good VB6.0 OCX which offers an Image Control as a button and has the features Youki mentions? 

Howard
What do you mean "flickering" when using an image control?   Do you mean when the Image control is resized then flickering occurs during the repaint cycle or perhaps you mean loading a new image into the Image control causes some flickering so if I had many Image controls as buttons then it would be very noticible?

I would need to use Image controls since PictureBox controls do not automatically resize the image within the control when the control is resized I believe.

Yes, dx is just a rendering application.  You can use up to dx8 in vb.  Search for directx4vb in google.  (Site addy recently changed)

I'm sure there are tons of ocx's that do what youki is saying but I really don't see the point. 

Here's what you do....  for an individual image's mouseover event, you swap the image.  For the form's mouseover event (meaning you aren't over the image anymore) you loop through all the image controls, changing them all back to default.  It'll give you the same functionality basically.  You can also setup a function to reset all the images but the current one when you do a mouseover and that'll be more foolproof (in those rare cases when you move from one button to another without ever moving over empty form.)  I know that sounds complicated, but even a ready made ocx is going to have the exact same issues and thus you are going to have to do this bit of code anyway.  Thus why I don't see the point.

Flickering occurs when a lot of things happen.
It occurs when:

An image control is resized. 
An image control is moved across the screen.
One image control overlaps another and the images in them are changed regularly.
The background or anything behind them gets a new image. 

Now picture boxes don't flicker when you move them around, but I don't know how useful that is as they don't have a transparent back.

Basically if your app will esssentially be static with the exception of an image swap at mouseover events you are good.  If you'll be moving things around (animations ect) then it'll flicker too badly to be useable. 


hope that helps

unclet

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3561
  • Last login:March 17, 2025, 11:51:15 am
Re: What kind of buttons do you use for skinning?
« Reply #8 on: February 06, 2007, 09:34:37 pm »
The thing about using images is that the Image control is a square (or rectangle).  If I use Image controls, then would the rectangles still look "Windowsy"?


Howard
I will look the Dx stuff ... thanks.

Chris
1) Do you allow you application to be resized by the user?  If so, then I guess a lot of button images would need to be updated.  Well ..... perhaps you do not have a "lot" of buttons on a page so it might not be that intensive.

2) Will you please describe the type of buffer you use to store Image controls which you load at startup?   Is this an array of Image controls which you simply populate with the correct images at startup and then simply copy the correct image from one the Image control buffer into the visible Image Control on your application?

« Last Edit: February 06, 2007, 09:38:11 pm by unclet »

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: What kind of buttons do you use for skinning?
« Reply #9 on: February 07, 2007, 01:42:43 am »
The thing about using images is that the Image control is a square (or rectangle).  If I use Image controls, then would the rectangles still look "Windowsy"?

You can set BorderStyle to none and that will not put anything around the image. You can do that to most controls too.

headkaze
When you mentioned "ImageList" above .... were you recommending I load all Image files (which I require in my app) at one time during loading in store them into an array of Image controls so changing between images did not have to keep reading the harddrive image file all the time?   Basically, does "ImageList" mean an array of Image controls?

Thats exactly what I mean by using an ImageList, on startup you load all the images into an ImageList and they are stored in memory. No more reading from the HDD.

unclet

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3561
  • Last login:March 17, 2025, 11:51:15 am
Re: What kind of buttons do you use for skinning?
« Reply #10 on: February 07, 2007, 02:45:08 pm »
Ok, thanks for clearing that up.   Seems like this is the best route to take for me, although I have not looked into the dx stuff.   Hopefully that is not completely hard to understand.

unclet

  • Trade Count: (+4)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3561
  • Last login:March 17, 2025, 11:51:15 am
Re: What kind of buttons do you use for skinning?
« Reply #11 on: February 10, 2007, 03:48:53 pm »
I just discovered that there is a control called "ImageList" included in the "Common Controls 6.0" components.  This is probably what you were referring I use to store all images at the beginning ... correct?

Is there any examples of using the ImageList?   I will try to search for some I guess.