473,387 Members | 1,611 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,387 software developers and data experts.

drawing a moveable line in MFC

Hello,

In an MFC application I want to draw a line which should move around after the drawing what can I do?

Thanks,
john
Jan 15 '09 #1
3 4140
lini
12
Hi,
Very wild guess is you keep invalidating the area where the line is and inside your WM_PAINT handler draw it again at another position. Alternatively you may switch your draw mode, so that when you draw the same line, it is actually erased, and then switch back to normal mode and draw it again at another position.

Once again, just a guess, correct me if I am wrong!
Cheers,
Lini
Jan 15 '09 #2
Studlyami
464 Expert 256MB
What do you want the line to do? What is the purpose of the line? You could manually redraw the line at a different location in the OnPaint function. You could also create a new window without a border and form it to the size of the line you want. This would allow you to move the "line" as you would a window. This would also give you the option to allow the user to move around the line.
Jan 16 '09 #3
You can see professional win32 ng (news://comp.os.ms-windows.programmer.win32)
for a sample code doing _exactly_ that (MS)
(and more, as it's a drawing program to draw any shapes...)
Jan 16 '09 #4

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

Similar topics

15
by: Remon Huijts | last post by:
Hi there, For a very specific service, I have created a PHP script that uses the GD library functions to create a PNG image from a few lines of XML data describing a simple diagram/drawing. It's...
9
by: Steve Long | last post by:
Hello, (total GDI newbie) I'm having trouble drawing just a simple line to display in a picturebox. I just want a straight, dotdash line. I have two methods, one works and one doesn't (it cause...
6
by: Rene | last post by:
I tried searching the newsgroups to see how do you draw a dotted line but I was unable to find an answer, drawing a straight line is very easy but not a dotted one. So the question is, how do I...
2
by: Champika Nirosh | last post by:
Hi, I want to create drawing board application that can draw Line, rectagle, circle and free hand drawing. Each drawing need to be transparent, moveable (draggable), have bring to front and...
2
by: Galaxia | last post by:
Hi, I'm using C# in VS .Net 2003. How can I build movable toolbars as that in VS IDE, dragging and arranging them? More, how can the moveable toolbar be put into the same line of Menu, as that in...
9
by: davetelling | last post by:
I am not a programmer, I'm an engineer trying to make an interface to a product I'm designing. I have used C# to make a form that interrogates the unit via the serial port and receives the data. I...
6
by: ll | last post by:
Hi, I'm currently working with a 'classic ASP' intranet site which uses a SQL server and am looking for possible ways to market it as an application for certain medical fields. Where would be a...
4
by: olseni | last post by:
Hi, i am trying to make a report which consists of many subreports, and I need to make the subreports moveable and not show when the subreport has no data. I use an event procedure in the 'On no...
5
by: Macias | last post by:
Hi, Please help me, how I can make a line drawing on PictureBox similar to MS paint. I thinking about this: click and hold button, move mouse and relase button. I'm trying useing this...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...

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.