473,909 Members | 2,700 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 16253
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
23987
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
4208
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
12664
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
3815
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
2567
by: Tamir Khason | last post by:
Somebody knows how to convert Bounds to Point ??? Thnx
3
1670
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
3134
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
3601
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
5369
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
2207
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
10037
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
11348
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...
0
10921
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11052
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
9727
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
8099
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5938
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
4336
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3359
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.