Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Skinning with VB6

  1. #1
    (6)
    (6) is offline
    Newbie (6)'s Avatar
    Join Date
    Oct 2004
    Posts
    47

    Question Skinning with VB6

    Ive been searching and searching for tutorials or examples on how to skin an application using just 2 imges like frodoplayer. Frodo someone gave me a hint a while ago about this an said to look into BITBLT & STRETCH. I have found an example that switches images but there is two thigns wrong with what i have.
    1. - When the image is licked to swap, once and a while youll see a flash of white. kind of annoying.
    2. - i canonly get it to work with the whole iamge swap not just sections of it for each individual button command.

    Hope smeone can help...

    Thanks.

  2. #2
    Raw Wave Confused's Avatar
    Join Date
    Aug 2003
    Location
    Essex, England
    Posts
    2,224
    For switching the skin on buttons it's best to position PictureBoxes on the form where you want the buttons to be, and blit into those. Make sure also that AutoRefresh and AutoRedraw are set to false (but remember when you're done to issue the "PictureBox.Refresh" command.
    Co-Developer of A.I.M.E.E
    www.aimee.cc

  3. #3
    (6)
    (6) is offline
    Newbie (6)'s Avatar
    Join Date
    Oct 2004
    Posts
    47
    Quote Originally Posted by Confused
    For switching the skin on buttons it's best to position PictureBoxes on the form where you want the buttons to be, and blit into those. Make sure also that AutoRefresh and AutoRedraw are set to false (but remember when you're done to issue the "PictureBox.Refresh" command.

    So what you are saying is set the form background to the off-state and then use a picturebox to blit in the down-state image ?

  4. #4
    Registered User kollitiri's Avatar
    Join Date
    Oct 2004
    Location
    Athens, GREECE
    Posts
    37
    the way to do the skinning with two at least images is very simple

    just open a project in VB 6.0, create a form with 12000x7200 width x height

    insert an image control (image1) in it with the same size, stretch is on
    give the same size as form to image1

    insert 2 pictureclip objects (must be enabled from components list), they will be like an array of objects pictureclip1(0), pictureclip1(1). create the first and copy-paste the other answering yes to the array.

    load in each one the frodo player background (e.g audio player, backgrounddown.jpg, backgroundup.jpg) when is on and off conditions. 0=on 1=off

    insert an image2 image with strectch on and place it on a play button or what ever you want

    insert the following code in the form

    and you have a nice skinable app without blink, blip, beep and things like these.. Very easy and straight. no problems with flickering and flashing when it is on a control

    simple skin code -----------
    -------


    Dim buttonon As Boolean

    Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
    If KeyCode = vbKeyEscape Then
    Unload Me
    End If
    End Sub

    Private Sub Form_Load()
    buttonon = False
    PictureClip1(1).ClipX = Image1.Left \ 15
    PictureClip1(1).ClipY = Image1.Top \ 15
    PictureClip1(1).ClipHeight = Image1.Height \ 15
    PictureClip1(1).ClipWidth = Image1.Width \ 15
    Image1.Picture = PictureClip1(1).Clip

    End Sub

    Private Sub Image2_Click()
    buttonon = Not buttonon
    If buttonon Then
    PictureClip1(0).ClipX = Image2.Left / 15
    PictureClip1(0).ClipY = Image2.Top / 15
    PictureClip1(0).ClipHeight = Image2.Height / 15
    PictureClip1(0).ClipWidth = Image2.Width / 15
    Image2.Picture = PictureClip1(0).Clip
    Else
    PictureClip1(1).ClipX = Image2.Left / 15
    PictureClip1(1).ClipY = Image2.Top / 15
    PictureClip1(1).ClipHeight = Image2.Height / 15
    PictureClip1(1).ClipWidth = Image2.Width / 15
    Image2.Picture = PictureClip1(1).Clip
    End If
    End Sub


    Chears
    Michael

  5. #5
    (6)
    (6) is offline
    Newbie (6)'s Avatar
    Join Date
    Oct 2004
    Posts
    47

    Almost works

    Ive tred to do ask you ask and it doesn't work right. When i run the form the Off image width isnt wide enough throwing every off. The iamge swap work s nicley but the iamge is too short for the form.

    Any idea as to why ?

  6. #6
    (6)
    (6) is offline
    Newbie (6)'s Avatar
    Join Date
    Oct 2004
    Posts
    47

    Wrong ratio

    Sorry my bad i had the wrong ratio setup. It was on user not twips.
    Thankyou for the example it works well.

    Ive tried to figure out the picturebox way and have no luck. If there is an example you can give that woudl help out alot. If it is a better way to skin then i wodl iek to do it that way. I am very new to VB6 and trying to learn..

    Thanks for your help.........

    S|X

  7. #7
    Registered User kollitiri's Avatar
    Join Date
    Oct 2004
    Location
    Athens, GREECE
    Posts
    37
    I think the best and easy way to work is this one. And you can add more pictureclip1 layers so, you can have more states (empty, off, down, over, on, ...). just select the proper pictureclip1 and you will have a different state.

    I wish you and all of you

    Marry X'mas & Happy New Year

    Michael

  8. #8
    Low Bitrate jimothy's Avatar
    Join Date
    Oct 2004
    Location
    Northern VA
    Posts
    64

    Vb.net

    Does anyone know if the aformentioned process is similar for VB.NET? I've made a couple of applications and I was thinking of making them skinnable - but I wasn't sure where I should start.

  9. #9
    Newbie BMWOrangeDesign's Avatar
    Join Date
    Aug 2004
    Location
    Bury St Edmunds, uk
    Posts
    30
    Quote Originally Posted by kollitiri
    insert 2 pictureclip objects (must be enabled from components list), they will be like an array of objects pictureclip1(0), pictureclip1(1). create the first and copy-paste the other answering yes to the array.

    load in each one the frodo player background (e.g audio player, backgrounddown.jpg, backgroundup.jpg) when is on and off conditions. 0=on 1=off
    Just a newbie question here but how do i do this?
    Project Status.

    CPU : Still gathering parts and planning.
    SCREEN : Lilliput
    FABRICATION : 10% Done
    IBUS : Working buttons

  10. #10
    Raw Wave
    Join Date
    Jun 2004
    Location
    On the beach
    Posts
    2,225
    Further to this - how to I do a mouseover on an image control taking the dimensions of the image control into account??

Page 1 of 2 12 LastLast

Similar Threads

  1. Skinning tutorial?
    By erazor in forum FrodoPlayer
    Replies: 26
    Last Post: 11-06-2004, 08:36 AM
  2. Skinning Questions with VB6
    By (6) in forum Software & Software Development
    Replies: 13
    Last Post: 10-19-2004, 03:05 PM
  3. Is skinning FP as easy as Winamp ??
    By Don 944 LA in forum FrodoPlayer
    Replies: 3
    Last Post: 09-27-2004, 10:52 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •