Solved

Drawing rectangles on picturebox

Posted on 2004-04-23
1
1,463 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
Comment Utility
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

763 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

10 Experts available now in Live!

Get 1:1 Help Now