Click here to Skip to main content
Click here to Skip to main content
Go to top

A Simple Vector Editor

, 5 Jun 2002
Rate this:
Please Sign up or sign in to vote.
A simeple editor to make my polygon class a bit more usable.
<!-- Download Links --> <!-- Add the rest of your HTML here -->

Introduction

This is a little toy project I did because we had an application that required a number of simple images described as vectors. This was the editor I created to allow me to create and modify these simple images. The output files can be included as resources and used by my Polygon Drawing Class. (Actually, the polygon class is not used in this application, because I created it before I created the polygon class).

I thought it would provide an interesting example of programming techniques, and in any case it makes my polygon class a bit more usable.

The idea is that there is a 100 ×100 grid, with origin in the center at 0,0 and coordinates ranging ±50, and all images are drawn within this grid. They may be scaled later. There are controls for scaling and rotating the image. 

The use is fairly obvious for the most part. The standard file menu allows you to create, save, or open vector files. The vector is stored as a vertex list. There are two arrow keys next to the image list that allow you to rearrange the points.

The points are editable; clicking twice (not double-clicking) on a point makes it directly editable. The effects will be seen when you hit Enter or select out of the item.

There are four arrows that modify the list by adding or subtracting 1 from the x or y axis to move the image left, right, up, or down.

You can type in a new point and click the Add button, and it will be added following the current selection (if there is no selection, it is added at the end of the list).

Clicking the mouse in the drawing will transfer the mouse coordinates to the input box. Double-clicking the mouse in the drawing will also perform an Add operation. What I do is click in the approximate areas I want, then clean it up doing hand-editing. Nothing deep, but it greatly simplified the creation of a number of scalable "icons" for a graphical representation of moving objects.

Selecting a point in the point list will highlight that point in the drawing with a small red circle. The Delete button deletes the currently selected point. File | New deletes all the points.

Here's a little submarine icon I drew in about seven minutes. It is shown rotated 20°. Note the small red circle at the bottom that represents the highlighted point. I turned the grid off to get a clearer image.

The views expressed in these essays are those of the author, and in no way represent, nor are they endorsed by, Microsoft.

Send mail to newcomer@flounder.com with questions or comments about this web site.
Copyright © 2001 All Rights Reserved

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

Joseph M. Newcomer

United States United States
No Biography provided

Comments and Discussions

 
GeneralVery cool toy project when someone else paid you to do it!!! PinmemberWREY7-Jun-02 23:09 
GeneralRe: Very cool toy project when someone else paid you to do it!!! PinmemberJörgen Sigvardsson10-Jun-02 0:54 
GeneralRe: Very cool toy project when someone else paid you to do it!!! PinmemberWREY10-Jun-02 7:53 
GeneralRe: Very cool toy project when someone else paid you to do it!!! PinmemberJim A. Johnson10-Jun-02 8:15 
GeneralRe: Very cool toy project when someone else paid you to do it!!! PinmemberWREY10-Jun-02 15:59 
GeneralRe: Very cool toy project when someone else paid you to do it!!! PinmemberR10-Jun-02 21:47 
GeneralRe: Very cool toy project when someone else paid you to do it!!! PinmemberWREY10-Jun-02 22:16 
GeneralRe: Very cool toy project when someone else paid you to do it!!! PinmemberR10-Jun-02 23:05 
GeneralRe: Very cool toy project when someone else paid you to do it!!! PinmemberWREY11-Jun-02 0:54 

You are correct, "What does have relevance are the facts," and the FACT IS, that he did post work he was paid by me to do, without at least having the decency of asking first. That is the fact, as we can all see.
 
No. He did not do two separate set of work for me. He did one, of which he earlier released a portion of it, and for which he knew of my displeasure for having done so, because I privately communicated that to him (that was about 8, or maybe 9 months ago). This is a second repeat of another portion of the same work!!!!
 
With regards to "discussing" this matter, it was never my intention to "discuss" anything here. I simply stated the fact!!!!
 
Mindful that a "discussion" is NEVER a solo act; others must be involved for it to be a "discussion". All participants hold a share in making it so.
 
William
GeneralRe: Very cool toy project when someone else paid you to do it!!! PinmemberJim A. Johnson11-Jun-02 4:17 
GeneralRe: Very cool toy project when someone else paid you to do it!!! PinmemberWREY11-Jun-02 10:49 
GeneralRe: Very cool toy project when someone else paid you to do it!!! PinmemberEmmanuel Deloget12-Jun-02 3:28 
GeneralRe: Very cool toy project when someone else paid you to do it!!! PinmemberWREY12-Jun-02 10:22 
GeneralRe: Very cool toy project when someone else paid you to do it!!! PinmemberMark_VC27-Jul-07 5:44 
GeneralExcellent! PinmemberStefan Spenz6-Jun-02 4:36 
GeneralNicely Done PinmemberEd Gadziemski6-Jun-02 3:41 
GeneralVery cool! PinmemberAlexander Wiseman6-Jun-02 2:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web01 | 2.8.140916.1 | Last Updated 6 Jun 2002
Article Copyright 2002 by Joseph M. Newcomer
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid