CONTENTS DELETED
The author has deleted this message.
|
Hi Vam, although I haven't worked with cairo yet, it seems that you are loading the image from a file (imageSurface := CairoGraphics.ImageSurface pngPath: 'c:\temp\test.png') on each redisplay. This can make your repaint process slow, specially flickering when scrolling or changing its bounds. If that's the case I would suggest loading the image in advance and storing it in an instance variable of your view and just using the i.v. on the display method. HTH, Andrés VAM <[hidden email]> ha escrito: > > I made MyView and using CairoGraphics for displaying (using subCanvas). > MyView may be scrollable. > I should display background image. Now, my background image is scroll with > subcanvas view and dirty redisplay. > > displayOn: aGraphicsContext > aGraphicsContext newCairoContextWhile: > [:aCairoContext | > imageSurface := CairoGraphics.ImageSurface pngPath: 'c:\temp\test.png'. > aCairoContext sourceSurface: imageSurface x: (self bounds center x) y: > (self bounds center y). > aCairoContext paint]. > > > Do anybody like things? > > > -- > View this message in context: http://old.nabble.com/non-scroll-background-in-subcanvas-tp26952338p26952338.html > Sent from the VisualWorks mailing list archive at Nabble.com. > > _______________________________________________ > vwnc mailing list > [hidden email] > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc > ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
VAM,
You might also want to look at using Assets to "preload" those images with caching methods. Set the i.v. of your view from the asset accessor. Cheers! Tom Hawker -------------------------- Senior Framework Developer -------------------------- Home +1 (408) 274-4128 Office +1 (408) 576-6591 Mobile +1 (408) 835-3643 -----Original Message----- From: [hidden email] [mailto:[hidden email]] On Behalf Of [hidden email] Sent: Tuesday, December 29, 2009 7:07 AM To: [hidden email] Subject: Re: [vwnc] non scroll background in subcanvas Hi Vam, although I haven't worked with cairo yet, it seems that you are loading the image from a file (imageSurface := CairoGraphics.ImageSurface pngPath: 'c:\temp\test.png') on each redisplay. This can make your repaint process slow, specially flickering when scrolling or changing its bounds. If that's the case I would suggest loading the image in advance and storing it in an instance variable of your view and just using the i.v. on the display method. HTH, Andrés VAM <[hidden email]> ha escrito: > > I made MyView and using CairoGraphics for displaying (using subCanvas). > MyView may be scrollable. > I should display background image. Now, my background image is scroll with > subcanvas view and dirty redisplay. > > displayOn: aGraphicsContext > aGraphicsContext newCairoContextWhile: > [:aCairoContext | > imageSurface := CairoGraphics.ImageSurface pngPath: 'c:\temp\test.png'. > aCairoContext sourceSurface: imageSurface x: (self bounds center x) y: > (self bounds center y). > aCairoContext paint]. > > > Do anybody like things? > > > -- > View this message in context: http://old.nabble.com/non-scroll-background-in-subcanvas-tp26952338p26952338.html > Sent from the VisualWorks mailing list archive at Nabble.com. > > _______________________________________________ > vwnc mailing list > [hidden email] > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc > ---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program. _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc IMPORTANT NOTICE Email from OOCL is confidential and may be legally privileged. If it is not intended for you, please delete it immediately unread. The internet cannot guarantee that this communication is free of viruses, interception or interference and anyone who communicates with us by email is taken to accept the risks in doing so. Without limitation, OOCL and its affiliates accept no liability whatsoever and howsoever arising in connection with the use of this email. Under no circumstances shall this email constitute a binding agreement to carry or for provision of carriage services by OOCL, which is subject to the availability of carrier's equipment and vessels and the terms and conditions of OOCL's standard bill of lading which is also available at http://www.oocl.com. _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
In reply to this post by vam
Hi,
I do this kind of things with Cairo allthough not with images. My Cairo view is scalable has inifite horizontal size and scrolls vertically with a scroll bar. In order to get good Cairo speed you should never draw outside the actual View bounds. This however is not compatible with a standard scrolling view. For this reason my Cairo View does not have any scroll bar. I keep track of its bounds and origin point, its real size are the actual bounds of the view (or the screen bounds upon creation). In order to scroll I use a seperate View of horizontal size 0, with only the scroll bar being visible. When I scroll the separate view I change the origin point of the CairoView which updates through invalidation of the view or through the Extra activity loop I am using (See also the Akamura example). My CairoView also updates from the associated dataset navigation and from redbutton dragging (if nothing is selected). It involves quite some hacking around to make it all work work, but the end Cairo speed is acceptable. Hope this helps you start off. @+Maarten, ----- Original Message ----- From: "VAM" <[hidden email]> To: <[hidden email]> Sent: Tuesday, December 29, 2009 9:54 AM Subject: [vwnc] non scroll background in subcanvas > > > I made MyView and using CairoGraphics for displaying (using subCanvas). > MyView may be scrollable. > I should display background image. Now, my background image is scroll with > subcanvas view and dirty redisplay. > > displayOn: aGraphicsContext > aGraphicsContext newCairoContextWhile: > [:aCairoContext | > imageSurface := CairoGraphics.ImageSurface pngPath: 'c:\temp\test.png'. > aCairoContext sourceSurface: imageSurface x: (self bounds center x) y: > (self bounds center y). > aCairoContext paint]. > > > Do anybody like things? > > > -- > View this message in context: > http://old.nabble.com/non-scroll-background-in-subcanvas-tp26952338p26952338.html > Sent from the VisualWorks mailing list archive at Nabble.com. > > _______________________________________________ > vwnc mailing list > [hidden email] > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc > > _______________________________________________ vwnc mailing list [hidden email] http://lists.cs.uiuc.edu/mailman/listinfo/vwnc |
Free forum by Nabble | Edit this page |