Re: The correct way to implement a large scrolled canvas



On Tue, 2004-10-19 at 20:20 +0100, David J. Singer wrote:
> Hope I can explain this clearly enough! :)
> 
> Assume I want to create (say) a vector drawing program allowing the user
> to draw shapes on a drawing area that resides within a scrolled window. 
> 
> I understand the standard way of doing this (i.e. create a drawing area
> of an appropriate size, then insert it in to a scrolled window) but it strikes
> me that this is an inefficient way of doing things for a large drawing area,
> as the complete drawing area needs to be maintained in memory, even 
> though only a small part of it is visible at any time.   This seems to be the
> way that most programs of this sort work (for example - dia).

There is no memory cost proportional to the size of the drawing area. 
(That's why you need to repaint your drawing area in the expose
handler...)

Regards,
						Owen

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]