473,326 Members | 2,090 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,326 software developers and data experts.

c++ creating animation help gdi and repaint window win32

14
ok im trying to create a animation of circle i have a while loop that loops and set var value the varable will be used to set the circle x value
here is the loop
Expand|Select|Wrap|Line Numbers
  1. while(sd==1)
  2.         {
  3.             sf++;//globe var, sf equals 1
  4.             onPaint(hdc);//paint the circle
  5.             InvalidateRect (hWnd, NULL, TRUE);//it should repaint the window but it doesn't
  6.             UpdateWindow(hWnd);
  7.         }
  8.  
well i can sucessfully draw the cirlce but not repaint it what happens is this it creates a circle with x value 1 than it creates another circle with value 3 it shouldn't it should delete the circle with value 2 than create new one with value 3
here is the draw circle code
Expand|Select|Wrap|Line Numbers
  1. VOID onPaint(HDC hdc)
  2. {
  3.    Graphics graphics(hdc);
  4.    Pen      pen(Color(255, 0, 0, 255));
  5.    graphics.DrawEllipse(&pen, sf , 0, 10, 10);
  6. }
  7.  
i posted this question in 2 different place still no answer would help me. i would really appreciation your help
Aug 10 '10 #1
3 3326
newb16
687 512MB
You are right when you say "it should delete the circle with value 2". 'it' - is your program, the code of onPaint function. It should take care of erasing whatever garbage in the drawing context before it is called and draw what you need. It should not expect blank canvas.
Aug 10 '10 #2
ramilol
14
how am i suppose to do that?
Aug 10 '10 #3
newb16
687 512MB
I'd search for gdi function that contains 'fill' in its name.
Aug 10 '10 #4

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

Similar topics

2
by: SROSeaner | last post by:
I am seeking to create a new internet explorer window with certain dimensions and a position on screen. Also, I have a couple of arrays containing data I want to send to that new window. I have...
2
by: dfreas | last post by:
I'm using Bloodshed Dev-C++ to write a program used to calculate orders for my business. Until recently a command line program has been sufficient but it is beginning to become cumbersome so I've...
1
by: R A | last post by:
Hi How do I create Event handle same as using the win32 CreateEvent? I need the ..net app (c#) to wait for event (such as win 32 waitforsingleobject api). Thanks, Ron
1
by: John | last post by:
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.
8
by: David W. Simmonds | last post by:
Is there an easy way to create a new browser window from C# and ASP.NET? I would just like to have a popup window without any menus or toolbars that would contain a high-res image. The low-res...
0
by: Erin | last post by:
hi all, i am contemplating the best way to create a lookup window in asp.net, and need some input from some more seasoned developers. i have a page that displays data where the user is able to...
1
by: vvenk | last post by:
Hello: I would like to create a modal window in an ASP.Nt application, similar to how windows Update works. Also, I would like this window to appear without any tool bars (just a title,...
5
by: 044879 | last post by:
Hello. What I am trying to do is simple. I don't want to create a window inside a form, but a window that acts independently outside the form. so for example, let's say I am doing a program that...
11
by: melon | last post by:
Let's say, I have a form class... public class MainForm : Form { private CustomClass cc; public MainForm() { DoSomething() InitializeComponent(); } /// Do something more
2
by: pvenkatesh2k4 | last post by:
hi, i need to popup message while some condition satisfies in Windows Application .How to do that? is there any component to pop up the message in C# windows application. Thanks in Advance.
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.