Results 1 to 7 of 7

Thread: LoadPicture Function

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Apr 2005
    Posts
    30

    LoadPicture Function

    Hi, I was wondering where I have to save my images in order to use the loadpicture function?

    I dont know what directory to save my images to for the application to source from.
    so far I have only come up with this pathetic little code...

    Private Sub Command2_Click()
    LoadPicture (belfast.jpg)
    End Sub

    Do i need to display the ".jpg" or how do I go about this?
    thanks andy

  2. #2

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Apr 2005
    Posts
    30

    Re: LoadPicture Function

    Sorry!!!
    can you help me with this please? I thought of maybe having a command buttone in the form which linked to the relevant image? do you know how i would go about this?
    andy

  4. #4

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Apr 2005
    Posts
    30

    Re: LoadPicture Function

    Sorry could you please explain what i need to do with this code a little more? I am finding it hard to understand VB!!
    thanks

    visual basic code:--------------------------------------------------------------------------------
    Option Explicit

    Private Type tHousing
    sName As String
    End Type
    Dim arHousing() As tHousing

    Private Sub Command1_Click()
    Static i%

    lblName.Caption = arHousing(i).sName
    Image1.Picture = LoadPicture(App.Path & "\" & arHousing(i).sName & ".bmp")
    i = i + 1
    If i > UBound(arHousing) Then i = 0

    End Sub

    Private Sub Form_Load()
    ReDim arHousing(2)
    arHousing(0).sName = "Mayflower"
    arHousing(1).sName = "Sunny Side"
    arHousing(2).sName = "Western"
    End Sub

  6. #6

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Apr 2005
    Posts
    30

    Re: LoadPicture Function

    Hi can someone tell me if this code looks ok, to create a graph from four text boxs in a form:
    Public Sub showgrf()
    Dim iCol, iRow, imax As Integer
    Dim X() As Variant

    imax = 1
    ReDim X(1 To 5, 1 To imax + 1)

    iRow = 1
    X(1, iRow) = "Period"
    X(2, iRow) = "1996 "
    X(3, iRow) = "1998 "
    X(4, iRow) = "2000 "
    X(5, iRow) = "2002 "

    iRow = 2
    X(1, iRow) = 0
    X(2, iRow) = myProperty(Val(txtSaveAs.Text)).p96
    X(3, iRow) = myProperty(Val(txtSaveAs.Text)).p98
    X(4, iRow) = myProperty(Val(txtSaveAs.Text)).p00
    X(5, iRow) = myProperty(Val(txtSaveAs.Text)).p02
    MSChart1.ChartData = X

    End Sub

    Thanks andy

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