Re: Smooth lines in Picturebox

Tech-Archive recommends: Fix windows errors by optimizing your registry



I would work in Pixels

OK, how do I do that?

RBS

J French wrote:
On Mon, 9 Oct 2006 21:13:51 +0100, "RB Smissaert"
<bartsmissaert@xxxxxxxxxxxxxxxx> wrote:

Wrote a dll to make graphs from 2-D arrays.
It simply is a form with a picturebox and the lines are drawn like this:

Picture1.Line ((ColOffset + sFirstXWidth / 2) + _
(.Width - (ColOffset + sFirstXWidth)) *
arrDatePercs(i), FirstPoint)- _
((ColOffset + sFirstXWidth / 2) + _
(.Width - (ColOffset + sFirstXWidth)) *
arrDatePercs(i + 1), _
SecondPoint), _
LineColour

All working very well, except the lines are bit jagged.
Any suggestions how to get nice, smooth lines?
Would I need the API for this?
Speedwise I don't need that as it very fast as it is.

I would work in Pixels, they are native to what is really going on,
also I've had strange differences in output on different machines
while using Twips.

I'm not sure that the APIs will give you a better result, things
always boil down to Pixels

.



Relevant Pages

  • Re: Smooth lines in Picturebox
    ... It simply is a form with a picturebox and the lines are drawn like this: ... SecondPoint), _ ... Would I need the API for this? ... I would work in Pixels, they are native to what is really going on, ...
    (microsoft.public.vb.general.discussion)
  • Re: Problem with vista and form appearance
    ... That's because of the PictureBox border, assuming the PictureBox actually has a border which appears to be the case in this specific example. ... The total effective overall border thickness on most machines is typically 4 pixels. ... There still may be other reasons for the apparently large difference in the width to height ratio but the main reason for the resizing is almost certainly not solely because of the fact that it is running in Vista, because similar things can happen on XP machines and indeed on other Win98 machines. ... When you create a VB project, the size of your PictureBox is stored in units of twips. ...
    (microsoft.public.vb.general.discussion)
  • Re: Draw pixel
    ... whether Autoredraw is True or not. ... As far as drawing individual pixels ... difference the API is up ...
    (comp.lang.basic.visual.misc)
  • Re: Problem with SavePicture, and a question on new versions
    ... > mode does not have to be in pixels. ... 500 pixels then the picture box will also be 700 x 500 pixels. ... and the bitmap shows ... to be *smaller* than the scale units that the BitBlt API is using ...
    (comp.lang.basic.visual.misc)
  • Re: drawings
    ... equivalent value in pixels. ... the API equivalent of a VB User Scalemode. ... Private Declare Function SetViewportOrgEx Lib "gdi32" _ ... Dim OldWindowExt As POINTAPI ...
    (microsoft.public.vb.general.discussion)