Solved

Drawing rectangles on picturebox

Posted on 2004-04-23
1
1,464 Views
Last Modified: 2013-12-26
Hi,

I counter a problem when I draw a set of rectangles on picturebox, using line method.

the rectangles' height are 30 and width are 10, but the result is not what I expect.

some rectangles are slim and some are slightly thicker, though they are with same width value.

I do not know how to solve it.

Anyone can help me?


cc
0
Comment
Question by:cc_2000_sg
1 Comment
 
LVL 11

Accepted Solution

by:
dbrckovi earned 250 total points
ID: 10897856
Picture1.Line (100, 100)-(1000, 1000), 1, B

Coordinates specified here do not represent Top, Left, Width, Height as in other controls.

Theese coordinates are exact points where rectangle should be drawn.       Picture1.Line (X1, Y1)-(X2, Y2), 1, B
So we could think of them as   Line (Left,Top)-(Right,Bottom).

So rectangle in above example has width and height of 900

To translate Widths and Heights to Right and Bottom you can use:

Right = Left + Width
Bottom = Top + Height
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now