473,610 Members | 2,006 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Rotating Buttons

Ali Rizwan
925 Contributor
Can some tell me how can i make rotatry motion to control.
Thanx
Aug 30 '07 #1
9 3030
VBPhilly
95 New Member
Can some tell me how can i make rotatry motion to control.
Thanx
Do you have an example (say, a web page)? I'm not sure what is meant by rotary buttons.
Aug 30 '07 #2
Killer42
8,435 Recognized Expert Expert
Can some tell me how can i make rotatry motion to control.
Yes, I think we need more detail about what you mean. For instance, the first few questions that come to mind are...
  • What version of VB?
  • Do you mean that you just want to put a button on a form rotated to a different orientation to normal, or do you want something to be animated at runtime, or what?
  • Web page or Windows form?
Aug 31 '07 #3
Ali Rizwan
925 Contributor
Yes, I think we need more detail about what you mean. For instance, the first few questions that come to mind are...
  • What version of VB?
  • Do you mean that you just want to put a button on a form rotated to a different orientation to normal, or do you want something to be animated at runtime, or what?
  • Web page or Windows form?
Hi
I m using Vb6
And want to make button rotating animation at runtime and its for windows form.
i try to use sin cos etc but i cant i have never use them before so plz help me.
Aug 31 '07 #4
Killer42
8,435 Recognized Expert Expert
Hi
I m using Vb6
And want to make button rotating animation at runtime and its for windows form.
i try to use sin cos etc but i cant i have never use them before so plz help me.
Using Sin() and Cos() functions to generate coordinates for a circle is fairly simple. But I don't see how you can rotate a button. Perhaps you could create a little video/animation of a rotating button, and play it in an animation control.

I'll attach a sample program I've just created, which demonstrates drawing a circle on the form using Sin and Cos. To use the sample, just run it and click in two different places on the form. It will draw a blue cross at the first place, then draw a circle around it, reaching to where you click the second time.
Attached Files
File Type: zip Circle-drawing with Sin&Cos.zip (4.2 KB, 258 views)
Aug 31 '07 #5
Ali Rizwan
925 Contributor
Using Sin() and Cos() functions to generate coordinates for a circle is fairly simple. But I don't see how you can rotate a button. Perhaps you could create a little video/animation of a rotating button, and play it in an animation control.

I'll attach a sample program I've just created, which demonstrates drawing a circle on the form using Sin and Cos. To use the sample, just run it and click in two different places on the form. It will draw a blue cross at the first place, then draw a circle around it, reaching to where you click the second time.
Thanx a lot for this
If i succeed to rotate a button then i will tell you and one thing more
i want to know about animation control i know this but dont know how to use it
Can you tell me
Aug 31 '07 #6
Killer42
8,435 Recognized Expert Expert
Thanx a lot for this
If i succeed to rotate a button then i will tell you and one thing more
i want to know about animation control i know this but dont know how to use it
Can you tell me
You'd have to find a video or create it using appropriate software. The animation control just lets you play a little AVI files. It's often used to do things like the "flying files" animation when copying files, the moving magnifying glass while searching, and so on.

I don't remember how to use it, but I think it's pretty simple. You just give it the name of the AVI file to play.
Aug 31 '07 #7
Ali Rizwan
925 Contributor
You'd have to find a video or create it using appropriate software. The animation control just lets you play a little AVI files. It's often used to do things like the "flying files" animation when copying files, the moving magnifying glass while searching, and so on.

I don't remember how to use it, but I think it's pretty simple. You just give it the name of the AVI file to play.
Thanx for the reply
I ll try
Aug 31 '07 #8
Robbie
180 New Member
I'll attach a sample program I've just created, which demonstrates drawing a circle on the form using Sin and Cos. To use the sample, just run it and click in two different places on the form. It will draw a blue cross at the first place, then draw a circle around it, reaching to where you click the second time.
I know from programming in another language that you can draw 2 pictures - one of a button as it would normally be, and one of it when it is pressed down - then change the Picture of the PictureBox between them as the mouse is pressed and released, using those events and LoadPicture().

Your Sin/Cos can be adapted to get the colour of a pixel at one point and rotate it around by a certain number of degrees, then draw it again. This would be a very long-winded way, and probably introduce quite a lot of lag every time the picture is changed (because it would need to be rotated every time it's changed). It would also involve using a method similar to double-buffering, whereby you have 2 PictureBoxes but only 1 is visible; the first one would contain the original image which is having the colours of its pixels loooked at, and the second one (visible) is what the rotated pixels will be drawn onto.

I can't help with the sin/cos part, but I can help with getting the colour of a pixel, drawing a pixel, loading a new image file as the Picture for a PictureBox, and the double-buffering concept.

Now I'm not responsible if that all made no sense or typed weird typos, because it's 5:45 AM and I haven't been to sleep yet. ~_~"
Hopefully something useful can be made out of it ><
Sep 1 '07 #9
Killer42
8,435 Recognized Expert Expert
Another thing to keep in mind. If your program has to generate the rotated images, you could do it once at startup and stash them in a bunch of picturebox controls or something. Then you won't have to worry about lag when displaying them.
Sep 2 '07 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

4
2398
by: Ian Hubling | last post by:
I'm trying to complete a rotating banner ad within a page I have. The rotating add has four images that rotate in three-second increments. I've got the images to rotate ok - but now I want to go one step further and can't figure out how to do it... I want to have it so that when the person clicks on the specific ad, they are taken to a URL that is unique to each ad. I presume I would have to surround the img tag with an href tag, but...
1
3211
by: Sandy Bremmer | last post by:
I have seen many Javascripts that rotate images with each load or refresh of the page but so far all I've found require hard coding the image filename into the script. Does anyone know of a script that pulls images randomly from a directory? Thus I would need only add (or delete) images from that directory and they would display on the web page respectively. All the images are the same size (90x90) but there are hundreds so hard coding...
1
2100
by: Grunt | last post by:
Hi, I have been trying to put together a rotating banner. the code works but I am having a problem with the caching of the banner images. no matter what I try the page is constantly reloading the images, even worse they are not loading completely. This version includes a (vain) attempt at forcing the banner images to cache. Apart form the caching problem the scripting seems to work Any help welcomed:
4
5452
by: Roozbeh GHolizadeh | last post by:
Hi there... i think it is a very common problem but i dont know why i didnt find anything good for me on internet... i want to simply rotate an array with 90,180,270 degrees.... here is how i allocated this.... srcimage = (LPBYTE)LocalAlloc(LMEM_FIXED, 320 * 200);
2
6535
by: mistral | last post by:
I want place custom text rotating around analogue clock. Here is javascript that is clise to my task: http://javascript.internet.com/time-date/mousetrailclock.html But it have a few unnecessary features which is difficult to alter. i want: 1. replace week/year/days in external circle with my custom text: 'My custom text'
4
23642
by: Chris Shenton | last post by:
I set this up 3 days ago and have not seen any of the logs I've created this way being rotated. I expected them to rotate every midnight. I'm calling the code that uses this logger many times, each a separate run, if that matters. Am I doing something stupid? I can't find anything on google and don't see anything in the code that would prevent rotating. Thanks.
3
5244
by: Beamer | last post by:
Hi I am trying to build a roating slide effect in javascript. Basically, I have a list like below <ul id="slideShowCnt"> <li id="slide0"><img .../></li> <li id="slide0"><img .../></li> <li id="slide0"><img .../></li> <li id="slide0"><img .../></li> <li id="slide0"><img .../></li> <li id="slide0"><img .../></li>
9
6822
by: Kraken | last post by:
Hi, i have an assignment to open PPM images and prompt the user for either brightening, flipping or rotating the image. Ive done the brightening and flipping, but i cant get the rotating to work. When i try to rotate i get an error, although i think the concept is right. With some testing i figured out thet I get the error when x = 4 and y = 1 i think. Memory read access violation or something. Im using Visual C++ 2005 express edition and...
3
5948
by: avalence | last post by:
Hello, I am trying to create a nice rotating earth globe (on mouse) on my web site, in order to display my professional relationships all over the world. The best way seems to be a javascript. In fact I still hesitate between java and javascript. My question is how can I create a interacting globe using a satellite photo. This is a very usefull applet for everybody. All suggestion welcome! Thanks Arnaud
1
2560
by: AR123 | last post by:
Hi I want to set up a rotating banner. Not sure how to incorporate my rotating banner code into the code below. I want the rotating banner to be the main feature image? This is set up in mediasurface My code is: <!-- start page container --> <div id="pageContainer"> <!-- start middle content area --> <div id="genericMiddle">
0
8146
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8591
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8558
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8237
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8411
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6069
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4104
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1691
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1407
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.