VBA

Moderators: PavlinII
Number of threads: 1673
Number of posts: 3078

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Array of pictures Posted by leekeng81 on 9 Nov 2004 at 8:12 AM
I have 9 pictures.. and how can I make the array of pictures? can someone help? Thanks!!!
Report
Re: Array of pictures Posted by PavlinII on 1 Dec 2004 at 1:02 PM
: I have 9 pictures.. and how can I make the array of pictures? can someone help? Thanks!!!
:
Hi, here is part of simple program. It has 1 picture box and 9 pictures on drive C called pic1.jpg, pic2.jpg... pic8.jpg..

Private picArr(0 To 8) As IPictureDisp

Private Sub Form_Load()
    Dim i As Integer
    For i = 0 To 8
        Set picArr(i) = LoadPicture("C:\pic" & i & ".jpg")
    Next i
End Sub

Private Sub Picture1_Click()
Static LastIndex As Integer
    LastIndex = (LastIndex + 1) Mod 9
    Picture1.Picture = picArr(LastIndex)
End Sub

On Form_Load is the field of pictures filled and when you click the picture box, the next image i shown..
It's not very nice way how to work with pictures but for illustration (It's quite slow and memory wasting)



Pavlin II[/size]

Don't take life too seriously anyway you won't escape alive from it!





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.