473,516 Members | 2,889 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem in drawing on WPF canvas

6 New Member
When I draw rectangle on WPF canvas with thickness=1 and color=black.
It looks like it increases the thickness and spared the color. The drawing doesn’t look sharp. How to solve this problem?

Protected Overrides Sub OnRender(ByVal dc As System.Windows.Media.DrawingContext)
dc.DrawRectangle(Nothing, New Pen(Brushes.Black, 1), New Rect(10, 10, 100, 100))
MyBase.OnRender(dc)
End Sub
Jun 11 '08 #1
0 1608

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

Similar topics

0
1147
by: phil | last post by:
I'm mapping quadratic equations on a Canvas. But that's irrelevant, the point is I am drawing a lot of points in a loop without returning to mainloop until the end. I want my students to see the drawing progress, so I call update_idletasks() after each tiny rectangle. ( I use to call update() and it seems to make no difference) This is...
2
11244
by: billy | last post by:
I'm working on a sort of paint program that has the usual canvas pane in the middle of the main form. I'm working on that class and have a couple quick questions.. actually more like I'm looking for opinions. 1) I want a ruler running along from top left to top right and from top left to bottom left. I want to use a skinny UserControl or...
2
1424
by: Martin Horn | last post by:
Hi all, I'm adding basic drawing capability to an application that I am writing, and I have been having problems with making the graphics output persist when the application is re-sized,covered etc. This is the solution I have come up with, but it seems a bit convoluted. Before I get too far into the development of the program, could...
7
2165
by: Pontifex | last post by:
Hi all, I heard or read that the next version of HTML will provide long-overdue drawing commands. Which version of Firefox, Opera or IE supports such new fancy stuff? Thanks!
5
5565
by: Andrew Poulos | last post by:
Is there a right/best way to draw an ellipse using Canvas? (With VML there's the v:oval element which makes the exercise trivial). I tried drawing a 360 degree arc (a circle) and then scaling it but that also scales the thickness of the circumference. I'm trying bezier curves but without visual feedback it's pretty hard to draw. And...
11
1324
by: Tool69 | last post by:
Hi, I've got a simple but difficult problem : Suppose I've got a Paper class, on wich I can draw i.e a rectangle, a circle or whatever. class Paper(...): def __init__(self, paperx, papery): self.paperx = paperx self.papery = papery
1
1770
by: Andrew | last post by:
Hello Everyone I am receiving an error in an application I am working on. The application when its done will be a Dungeons and Dragons Network game. I am having problems with the Networked Canvas basically for drawing the dungeon maps If I initialize two of the Tkinter Canvas widgets with in the same window I can draw across the network,...
1
2133
by: dishal | last post by:
Hi, Im having a problem with typing on the JPanel. The thing is, that it works perfectly fine when this line " content.add(jp, BorderLayout.NORTH); " is taken out (its the buttons panel) but when its added back in, i simply cannot type! HELP!!!! Codes are as follow: import java.awt.*; import javax.swing.*; import java.awt.event.*;
15
4013
by: javelin | last post by:
I need to be able to create a javascript based drawing/signature box, and be able to save it. Can someone refer me to a script that will allow this, or even a 3rd party package for sale? It can't be Java or ActiveX. Thank you.
7
3541
by: raylopez99 | last post by:
I have a logical drawing space much bigger than the viewport (the screen) and I'd like to center the viewport (the screen) to be at the center of the logical drawing space. After following the excellent transforms specified on Bob Powell's site, I still wonder if there's an easier way of centering it than the following procedure? Here is...
0
7182
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7408
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. ...
1
7142
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...
0
5714
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...
0
3267
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...
0
3259
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1624
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
1
825
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
488
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...

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.