473,387 Members | 1,904 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.

WPF Point?

I need to draw a single point with WPF but there doesn't seem to be a class
that represents the most fundamental geometric object.

Any idea's?

--
Roger Frost
"Logic Is Syntax Independent"

Aug 31 '08 #1
4 16203
On Sun, 31 Aug 2008 16:07:46 -0700, Roger Frost <fr*****@hotmail.com>
wrote:
I need to draw a single point with WPF but there doesn't seem to be a
class that represents the most fundamental geometric object.

Any idea's?
Don't rely on me for expert WPF advice. However, my observation is that
WPF is a much more geometry-based graphical API than, for example, GDI+.
In particular, when you write that "a single point" is "the most
fundamental geometric object", that's not actually true in a purely
mathematical sense. Likewise, in WPF I don't think there's any such thing
as a point that can be visualized, so there wouldn't be any point in
providing any way to represent one as a visual object.

You should decide on what shape you want to draw the point, and then
create a suitably sized object of that shape to represent your point.

Pete
Aug 31 '08 #2
Roger Frost wrote:
I need to draw a single point with WPF but there doesn't seem to be a
class that represents the most fundamental geometric object.
WPF doesn't have a pixel grid, so it's not possible to draw a 'point'.
Maybe you want a rectangle of height and width 1? (ie. 1/96th of an inch)

Alun Harford
Aug 31 '08 #3
On Aug 31, 6:07 pm, "Roger Frost" <fros...@hotmail.comwrote:
I need to draw a single point with WPF but there doesn't seem to be a class
that represents the most fundamental geometric object.

Any idea's?

--
Roger Frost
"Logic Is Syntax Independent"
WPF is a vector based engine Microsoft WinForms graphics library (GDI
+) is raster based. When working with rasterized graphics you
typically manipulate pixels, with vectors are not defined in pixel
units. Attempting to draw a pixel at x,y on a WPF canvas is a working
"against the grain". Having said that you'll probably find what you're
looking for in BitmapSource class in System.Windows.Media.Imaging

Reference:
http://msdn.microsoft.com/en-us/libr...mapsource.aspx
http://thewpfblog.com/?p=19
Aug 31 '08 #4
>I need to draw a single point with WPF but there doesn't seem to be a
>class
that represents the most fundamental geometric object.

Any idea's?

--
Roger Frost
"Logic Is Syntax Independent"

WPF is a vector based engine Microsoft WinForms graphics library (GDI
+) is raster based. When working with rasterized graphics you
typically manipulate pixels, with vectors are not defined in pixel
units. Attempting to draw a pixel at x,y on a WPF canvas is a working
"against the grain". Having said that you'll probably find what you're
looking for in BitmapSource class in System.Windows.Media.Imaging

Reference:
http://msdn.microsoft.com/en-us/libr...mapsource.aspx
http://thewpfblog.com/?p=19

Well dang, I guess I'll be scaling ellipses then, I want to stay within
System.Windows.Shapes

Thanks,
Roger

Sep 1 '08 #5

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

Similar topics

687
by: cody | last post by:
no this is no trollposting and please don't get it wrong but iam very curious why people still use C instead of other languages especially C++. i heard people say C++ is slower than C but i can't...
9
by: pout | last post by:
What are the purposes of fixed-point? When should it be used? I read: #define Int2Fixed(x) (((long)(short)x) << 16) and the fixed-point in 16.16 format. Does the 16 in the MACRO refer to...
65
by: Skybuck Flying | last post by:
Hi, I needed a method to determine if a point was on a line segment in 2D. So I googled for some help and so far I have evaluated two methods. The first method was only a formula, the second...
3
by: Action | last post by:
Point is a struct but I can do both Point a; Write(a.X); Write(a.Y); and Point a = new Point(1,1); Write(a.X);
1
by: Tamir Khason | last post by:
Somebody knows how to convert Bounds to Point ??? Thnx
3
by: Peter Proost | last post by:
Hi group, I've got this bit of code (see below) which draws a basketball field in a picturebox (width:198, height:368) but now I was wondering what would be the easiest way to check inside the...
39
by: DanielJohnson | last post by:
I wrote a simply program with a 3 D coordinate called point. I am adding two points, taking their distance etc. gcc compiler is not identifying the struct. Here is the code. I get bunch of errors....
39
by: rembremading | last post by:
Hi all! The following piece of code has (for me) completely unexpected behaviour. (I compile it with gcc-Version 4.0.3) Something goes wrong with the integer to float conversion. Maybe somebody...
1
by: Linda Liu[MSFT] | last post by:
Hi George, Thank you for posting! This is a quick note to let you know that I am doing research on this issue and will get back to you ASAP. I appreciate your patience! Sincerely,
0
by: raylopez99 | last post by:
I ran afoul of this Compiler error CS1612 recently, when trying to modify a Point, which I had made have a property. It's pointless to do this (initially it will compile, but you'll run into...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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:
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...
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.