[ruby-gnome2-doc-cvs] [Ruby-GNOME2 Project Website] update - tut-gtk2-dancr-rbcatut

アーカイブの一覧に戻る

ruby-****@sourc***** ruby-****@sourc*****
2013年 3月 25日 (月) 20:02:11 JST


-------------------------
REMOTE_ADDR = 70.49.48.128
REMOTE_HOST = 
        URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-dancr-rbcatut
-------------------------
@@ -322,7 +322,7 @@
 
         The most important thing here is understanding the parameters passed to the scale method:((*scale(sx, sy).*)) The((*sx*))and((*sy*)) parameters actually represents((*pixels*)). Namely,((*scale(1,1)*)) means that your working area will be measured in pixels. The size of 1 pixel depends on the device (display) you are using. Commonly one pixel is 1/75" = 0.0133". This means that if you use a 75dpi display, for instance 100 pixels will translate to 1.33" (3.378 cm). Now, if you set cairo context's scale to((*scale(2,2),*)) 100 pixels would translate to twice that, i.e. 2.66" (6.756 cm). Imagine using((*scale(100,100).*)) That would translate to  133" (337.8 cm). Unless you are very rich, I do not think, you will ever have a display capable of displaying such a large image!
 
-        However, as you have seen in the above example (12.3.1.2.1), it is possible to use scale with values of their((*sx*))and((*sy*))arguments that resemble sizes of images in pixels. In this cases you should not use pixels as units for the coordinates of the shapes you are drawing. Instead, you should use relative notation in the form of fractions, most likely, but not exclusively, between 0 and 1, where for ((*scale(sx=100, sy=150)*)) x=1 would mean 100 pixels, and y=1 would translate to 150 pixels on your display.
+        However, as you have seen in the above example (12.3.1.2.1), it is possible to use scale with values of their((*sx*))and((*sy*))arguments that resemble sizes of images in pixels. In this cases you should not use pixels as units for the coordinates of the shapes you are drawing. Instead, you should use relative notation in the form of fractions, most likely, but not exclusively, between 0 and 1, where for ((*scale(sx=100, sy=150)*))x=1 would mean 100 pixels, and x=1 would translate to 150 pixels on your display.
         
         Another thing to be aware of when modifying scale is the line thickness. Namely, it too is affected when switching between single digit scale settings to settings in hundreds of pixels. This may become very confusing if one is not careful, particularly when your line thickness becomes larger than your object or a geometric shape you are drawing. 
 
@@ -338,11 +338,11 @@
          class DefaultScaleDemo < CairoWindow
          
            def draw(cr, da)
-         #width, height = da.window.size
+             #width, height = da.window.size
          
              # Your code comes here:
              # ---------------------
-             # cr.scale(1, 1)		# scale(1, 1) is the default
+             # cr.scale(1, 1)  # scale(1, 1) is the default
              cr.line_width = 1
              cr.set_source_rgb(0.5, 0, 0)
              cr.rectangle(0, 0, 50, 50)
@@ -354,7 +354,6 @@
          window.set_size_request(100, 75)
          window.show_all
          Gtk.main
-
 
 
 




ruby-gnome2-cvs メーリングリストの案内
アーカイブの一覧に戻る