Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Windos
win32.3rdparty
win32.directx.audio
win32.directx.ddk
win32.directx.graphics
win32.directx.input
win32.directx.managed
win32.directx.misc
win32.directx.networking
win32.directx.sdk
win32.directx.video
win32.dirx.grap.shaders
win32.gdi
win32.international
win32.kernel
win32.messaging
win32.mmedia
win32.networks
win32.ole
win32.rtc
win32.tapi
win32.tapi.beta
win32.tools
win32.ui
win32.wince
win32.wmi
windows.mediacenter
winfx.aero
winfx.announcements
winfx.avalon
winfx.collaboration
winfx.fundamentals
winfx.general
winfx.indigo
winfx.sdk
winfx.winfs
  
 
date: Mon, 30 Jun 2008 23:24:00 -0700,    group: microsoft.public.win32.programmer.gdi        back       


GDI: 2D Graph Project realted questions   
There are several question I'd like to ask:

1. How do I persist the drawing on the form? When I move the window, or 
minimize it, etc the image disappears
2. When is the best time I can draw the axes (the x-axis, y-axis)

These are the questions I can think of right now. I know I may have more.

--deostroll
date: Mon, 30 Jun 2008 23:24:00 -0700   author:   deostroll

Re: GDI: 2D Graph Project realted questions   
"deostroll"  wrote in message 
news:057EA36D-F120-47F5-A4C2-A3D7CD5440FB@microsoft.com...
> There are several question I'd like to ask:
>
> 1. How do I persist the drawing on the form? When I move the window, or
> minimize it, etc the image disappears
> 2. When is the best time I can draw the axes (the x-axis, y-axis)


You can draw in response to the Paint event.

It's up to you to persist any data needed to redraw the window when it needs 
refreshing.

Mark

-- 
Mark Salsbery
Microsoft MVP - Visual C++

>
> These are the questions I can think of right now. I know I may have more.
>
> --deostroll
date: Tue, 1 Jul 2008 09:30:04 -0700   author:   Mark Salsbery [MVP] MarkSalsbery[MVP]@newsgroup.nospam

Re: GDI: 2D Graph Project realted questions   
Is there a logic/algorithm behind drawing continous smooth curves?
--deostroll
date: Thu, 3 Jul 2008 15:49:55 -0700 (PDT)   author:   deostroll

Re: GDI: 2D Graph Project realted questions   
"deostroll"  wrote in message 
news:35505d31-4e2c-4bff-98f9-ece109590355@u6g2000prc.googlegroups.com...
> Is there a logic/algorithm behind drawing continous smooth curves?

Bezier curves are one example.

Maybe Google "draw smooth curve graph" - there should be LOTS of info :)

Mark

-- 
Mark Salsbery
Microsoft MVP - Visual C++


> --deostroll
date: Thu, 3 Jul 2008 16:01:16 -0700   author:   Mark Salsbery [MVP] MarkSalsbery[MVP]@newsgroup.nospam

Re: GDI: 2D Graph Project realted questions   
On Jul 4, 4:01 am, "Mark Salsbery [MVP]"
<MarkSalsbery[MVP]@newsgroup.nospam> wrote:
> "deostroll"  wrote in message
>
> news:35505d31-4e2c-4bff-98f9-ece109590355@u6g2000prc.googlegroups.com...
>
> > Is there a logic/algorithm behind drawing continous smooth curves?
>
> Bezier curves are one example.
>
> Maybe Google "draw smooth curve graph" - there should be LOTS of info :)
>
> Mark
>
> --
> Mark Salsbery
> Microsoft MVP - Visual C++
>
> > --deostroll

Hi,
Is this the same algorithm used to draw straight lines?
--deostroll
date: Mon, 7 Jul 2008 20:06:10 -0700 (PDT)   author:   deostroll

Re: GDI: 2D Graph Project realted questions   
There is exactly one place you are allowed to draw on the surface if you expect it to
persist, and that is in OnPaint.  Any drawing done outside OnPaint will not persist, and
essentially represents erroneous programming.

You draw EVERYTHING in the OnPaint handler, so there is no "best time"; it is always part
of the one-and-only drawing event.  Generally, most attempts to "optimize" performance
will reduce it, because GDI is better at clipping than an application can be.

What you do is create a data structure of some sort that, when processed, will create your
graph.  Typically, it is just the array of x,y points to plot.  But the only place you
draw them is in OnPaint.  Where you draw the axes.  If you add a point, you typically only
have to invalidate the area in which it will be drawn.  

But if you are not drawing in OnPaint, you need to study carefully how proper graphics are
done in Windows.
				joe

On Mon, 30 Jun 2008 23:24:00 -0700, deostroll  wrote:

>There are several question I'd like to ask:
>
>1. How do I persist the drawing on the form? When I move the window, or 
>minimize it, etc the image disappears
>2. When is the best time I can draw the axes (the x-axis, y-axis)
>
>These are the questions I can think of right now. I know I may have more.
>
>--deostroll
date: Thu, 31 Jul 2008 04:49:57 -0400   author:   Joseph M. Newcomer

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us