~ubuntu-branches/ubuntu/karmic/gbrainy/karmic

« back to all changes in this revision

Viewing changes to src/CairoContextEx.cs

  • Committer: Bazaar Package Importer
  • Author(s): Siegfried-Angel Gevatter Pujals, Siegfried-Angel Gevatter Pujals, Stefan Ebner, Mirco Bauer
  • Date: 2009-04-20 23:55:28 UTC
  • mfrom: (9.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090420235528-a4u4ikayqjxbp2oc
Tags: 1.10-1
[ Siegfried-Angel Gevatter Pujals ]
* New upstream release:
   - Four new games.
   - Support for extensions.
   - Bug fixes and translations.
* debian/watch
   - Fix it (well, not really, upstream uses a broken versioning scheme).
* debian/control:
   - Update libgnome-cil build-dependency for gnome-sharp transition.
* debian/rules:
   - Add get-orig-source rule to please Mirco.

[ Stefan Ebner ]
* Bump Standards version to 3.8.1 

[ Mirco Bauer ]
* debian/control:
  + Added libmono-addins0.2-cil and libmono-addins-gui0.2-cil to build-deps.

Show diffs side-by-side

added added

removed removed

Lines of Context:
348
348
                }
349
349
        }
350
350
 
 
351
        public void DrawImageFromAssembly (string  resource, double x, double y, double width, double height)
 
352
        {
 
353
                try {
 
354
                        using (SVGImage image = new SVGImage (System.Reflection.Assembly.GetCallingAssembly (), resource))
 
355
                        {
 
356
                                DrawImage (image, x, y, width, height);
 
357
                        }
 
358
                }
 
359
                catch (Exception)
 
360
                {
 
361
                        return;
 
362
                }
 
363
        }
 
364
 
 
365
        public void DrawImageFromFile (string filename, double x, double y, double width, double height)
 
366
        {
 
367
                try {
 
368
                        using (SVGImage image = new SVGImage (filename))
 
369
                        {
 
370
                                DrawImage (image, x, y, width, height);
 
371
                        }
 
372
                }
 
373
                catch (Exception)
 
374
                {
 
375
                        return;
 
376
                }
 
377
        }
 
378
 
 
379
        void DrawImage (SVGImage image, double x, double y, double width, double height)
 
380
        {               
 
381
                Save ();
 
382
                Translate (x, y);
 
383
                Scale (width / image.Width, height / image.Height);
 
384
                image.RenderToCairo (Handle);
 
385
                Restore ();
 
386
        }
351
387
}
352
388