473,788 Members | 2,811 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to draw animation in window app?

How to draw anmation in window app? I mean... like how can
I draw a dot in window at a point then moves to another
point and we can see it moves. Please explain in detail.
Nov 15 '05 #1
1 2325
John,

In order to do this, you will have to override the OnPaint method of
your control/form. In your onpaint event, you will have to take the
coordinates of the point, and then draw it at those coordinates.

Now, the part that creates the animation is different. Basically, you
will have some sort of timer that will control your frame rate. Each tick
of the timer is where you set up the information (not do the drawing) that
the drawing routine needs to render that frame of the animation. After you
set up the information (in this case, the coordinates of the point), you
call Invalidate, which will force a repaint. The repaint will then render
the frame according to the information you have set up, creating an
animation.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"John" <an*******@disc ussions.microso ft.com> wrote in message
news:03******** *************** *****@phx.gbl.. .
How to draw anmation in window app? I mean... like how can
I draw a dot in window at a point then moves to another
point and we can see it moves. Please explain in detail.

Nov 15 '05 #2

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

Similar topics

1
6620
by: Brainless | last post by:
hi... I've recently created a dhtml thing on http://www.shapers.nl/ that animates a lot of images. The thing I want to solve is the lag that occurs when a new animation is initiated. To make it time-based I calculate the entire animation on beforehand and create numerous setTimeOuts in a repeat loop (it's the loop that creates the lag). Creating an animation like this has some more disadvantages:
2
2119
by: billrdio | last post by:
I am trying to make a JavaScript animation of real-time images - i.e. images that will periodically change on the server. The problem I am having is that the JavaScript animation I have created is always using the images from the cache, even though I have set the HTTP response header on the server (via .htaccess) so that the browser should validate the image in the cache against the image on the server for freshness. I have tested the...
3
3094
by: NL | last post by:
Hi, Does anybody know how to turn off the animation Windows does with a window as it's minimized/maximized to the taskbar? I have an app which, when minimized, syncs to any other open instances of the app and tells them to minimize. If I have more than a couple instances open, the user ends up waiting quite a while for all of windows to minimize, since each minimizing animation is done consecutively and not in parallel.
10
2303
by: Robert Skidmore | last post by:
Take a look at this new JS function I made. It is really simple but very powerful. You can animate any stylesheet numeric value (top left width height have been tested), and works for both % and px values. Works in both ie and firefox. Parameters styleType = top | left | width | height toNumber = the new value of the style then you pass in as many ids as you would like.
1
4350
by: zxo102 | last post by:
Hi everyone, I have tried two days to figure out how to draw the image in wx.BufferedDC on the page created by AddPage of wx.Notebook but still got no clue. The attached example works fine. If I click the menu "Draw" --"New Drawing". The image with wx.BufferedDC/wx.BufferedPaintDC can move around on the frame. But If I uncomment those three commented lines in "class TestFrame" to add a new page (from wx.Notebook) with a tag and modify...
0
951
by: 123shailesh | last post by:
I have a picturebox (imgViewer) which is displaying an image (a map). Now i want to display another image (a smaller one) on top of this image. But this smaller image is a GIF animation of a blinking siren. But when i paint it on the picturebox, the overlapping of the two images is being displayed properly, but it comes as a static image with only the first frame of the animation being shown. This is the code I am using: <code> private...
4
3668
by: =?Utf-8?B?dmluZWV0?= | last post by:
In WPF (even with considerable improvement in version 3.5), while running multiple animations in a single window, The performance of one animation suffers a lot. for example, i have two image transitions on two independent Canvases on a Grid. 1. is simple, slide transformation running, continously from left to right with multiple images. 2. 3D transitions over multiple images.
2
6835
by: moondaddy | last post by:
Below is some xaml that is a mockup of a control I'm building. It's a shape that will be used in a diagramming tool. The red, blue and green rectangles simulate connectors on the side of the shape and will have connection lines attached to them. These connectors will be dynamically added and removed at runtime, and at all times, the group of connectors need to be centered on that side. For example, the left side shows a group of 5...
8
5542
by: DelphiCoder | last post by:
As part of familiarizing myself with the Win32 API, I wrote a simple animation program in C. The program has a struct for each bitmap, holding information such as its location, visibility, mask (for transparency), etc. Then I have a separate thread running that has a WHILE loop that looks like this: WHILE (TRUE) { /* update all structs (bitmap locations, etc) */ SleepEx(iSpeed, FALSE); InvalidateRect(hwnd, lpRect, TRUE); }
0
9656
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
9498
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10364
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
10172
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
7517
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
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4069
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2894
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.