See Related Forum Messages: Follow the Links Below to View Complete Thread
Moving An Image To Move Another Image
Im creating my first small program for my assignment and ive done the design and code, just havign trouble with another part if anyone could help me please.
Here is my whole code first off.
Code:
Option Explicit
Private Sub cmdBat_Click()
While imgBall.Left < imgBatter.Left
'Moves the ball away from the bowler
imgBall.Left = imgBall.Left + 1
'Comment
DoEvents
Wend
'Comment
While imgBall.Left < imgBatter.Left
'Comment
imgBall.Top = imgBall.Top - 1
'Comment
imgBall.Left = imgBall.Left
' Allows the user to respond to another button
DoEvents
Wend
End Sub
Private Sub cmdBowl_Click()
While imgBall.Left < imgBowler.Left
' Moves the ball towards the batter
imgBall.Left = imgBall.Left - 1
' Allows the user to respond to another button
DoEvents
Wend
'Comment
While imgBall.Left < imgBowler.Left
'Comment
imgBall.Top = imgBall.Top + 1
'Comment
imgBall.Left = imgBall.Left
'Comment
DoEvents
Wend
End Sub
Private Sub cmdExit_Click()
End
End Sub
Private Sub cmdStart_Click()
imgBowler.Left = 8400
imgBowler.Top = 960
imgBatter.Left = 840
imgBatter.Top = 960
imgBall.Left = 7920
imgBall.Top = 2520
End Sub
What i need to do, as the ball gets to the bat for the bat to hit the ball and move it back where it came from. Ive done so far that the ball goes past the batter and when the bat button is pressed the ball comes back to the bat and goes back again.
I cant work out how to move the ball back when the ball is moving and the button is pressed. Im not advanced in programing either, ive been doing it for about a year
Here is an EXE of the program so far to demonstate
<link removed>
MOVE Image, Please Help!
Heloo everybody, can you explain me please how to move picture up, if
I press up arrow?
Thanks!
Move An Image.
Hey guys I was just wondering how would I move an image6 to the top.
I understand the very top of the form is 0. and the code would be image6.move, but how do I tell it to move to the top (0)?
Thanks!
Move An Image
if i had just a form and an image on that form, could anybody tell me how to move that image about by keeping the left mouse button down anywhere on the image and be able to move it around until i let the mouse button back up.
thanks.
Vb.net Image Move?
hi i would like a image in my vb.net programe to move on thescreen when a user clicks a button, how would i do this?
Regards
Homer
Move Image
i have got a picture box with an images within it.
i would like to be able to move each image in a drag drop style.
they need to be idependant.
any help would be great
thankyou in advance
Move Image Without Flickering
I've been trying to make a simple interactive game for a school project. I'm done a few of these, but I'm getting tired of the images flickering when I use the .move function. Is there any way to get these images to transition and move without flicking? Thanks for your help!
Move Image Left
I have an image in a picturebox and I want to move it right or left.
I'm currently thinking at 2 methods:
1) redraw the image again at the new coordinates
2) save in an array somewhere a number of pixels and append them to the end of the picturebox and then move all the bits left with that number of pixels.
Is there any known algorithm for doing this or should I implement one of my own?
Move Image From One Picturebox To The Next
I am creating a simple board game in Visual Basic that requires the gamepieces (PNG images) to advance the right number of spaces, which are actually pictureboxes. The image has to leave one picturebox and appear in the next. The number of spaces (pictureboxes) to advance to are located in a textbox.
I would prefer a response by April 19 or 20, as I need to finish the game by then.
Image Doesn't Move...
I am making this program, where on one form you use the arrow keys to move an image around the form. The problem is it doesn't seem to work.
Code:
Private Sub Form1_KeyDown(KeyCode As Integer, Shift as Integer)
Select Case KeyCode
Case vbKeyUp
'action - Moves image
Case vbKeyRight
'action - Moves image
Case vbKeyLeft
'action - Moves image
Case vbKeyDown
'action - Moves image
End Select
End Sub
What is the problem here? I have tried everything to fix it. I even changed all that Select Case to If-Then but still nothing. I changed to image to a label, command button, shape and a checkbox, but nothing still. I have tried putting breakpoints and this is how they came out...
Code:
Private Sub Form1_KeyDown(KeyCode As Integer, Shift as Integer)
Select Case KeyCode
Case vbKeyUp 'Oddly this breaks on any keypress that is NOT that arrow, hmm.
'This line does not break on any keypress
Case vbKeyRight
'This line does not break on any keypress
Case vbKeyLeft
'This line does not break on any keypress
Case vbKeyDown
'This line does not break on any keypress
End Select
End Sub
I am sooooo confused , I thought it might be a setting with the form or something, because nothing works..
Anyone know what is wrong here??
Cheers,
Tim
I Want An Image To Move With The Mouse
I have an image,
I want it to move where i move the mouse to
if I move the mouse right, then the image will move right,
if I move the mouse to the left then the image will move to the left...
please help me...
Image Move Loop
I'm creating a pong program for my VB class. I have everything down...I just want to change the paddle movements.
I wanted to make it so when you hold down the up or down arrow key it moves the paddle 50 twips or so while holding it down.
Similar to when you hold down a key on the keyboard and it starts repeating itself. At that speed, without the delay.
I hope I made myself clear.
Thanks,
~Nate
- Move An Image Using Timer
Dear Experts,
Can somebody please guide me how to move an image in a form using timer control.
Many Thanks
Eshu
Image Move Problem
Hi all,
i'm need to move a picture in the screen, but the image move resolution is bad, like as slow motion.
Please, how to improve a fast picture move?
How Would I Make This Image Move
Iam creating an adventure game and I have a screen where once the player enters I want an image to move from the far left of the screen and stop in the middle of the screen can you please give me all the steps I need to know to do this please?
Image Move Speed
I have an application to move an image with a mouse click. I use the mouse over with mouse click to enagle image move. this is a custom slider. I find that when mouse is moved fast the image does not keep up and I love the mouse over envent. I dont have any other code running and no timers enabled. Can I speed up image move or can anyone see an error in my code that would case this ? Note ther are 3 images images(0), images(1), images(2)
Code:
Private Sub Image1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, x1 As Single, y1 As Single)
If moveimage(Index) = True Then
Select Case Index
Case 0
If x1 > 0 Or x1 < 600 Then
movebar = True
Else
movebar = False
End If
Case 1
If x1 > 0 Or x1 < 600 Then
movebar = True
Else
movebar = False
End If
Case 2
If x1 > 0 Or x1 < 600 Then
movebar = True
Else
movebar = False
End If
End Select
If movebar = True Then
intpos(Index) = y1 - (Image1(Index).Height / 2) + MoveY(Index)
If (intpos(Index) < 1540) And (intpos(Index) + 10 > 0) Then
ScrollValue(Index) = 255 - (intpos(Index) / 6)
Image1(Index).Top = intpos(Index)
MoveY(Index) = intpos(Index)
Select Case Index
Case 0
intFixtureR(intButtonSelect) = ScrollValue(0)
Case 1
intFixtureG(intButtonSelect) = ScrollValue(1)
Case 2
intFixtureB(intButtonSelect) = ScrollValue(2)
End Select
endif
End If
End If
End Sub
Private Sub Image1_MouseUp(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
moveimage(Index) = False
End Sub
Private Sub Image1_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
moveimage(Index) = True
End Sub
VB.6 User, Since 2002
Next Generation Lighting Controls
www.jmelectronics-online.com
Image Move - Not Working(help Me Fast)
Hi,
I need help asap!
I am moving an image from one position to other continuously.
I am doing this by incrementing the x and y positions.
The code is something like this
do while(1)
x=x+1
y=y+1
shape1.left=x
shape1.top=y
loop
This program works fine in VB6 but for some reason it doesnt work in Embedded VB.
Any reason why?
Make Image Move Across Form
I have a program I am writing that counts down the days til the Daytona 500. I have an image of a racecar that I want to move from the right to the left and when it reaches the far left play a mp3 / wav file and have the picture move again. Does anyone know how to do this? I guess a loop would be the way to do it, but i'm not sure how to do it. I'm working with a regular picture box. Please let me know.
Make Image Move Across Form
unfortuanetly for me neither the code oon pic moving with the 2 picture boxes nor the image1.left= image1.left +1 work. can someone help me with the code or suggest another code.
i copyed the code and followed all the guidelines: 2 pic boxes one named picture1 the other picimage. but i may be confused about which one goes where(which pic goes inside the other one).
Thanks.
Mouse Move With Image Control
Does anyone know how to change the scalemode of the image control to pixels?.....it appears to be defaulting to twips despite the fact that the form is set to pixels.
Making A Image Move Automatically
Iam creating a computer game I have screen where once the player gets there I want the picture that is located on the far left of the screen to come in the middle but on dont want the player to have to click anything on the screen for that to happen would I need a timer to do this and what code should I use to do this?
Move An Image In A Certain Range With A Timer
I have a program that has an image control which I would like to move with a timer. I want the image to move up and down. So far my code looks like this in the TIMER's code:
imgImage.Top = imgImage.Top - 40
ok, i guess i know how to move the image and all... but the real problem is how do i make it move in a certain range? i want the image to keep going up and down between the TOP values of 1560 and 2880. How can i do this? When the image reaches the top value of 1560, i want the image to automatically start going down to the value of 2880. And when it reaches the value of 2880, I want it to start going back up to the value of 1560, and keep doing this.
Will I need a For Next... Loop? If so, i've never used a for next loop to move something with the timer. Can someone provide the code? Please help me!!!! I need helpp!! Thanks.
Move An Image/Picture Box To A Different Position.
Hi, I have a picturebox on a form, when i click a button, i want the box to move to a different position on the page. I have read you can do this with "Move" but i cannot get it to work.
Can any one help.
Thanks
Chris Davis
Arrow Keys To Move A Simple Image
Im just trying to pick up the basics here, how would i go about moving an image around using the arrow keys, or any keys for that matter.
And on a seperate question, how do you make a background image scroll horizantally or across the X-axis?
How Should I MOVE THE IMAGE BOXES IN A VERY SMOOTH MANNER?
i have figured out hwo to move the images with easy and normal vbkeycodes...BUT CAN NEONE TELL ME HOW SHOULD I MOVE IT SMOOTHER!! coz u know to move i i always have to press the ke again n again!!....I WOULD RATHER REFER JUS PRESSING ONCE AND HOLDING ON TO THT...Rather than pressing the arrow keys again n again!!
it looks somewha like this
if keycode = vbKeyup then
img1.top = img1.top + 32
and u know so on?!?!??!
Using Keypress Event To Move An Image Around The Form
Code:
Private Sub Form_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Then
Image1.Top = Image1.Top + 50
End If
End Sub
I used this code to make the image move down 50 each time I push the enter key (13) but I only used code 13 because its the only one I know... is there a code table or something so I can use other keys?
Zoom & Move Image Inside Picturebox
I have a database of hi-res images (Antiques) of different sizes. Currently on the form I have various textboxes and a small imagebox displaying the image.
I would like to have a 2nd larger box of a set dimension (600x600) to put the image in and be able to zoom in and center any part, kinda like mapquest, or move the image within the frame, maybe by clicking or dragging on the image itself.
Move Image Box Depending Upon The Up, Down, Left, Right Keys
I have an image box in the form and i want to be able to move it up and down using the up, down, left, and right keys on my keyboard. How exactly would i do that?
I don't want to have to click a key everytime to do this, i was thinking of putting it in a timer so it can detect which keys are pressed.
.:: Solved ::. Move Window Buy Holding Down On Image
hi,
can anyone tell me how to move the window by holding down on an image.
the reason i want to do this is because i;m using a image inplace of a titlebar.
cheers,
Phil
Edited by - Magical Philly on 11/30/2006 1:17:11 PM
Coordinate Systems To Move Image Control
hello,
can anyone show me the way how to move image control by using coordinate system. For example we use OffsetX, OffsetY, PixelX, PixelY, so by using these coordinates so that the image control can move by referring the coordinate movement not by usual kind of method like Image1.Left = Image1.Left + 480.
Thank you
Custom Slider Problems [ Image Move Problem ]
I have attached the projects of the slider controls. Can anyone tell me why I cant get the high and low ends of the sliders to read 0 and 255. Sometimes it works if I move the slider slow.
VB.6 User, Since 2002
Next Generation Lighting Controls
www.jmelectronics-online.com
Edited by - Jremote on 3/6/2005 6:57:30 PM
How Do I Make An Image Move According To The User Arrow Keys On A Keyboard?
I'm desperatly trying to make a game in Visual Basic but have hit a problem. I have an image, an army tank. I want the tank to move when the user presses his/her left/right/up/down buttons on their keyboard adn the image moves according to the keyboard direction. HOw would I do this in vb 6?
need an urgent reply!!!!
Move An Image From Mouse Events (was: "draggin")
Is it possible to make an image thats draggable. What I mean is that I already have an image on my form and I would like it so that they could drag this image around the screen by holding the mouse down on the image to move and releasing the mouse to put it down.
the images name is Image1, the forms name is form1 and I am using VB 6.0.
PLEASE HELP
(I have been working on trying to get drag'n'drop working for months )
- How To Draw Image On Mouse Down / Mouse Move
hi friends,
i hv two picture boxes. pic1 contains a image (16 * 16 pixel). on mouse down of pic2 i need to draw the pic1 image on pic2, a perfect square
how do i do that
plz help.
thanx in advance
harry
regards
harry
Form Caption Title Move & Move??
does everybody who can provide source code let me know how to make form caption title move & move??
add a timer control to count it moving.
caption title from left side move to right side, then form right side move to left side. repeat and repeat.
thanks!
here is small example which is title run & run, but I need it move & move.:
Code:
Public tit1 As String
Private Sub Form_Load()
tit1 = "This title can run and run!.......... "
Form1.Caption = title1
Timer1.Interval = 200
End Sub
Private Sub Timer1_Timer()
L = Len(tit1)
tit1 = Mid(tit1, 2, L - 1) + Left(tit1, 1)
Form1.Caption = tit1
End Sub
Move A Control In Run Time With MOUSE MOVE
I build with the MOUSE MOVE event a posibility to move a control in RUN TIME
But the move is not so good
Someone have a idea about a improve way to do this task
Thanks
Move 2 Or Move Listitems With Drag Drop
Hi vb-forum:
I need to move among items into a list viewwith drag drop function, how can i move it? in this moment I can move just one but i need to move 2 or more in a group. I hope you can give me a tip.
Thanks in advance and regards.
|