473,396 Members | 2,026 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,396 software developers and data experts.

BUG in GDI whit zoom ?

I have found a probable bug when you draw with GDI.
Look this simple code

Private Sub Form1_Paint(ByVal sender As Object, ByVal e
As System.Windows.Forms.PaintEventArgs) Handles
MyBase.Paint

Const Zoom As Single = 0.001
Dim p As Pen

'line incriminate
e.Graphics.SmoothingMode =
Drawing2D.SmoothingMode.AntiAlias

'clear
e.Graphics.Clear(Color.Black)
'zoom
e.Graphics.ScaleTransform(Zoom, Zoom)
'create a pen
p = New Pen(Color.Red, 1)
p.DashPattern = New Single() {5, 5}
'draw line (adjusted to zoom)
e.Graphics.DrawLine(p, (Me.ClientRectangle.Left /
Zoom), (Me.ClientRectangle.Top / Zoom),
(Me.ClientRectangle.Right / Zoom),
(Me.ClientRectangle.Bottom / Zoom))
End Sub

If you set SmoothingMode to AntiAlias or HighQuality the
line is ok: the dash pattern is what you want. But if you
set SmoothingMode to another value, the pattern is
oscene, idem if you set p.DashStyle = DashStyle.Dash (or
other value except Solid) without use DashPattern. If
yout don't use the zoom (ScaleTransform) you have no
problem.

With personal Pattern you must do this to have the
desired pattern

p.DashPattern = New Single() {5 / Zoom, 5 / Zoom}

but if you use this line with e.Graphics.SmoothingMode =
Drawing2D.SmoothingMode.AntiAlias (or HightQuality) the
line's style is obsene.

The right action is with
Drawing2D.SmoothingMode.AntiAlias: if I set thath i want
a line, I want a line, not a trash 'cause i make a
zoom ...

Suggestion ? I must calculate then pattern depending the
quality, and this not good ...

Davide.
Nov 20 '05 #1
0 1469

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

Similar topics

1
by: Philippe C. Martin | last post by:
Hi, I have the following convern: I have Tkinter applications that require a zoom box, and have had the following behavior without changing a line of code: 1) Mandrake 10.0/KDE 3.2/Python 2.3:...
0
by: Francis Parsons | last post by:
Hi! I'm doubtful there's a workaround for this problem, but it's worth a shot. I'm using IE's (css) "zoom" property to zoom the body of a document (in conjunction with persistance so the...
1
by: Alex Stevens | last post by:
Hi All, I have implemented my own toolbar on a form which houses the crystal reprot viewer. I would like to have a combobox to allow the user to change the zoom level to say 25 / 50 / 75 / 100...
2
by: Mo Ade via .NET 247 | last post by:
How do I write code to include a zoom feature in my project so that when my Vb Form loads an image I can click in my main menu zoom in or zoom out? -------------------------------- From: Mo Ade ...
4
by: Yoshitha | last post by:
I'm developing windows application using c#.net (vs 2003), i've placed several images (picture boxes) in panel control and i want to zoom the panel control so that the images and text which...
3
by: jnag | last post by:
I am trying to implement font changer, where I have links on the banner of the site and when the user clicks on the links, the font size of the page has to change. I tried...
4
by: paulcybulski | last post by:
Hi I would like to apply a zoom feature where the user can scroll the mouse wheel to zoom in and out on a movieclip. I currently have zoom implemented as buttons. How would I go about implementing...
0
by: murry19830507 | last post by:
i want creat an web application(c#.net),which contains an image and one radiobutton list with 3 radiobuttons(zoom in ,zoom out ,zoom window) when user checked on zoom in imge has to be zoom inthe...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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,...
0
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...
0
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...

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.