473,397 Members | 1,972 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

How To Rotate Thru a set of Pic's

Hello

I have On a form an Unbound Picture (BMP) that I would like to be able
to change by clicking on it and having it got display the next Pic in the List.

Like This:

I Open The Form (Normally) and when I click on the Pic, it will rotate to the
Next Pic in the list (About 16 In Total), After the last one it goes back to the
first pic again.

Is this possible in Access, How much coding is involved?

Thanks

Keith
Nov 13 '05 #1
1 1695
1. Create an image control, with "(none)" as the Picture property, and
Picture Type property "Linked"
2. Create a button, and place it completely over the image control. Set
it's Transparent property to "Yes"
3. Create a table with the full path of each photo:
photo_id photo_path
1 "C:\images\image1.bmp"
2 "C:\images\image12.bmp"
4. Declare form level variables:
Private photoID as Long
Private imageCount as Integer
5. In your form's Load event, load your first image from your table & store
the photo_id:
[Open recordset rs]
photoID = rs.Fields(0)
Me.imgPhoto.Picture = rs.Fields(1)
[Close recordset]
[Count records in recordset and store in imageCount] (you can use
DCount)
6. In your buttons OnClick event:
Dim cnt As Integer
[Open recordset rs]
[rs.MoveNext until rs.Fields(0) = PhotoID, incrementing cnt as you go]
If cnt = imageCount
rs.MoveFirst
Endif
photoID = rs.Fields(0)
Me.imgPhoto.Picture = rs.Fields(1)

It could be made much simpler if you name the images 1.bmp, 2.bmp, etc and
used a hardcoded path, but this allows you to have file names that are not
important to the code, a variable number of images, and variable file
locations.

Darryl Kerkeslager
<ca*****@hotmail.com> wrote:
I have On a form an Unbound Picture (BMP) that I would like to be able
to change by clicking on it and having it got display the next Pic in the List.
Like This:

I Open The Form (Normally) and when I click on the Pic, it will rotate to the Next Pic in the list (About 16 In Total), After the last one it goes back to the first pic again.

Is this possible in Access, How much coding is involved?

Nov 13 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Showjumper | last post by:
Hi, I have developed an upload server controls to be reused over a number of projects. One of the tasks it needs to handle is to rotate an image. I want to accoplish this by checking the checkbox...
3
by: byrd48 | last post by:
Hi, I am developing a web site which allows users to upload and share photos. I have a datalist which lists the photos and has the usual edit, update commands. Within the edititemtemplate, I...
2
by: Peter Proost | last post by:
Hi group, I got the following piece of code which draws a square with stars round it, now I want the stars to rotate round the square, I can do this with the mx.rotate and a timer and an...
17
by: santel_helvis | last post by:
Hi All, Could anyone tell me how to rotate the image in javascript. Which concepts I should concentrate to rotate the image
8
by: Const | last post by:
Hi! I wonder how to rotate a pictureBox, welle, the image in the pictureBox ! I watched old post form here, but i can't find any answer for this. I would like to rotate my pic like a sprite,...
8
by: lovecreatesbeauty | last post by:
I write a function to rotate a matrix by 90 degrees clockwise, this function works on a matrix of specific size, for example, it rotates a 4*4 matrix of integers in the following code. The function...
8
by: Samuel Shulman | last post by:
Is it possible and how to rotate pictures in HTML document Thank you, Samuel
10
by: Joey_Stacks | last post by:
Does anyone know of a scipt that will rotate random div layers on page refresh? I have a primary content area front and center on my site homepage, and I'd like to rotate various chunks of html...
8
by: Syoam4ka | last post by:
Hi, I have a WinApp in which I have a pictureBox. I can draw in it like in the paint of windows - I accomplish that with an arrayList of Points and DrawLines method of the Graphics. So it...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.