Results 1 to 4 of 4

Thread: Custom Images

  1. #1

    Thread Starter
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496

    Cool

    If i want to create my own custom button via image box, say I use the Delete.bmp file from visual studio, the only one it provides is the bitmap where the delete button is not pressed. How do i get the image when it is pressed down?? Can i modify it in some other image program?? thanks

    [Edited by Lethal on 11-02-2000 at 09:07 AM]

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    I don't understand the question. If you have a bmp you can do what you want to it in any reliable paint program like MS Paint, PSP, Adobe, et.

    If you're question is can it be done the answer is yes. Just make sure you save a copy of it and work on the copy, not the original.


    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3

    Thread Starter
    PowerPoster Lethal's Avatar
    Join Date
    Oct 2000
    Location
    Ohio
    Posts
    2,496
    Sorry if i didn't make myself clear, I was trying to say that I want two images of the delete bmp:

    Image1: Delete button Not Pushed in (Just regular)
    Image2: Delete button Pushed in

    ***So when a user clicks the image, you can actually physically see the image being clicked.

    thanks

  4. #4
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    Code:
    'this will give you the press/unpress look on a button
    'you could change the image as well but I don't think
    'it would be necessary as the button sinks and raises
    'in much the same manner as a javascript rollover
    
    'can't get it to work with the normal button look but
    'if I use the sunken 3d effect
    'looks really really good
    'to view it copy and paste this code.
    'Form1  Command1
    
    Option Explicit
    
    Public PixX, PixY, CTop, Clft, CRgt, CBtm, i, AddX, AddY
    Public nowDown As Boolean
    
    Public Sub ThreeDControl(Ctrl As _
    Control, nBevel, nSpace, bInset)
    
    PixX = Screen.TwipsPerPixelX
    PixY = Screen.TwipsPerPixelY
    
    CTop = Ctrl.Top - PixX
    Clft = Ctrl.Left - PixY
    CRgt = Ctrl.Left + Ctrl.Width
    CBtm = Ctrl.Top + Ctrl.Height
    
    ' Color used below:
    ' dark gray = &H808080
    ' white = &HFFFFFF
    
    If bInset Then         'inset border
      For i = nSpace To (nBevel + nSpace - 1)
       AddX = i * PixX
       AddY = i * PixY
       Ctrl.Parent.Line (Clft - AddX, CTop - _
       AddY)-(CRgt + AddX, CTop - AddY), &H808080
       Ctrl.Parent.Line (Clft - AddX, CTop - _
       AddY)-(Clft - AddX, CBtm + AddY), &H808080
       Ctrl.Parent.Line (Clft - AddX, CBtm + _
       AddY)-(CRgt + AddX + PixX, CBtm + AddY), &HFFFFFF
       Ctrl.Parent.Line (CRgt + AddX, CTop - _
       AddY)-(CRgt + AddX, CBtm + AddY), &HFFFFFF
      
        Next
            Else                      'outset border
      For i = nSpace To (nBevel + nSpace - 1)
       AddX = i * PixX
       AddY = i * PixY
       Ctrl.Parent.Line (CRgt + AddX, CBtm + _
        AddY)-(CRgt + AddX, CTop - AddY), &H808080
       Ctrl.Parent.Line (CRgt + AddX, CBtm + _
        AddY)-(Clft - AddX, CBtm + AddY), &H808080
       Ctrl.Parent.Line (CRgt + AddX, CTop - _
        AddY)-(Clft - AddX - PixX, CTop - AddY), &HFFFFFF
       Ctrl.Parent.Line (Clft - AddX, CBtm + _
        AddY)-(Clft - AddX, CTop - AddY), &HFFFFFF
      Next
    End If
    
    End Sub
    
    
    Private Sub Command1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
     Call ThreeDControl(Command1, 1, 0, True)
     Command1.Width = 1215
     Command1.Height = 495
    End Sub
    
    Private Sub Command1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
      Command1.Width = 1250
      Command1.Height = 525
      Command1.Refresh
    End Sub
    
    Private Sub Form_Activate()
      Call ThreeDControl(Command1, 1, 0, True)
      Command1.Width = 1200
      Command1.Height = 480
    End Sub
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

Posting Permissions

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



Click Here to Expand Forum to Full Width