473,804 Members | 3,790 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 16244
On Sun, 31 Aug 2008 16:07:46 -0700, Roger Frost <fr*****@hotmai l.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...@hotmai l.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
23777
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 believe that. in pieces of the application where speed really matters you can still use "normal" functions or even static methods which is basically the same. in C there arent the simplest things present like constants, each struct and enum...
9
4198
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 integer or decimal part? For example, if in 8.24, should the macro be: #define Int2Fixed(x) (((long)(short)x) << 24)?
65
12632
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 method was a piece of C code which turned out to be incorrect and incomplete but by modifieing it would still be usuable. The first method was this piece of text:
3
3808
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
2563
by: Tamir Khason | last post by:
Somebody knows how to convert Bounds to Point ??? Thnx
3
1665
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 picturebox mouseup event if I clicked inside or outside the 3point area, because the 3point area isn't a real cirkle Any hints or tips are welcome.
39
3125
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. The main ones are : useless storage class specifier in empty declaration, 'point' undeclared (first use in this function), 'p1' undeclared (first use in this function) etc. Any help will be appreciated. Thanks #include <stdio.h> #include...
39
3586
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 out there understands what happens. Essentially, when I subtract the (double) function value GRID_POINT(2) from a variable which has been assigned the same value before this gives a non-zero result and I really do not understand why.
1
5363
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
2201
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 problems later). Apparently Point is a struct, a value type, and it does not behave like a classic structure (in my mind's eye, and see below). Traditionally I think of a classic structure as simply an object where every member is public. But with...
0
9705
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
10568
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...
1
10311
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10074
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6847
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
5647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4292
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
2
3813
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2988
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.