Re: CDC problem

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



GDI+ although it would support float has to round it of to the nearest pixel
before it gets drawn to the screen.
There is no concept of float pixel or partial whatever library we choose.

Thanks
Vipin

"Mike D Sutton" <EDais@xxxxxxxx> wrote in message
news:eoFicupmFHA.2444@xxxxxxxxxxxxxxxxxxxxxxx
> > I am using CDC member functions( MoveTo, LineTo,Polygon) for drawing
> > different shapes in the display, however these functions are taking
input as
> > integer parameters. I can't draw smooth lines with the help of LineTo
> > functions.
> >
> > I am limited to use only CDC functions for drawing different shapes in
the
> > output, so how to handle floating point numbers for these member
functions ?
>
> GDI uses integer based coordinates and whilst mapping modes may give you
slightly better precision, at the end of the day it's still
> drawing to the same sized pixels so there's a limit to what it can do..
For more precise drawing you would need to use a library
> that supports floating point drawing coordinates such as GDI+
> Hope this helps,
>
> Mike
>
>
> - Microsoft Visual Basic MVP -
> E-Mail: EDais@xxxxxxxx
> WWW: Http://EDais.mvps.org/
>
>


.



Relevant Pages

  • Re: Basic Graphic Questions
    ... COBOL days) In this regard I get VB's object (picturebox for example) ... then use an GDI to do the actual drawing. ... then drawing based on that scale? ...
    (microsoft.public.vb.general.discussion)
  • Re: Basic Graphic Questions
    ... COBOL days) In this regard I get VB's object (picturebox for example) ... then use an GDI to do the actual drawing. ... then drawing based on that scale? ...
    (microsoft.public.vb.general.discussion)
  • Re: Basic Graphic Questions
    ... then drawing based on that scale? ... There is probably a little bit of speed to be gained by avoiding the individual scale calculations each time you draw something, although VB would still need to do them itself "under the hood" if you used the Scale methods so it might not be a large speed difference, but there is certainly /some/ speed to be gained, and a lot to be gained in the simplicity of your drawing code. ... If you are also changing the size of your PictureBox and if you are redrawing the stuff at a new scale, so that it still all fits, then you would be better off setting the PictureBox to a User scale (so that it always has the same number of horizontal and vertical "units" regardless of its actual pixel size. ... Talking specifically about your current VB drawing methods (although there are similar options when using GDI methods) if you want your origin to be somewhere other than the top left corner then you can use the VB Scale method to set the origin to any other position you wish, either inside or outside the PictureBox. ...
    (microsoft.public.vb.general.discussion)
  • Re: PictureBox Scale Confusion
    ... I was able to drag the GDI vertical ... Scale in set in routine which plots the underlying graphics. ... I'm setting the scale to draw a line in a PictureBox as follows ... Why do I need to rescale the picturebox to its actual pixel ...
    (microsoft.public.vb.general.discussion)
  • Re: OnPaint Function Issue
    ... I assume that by double-buffering that you mean using the GDI type Windows ... API functions like BitBlt where all drawing is done to a off sreen memory ... As far as I am aware there are no memory device contexts or bitblitting ...
    (microsoft.public.dotnet.framework.drawing)