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

Back to archive index

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


-------------------------
REMOTE_ADDR = 70.49.48.128
REMOTE_HOST = 
        URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-dancr-rbcatut
-------------------------
@@ -320,7 +320,7 @@
 
         Looking at the output of the above (12.3.1.2.1) example code does not reveal the important details. A much better results would be achieved, if the((*default scale*))were used. The default scale, namely is set as((*scale(1, 1).*)) However, this would require, that rectangle coordinates were given in pixels rather than in relative notation (i.e. as fractions), which calls for a short detour explaining these issues. This actually is exactly what we here are doing.
 
-        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!
+        The most important thing here is understanding the parameters passed to the scale method:((*scale(sx, sy).*)) The((*sx*))and((*sy*)) parameters actually represent ((*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 x=1 would translate to 150 pixels on your display.
         




ruby-gnome2-cvs メーリングリストの案内
Back to archive index