home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 April / CMCD0404.ISO / Software / Demo / conceptdraw / data1.cab / Samples__Basic / SimpleDrawing / DrawLines / DrawLines.cdb next >
Text File  |  2004-02-13  |  6KB  |  131 lines

  1. Sub DrawLines()
  2.     Dim active_page As Page        '╨í╤ü╤ï╨╗╨║╨░ ╨╜╨░ ╨░╨║╤é╨╕╨▓╨╜╤â╤Ä ╤ü╤é╤Ç╨░╨╜╨╕╤å╤â ╨░╨║╤é╨╕╨▓╨╜╨╛╨│╨╛ ╨┤╨╛╨║╤â╨╝╨╡╨╜╤é╨░.
  3.     Dim new_Shape As Shape        '╨í╤ü╤ï╨╗╨║╨░ ╨╜╨░ ╨╛╨▒╤è╨╡╨║╤é-╤ê╤ì╨╣╨┐, ╨┐╤Ç╨╡╨┤╤ü╤é╨░╨▓╨╗╤Å╤Ä╤ë╨╕╨╣ ╨╜╨╛╨▓╤ï╨╣ ╨┐╨╛╤ü╤é╤Ç╨╛╨╡╨╜╨╜╤ï╨╣ ╨┐╤Ç╤Å╨╝╨╛╤â╨│╨╛╨╗╤î╨╜╨╕╨║.
  4.     Dim line_color As Color        '╨í╤ü╤ï╨╗╨║╨░ ╨╜╨░ ╨╛╨▒╤è╨╡╨║╤é Color ╨┤╨╗╤Å LineColor ╤é╨╡╨║╤â╤ë╨╡╨│╨╛ ╨╛╨▒╤è╨╡╨║╤é╨░.
  5.     
  6.     '╨ƒ╨╛╨╗╤â╤ç╨░╨╡╨╝ ╤ü╤ü╤ï╨╗╨║╤â ╨╜╨░ ╨░╨║╤é╨╕╨▓╨╜╤â╤Ä ╤ü╤é╤Ç╨░╨╜╨╕╤å╤â ╤é╨╡╨║╤â╤ë╨╡╨│╨╛ ╨┤╨╛╨║╤â╨╝╨╡╨╜╤é╨░.
  7.     set active_page = thisDoc.ActivePage
  8.     '╨₧╤ç╨╕╤ü╤é╨╕╤é╤î ╨┤╨╛╨║╤â╨╝╨╡╨╜╤é ╨╛╤é ╨▓╤ü╨╡╤à ╨╜╨░╤à╨╛╨┤╤Å╤ë╨╕╤à╤ü╤Å ╨▓ ╨╜╨╡╨╝ ╤ü╨╡╨╣╤ç╨░╤ü ╤ê╤ì╨╣╨┐╨╛╨▓.
  9.     active_page.RemoveAllShapes()
  10.  
  11.     '╨¥╨░ ╨░╨║╤é╨╕╨▓╨╜╨╛╨╣ ╤ü╤é╤Ç╨░╨╜╨╕╤å╨╡ ╤ü╨╛╨╖╨┤╨░╨╡╤é╤ü╤Å ╨╜╨╛╨▓╤ï╨╣ ╨╛╨▒╤è╨╡╨║╤é-╨╛╤é╤Ç╨╡╨╖╨╛╨║ ╨┐╨╛ ╨║╨╛╨╛╤Ç╨┤╨╕╨╜╨░╤é╨░╨╝ ╨║╨╛╨╜╤å╨╛╨▓.
  12.     '╨í╤ü╤ï╨╗╨║╨░ ╨╜╨░ ╤ì╤é╨╛╤é ╨╛╨▒╤è╨╡╨║╤é ╨┐╤Ç╨╕╤ü╨▓╨░╨╕╨▓╨░╨╡╤é╤ü╤Å ╨┐╨╡╤Ç╨╡╨╝╨╡╨╜╨╜╨╛╨╣ new_Shape.
  13.     Set new_Shape = active_page.DrawLine(150,820,350,1120)
  14.     '╨ƒ╨╛╨╗╤â╤ç╨░╨╡╨╝ ╤ü╤ü╤ï╨╗╨║╤â ╨╜╨░ ╨╛╨▒╤è╨╡╨║╤é Color, ╤ü╨╛╨┤╨╡╤Ç╨╢╨░╤ë╨╕╨╣ ╨╕╨╜╤ä╨╛╤Ç╨╝╨░╤å╨╕╤Ä ╨╛ ╤å╨▓╨╡╤é╨╡ ╨╗╨╕╨╜╨╕╨╕ Shap'╨░
  15.     Set line_color = new_Shape.PenColor
  16.     '╨ú╤ü╤é╨░╨╜╨░╨▓╨╗╨╕╨▓╨░╨╡╨╝ ╤å╨▓╨╡╤é ╨╗╨╕╨╜╨╕╨╕ ╨╛╨▒╤è╨╡╨║╤é╨░, ╨╕╤ü╨┐╨╛╨╗╤î╨╖╤â╤Å ╨╕╨╜╨┤╨╡╨║╤ü╨╜╨╛╨╡ ╨┐╤Ç╨╡╨┤╤ü╤é╨░╨▓╨╗╨╡╨╜╨╕╨╡ ╤å╨▓╨╡╤é╨░.
  17.     line_color.Index = 1
  18.     '╨ú╤ü╤é╨░╨╜╨░╨▓╨╗╨╕╨▓╨░╨╡╨╝ ╤ê╨╕╤Ç╨╕╨╜╤â ╨╗╨╕╨╜╨╕╨╕ ╨╛╨▒╤è╨╡╨║╤é╨░.
  19.     new_Shape.PenWeight = 28
  20.     '╨ú╤ü╤é╨░╨╜╨░╨▓╨╗╨╕╨▓╨░╨╡╨╝ Pattern ╨╗╨╕╨╜╨╕╨╕ ╨╛╨▒╤è╨╡╨║╤é╨░.
  21.     new_Shape.PenPattern = 1
  22.     
  23.     '╨¥╨░ ╨░╨║╤é╨╕╨▓╨╜╨╛╨╣ ╤ü╤é╤Ç╨░╨╜╨╕╤å╨╡ ╤ü╨╛╨╖╨┤╨░╨╡╤é╤ü╤Å ╨╜╨╛╨▓╤ï╨╣ ╨╛╨▒╤è╨╡╨║╤é-╤ü╨╡╨║╤é╨╛╤Ç ╨╛╨║╤Ç╤â╨╢╨╜╨╛╤ü╤é╨╕. 
  24.     '╨í╨╛╨╖╨┤╨░╨╡╤é╤ü╤Å ╨┐╨╛ ╨║╨╛╨╛╤Ç╨┤╨╕╨╜╨░╤é╨░╨╝ ╨║╨╛╨╜╤å╨╛╨▓ ╨╕ ╤é╨╛╤ç╨║╨╕ ╨╜╨░ ╨╛╨║╤Ç╤â╨╢╨╜╨╛╤ü╤é╨╕.
  25.     '╨í╤ü╤ï╨╗╨║╨░ ╨╜╨░ ╤ì╤é╨╛╤é ╨╛╨▒╤è╨╡╨║╤é ╨┐╤Ç╨╕╤ü╨▓╨░╨╕╨▓╨░╨╡╤é╤ü╤Å ╨┐╨╡╤Ç╨╡╨╝╨╡╨╜╨╜╨╛╨╣ new_Shape.
  26.     Set new_Shape = active_page.DrawSector(150, 820, 350, 820, 250, 680)
  27.     Set line_color = new_Shape.PenColor
  28.     line_color.Index = 1
  29.     new_Shape.PenWeight = 28
  30.     new_Shape.PenPattern = 1
  31.     
  32.     Set new_Shape = active_page.DrawSector(150, 1120, 350, 1120, 250, 1300)
  33.     Set line_color = new_Shape.PenColor
  34.     line_color.Index = 1
  35.     new_Shape.PenWeight = 28
  36.     new_Shape.PenPattern = 1
  37.     
  38.     '╨í╨╛╨╖╨┤╨░╨╡╨╝ ╤ê╤ì╨╣╨┐, ╨╕╨╖╨╛╨▒╤Ç╨░╨╢╨░╤Ä╤ë╨╕╨╣ ╨╗╨╕╨╜╨╕╤Ä ╤é╨╕╨┐╨░ Arc.
  39.     '╨ƒ╨╛╤ü╤é╤Ç╨╛╨╡╨╜╨╕╨╡ ╤ê╤ì╨╣╨┐╨░ ╨┐╤Ç╨╛╨╕╤ü╤à╨╛╨┤╨╕╤é ╨╝╨╡╨╢╨┤╤â ╨┤╨▓╤â╨╝╤Å ╤ä╤â╨╜╨║╤å╨╕╤Å╨╝╨╕, ╨╛╨▒╤è╤Å╨▓╨╗╤Å╤Ä╤ë╨╕╨╝╨╕ ╨╛ ╨╜╨░╤ç╨░╨╗╨╡ 
  40.     '╤ü╨╛╨╖╨┤╨░╨╜╨╕╤Å ╤ê╤ì╨╣╨┐╨░ (╨╝╨╡╤é╨╛╨┤ BeginShape ╨╛╨▒╤è╨╡╨║╤é╨░ Page) ╨╕ ╨╛ ╨╖╨░╨▓╨╡╤Ç╤ê╨╡╨╜╨╕╨╕ ╨╡╨│╨╛ ╤ü╨╛╨╖╨┤╨░╨╜╨╕╤Å
  41.     '(╨╝╨╡╤é╨╛╨┤ EndShape ╨╛╨▒╤è╨╡╨║╤é╨░ Page). ╨í╤ü╤ï╨╗╨║╨░ ╨╜╨░ ╤ü╤é╤Ç╨╛╤Å╤ë╨╕╨╣╤ü╤Å ╨╛╨▒╤è╨╡╨║╤é ╨┐╤Ç╨╕╤ü╨▓╨░╨╕╨▓╨░╨╡╤é╤ü╤Å 
  42.     '╨┐╨╡╤Ç╨╡╨╝╨╡╨╜╨╜╨╛╨╣ new_Shape.
  43.     Set new_Shape = active_page.BeginShape() 
  44.     new_Shape.PenWeight = 28
  45.     new_Shape.PenPattern = 1
  46.     '╨ƒ╨╛╨╗╤â╤ç╨░╨╡╨╝ ╤ü╤ü╤ï╨╗╨║╤â ╨╜╨░ ╨╛╨▒╤è╨╡╨║╤é Color, ╤ü╨╛╨┤╨╡╤Ç╨╢╨░╤ë╨╕╨╣ ╨╕╨╜╤ä╨╛╤Ç╨╝╨░╤å╨╕╤Ä ╨╛ ╤å╨▓╨╡╤é╨╡ ╨╗╨╕╨╜╨╕╨╕ Shap'╨░.
  47.     Set line_color = new_Shape.PenColor
  48.     '╨ú╤ü╤é╨░╨╜╨░╨▓╨╗╨╕╨▓╨░╨╡╨╝  ╤å╨▓╨╡╤é ╨╗╨╕╨╜╨╕╨╕ ╨╛╨▒╤è╨╡╨║╤é╨░ ╨╕╤ü╨┐╨╛╨╗╤î╨╖╤â╤Å RGB ╨┐╤Ç╨╡╨┤╤ü╤é╨░╨▓╨╗╨╡╨╜╨╕╨╡ ╤å╨▓╨╡╤é╨░.
  49.     '╨ú╤ü╤é╨░╨╜╨░╨▓╨╗╨╕╨▓╨░╨╡╨╝ ╤ü╨▓╨╛╨╣╤ü╤é╨▓╨░ ╨┤╨╗╤Å ╨║╨░╨╢╨┤╨╛╨╣ ╤ü╨╛╤ü╤é╨░╨▓╨╗╤Å╤Ä╤ë╨╡╨╣ RGB (Red, Green and Blue ) ╨╛╤é╨┤╨╡╨╗╤î╨╜╨╛.
  50.     line_color.Red = 255
  51.     line_color.Green = 127
  52.     line_color.Blue = 0
  53.     '╨ù╨░╨┤╨░╨╡╨╡╨╝ ╨║╨╛╨╛╤Ç╨┤╨╕╨╜╨░╤é╤ï ╨╜╨░╤ç╨░╨╗╨░ ╨╛╨▒╤è╨╡╨║╤é╨░
  54.     active_page.MoveTo(810, 710)
  55.     '╨₧╤é ╤é╨╡╨║╤â╤ë╨╡╨╣ ╤é╨╛╤ç╨║╨╕, ╨╖╨░╨┤╨░╨╜╨╜╨╛╨╣ ╨╝╨╡╤é╨╛╨┤╨╛╨╝ MoveTo, ╤ü╤é╤Ç╨╛╨╕╨╝ Arc ╨┐╨╛ ╨║╨╛╨╛╤Ç╨┤╨╕╨╜╨░╤é╨░╨╝ ╨║╨╛╨╜╤å╨░
  56.     '╨╕ ╤é╨╛╤ç╨║╨╕, ╨╗╨╡╨╢╨░╤ë╨╡╨╣ ╨╜╨░ Arc.    
  57.     active_page.ArcTo(810, 1260, 460, 985)
  58.     active_page.EndShape()
  59.  
  60.     Set new_Shape = active_page.DrawLine(810,660,810,1310)
  61.     Set line_color = new_Shape.PenColor
  62.     '╨ú╤ü╤é╨░╨╜╨░╨▓╨╗╨╕╨▓╨░╨╡╨╝  ╤å╨▓╨╡╤é ╨╗╨╕╨╜╨╕╨╕ ╨╛╨▒╤è╨╡╨║╤é╨░ ╨╕╤ü╨┐╨╛╨╗╤î╨╖╤â╤Å RGB ╨┐╤Ç╨╡╨┤╤ü╤é╨░╨▓╨╗╨╡╨╜╨╕╨╡ ╤å╨▓╨╡╤é╨░.
  63.     '╨ú╤ü╤é╨░╨╜╨░╨▓╨╗╨╕╨▓╨░╨╡╨╝ ╤ü╨▓╨╛╨╣╤ü╤é╨▓╨░ ╨┤╨╗╤Å ╨▓╤ü╨╡╤à ╤ü╨╛╤ü╤é╨░╨▓╨╗╤Å╤Ä╤ë╨╕╤à RGB ╨╛╨┤╨╜╨╛╨▓╤Ç╨╡╨╝╨╡╨╜╨╜╨╛.
  64.     line_color.SetRGB(255,127,0)
  65.     new_Shape.PenWeight = 28
  66.     new_Shape.PenPattern = 1
  67.     
  68.     Set new_Shape = active_page.DrawLine(900,670,900,1310)
  69.     Set line_color = new_Shape.PenColor
  70.     line_color.SetRGB(255,191,0)
  71.     new_Shape.PenWeight = 28
  72.     new_Shape.PenPattern = 1
  73.     
  74.     Set new_Shape = active_page.DrawLine(1200,820,1200,1310)
  75.     Set line_color = new_Shape.PenColor
  76.     line_color.Index = 2
  77.     new_Shape.PenWeight = 28
  78.     new_Shape.PenPattern = 1
  79.     
  80.     Set new_Shape = active_page.DrawLine(1500,820,1500,1310)
  81.     Set line_color = new_Shape.PenColor
  82.     line_color.Index = 2
  83.     new_Shape.PenWeight = 28
  84.     new_Shape.PenPattern = 1
  85.     
  86.     Set new_Shape = active_page.DrawSector(900, 820, 1200, 820, 1050, 680)
  87.     Set line_color = new_Shape.PenColor
  88.     line_color.SetRGB(255,191,0)
  89.     new_Shape.PenWeight = 28
  90.     new_Shape.PenPattern = 1
  91.     
  92.     Set new_Shape = active_page.DrawSector(1200, 820, 1500, 820, 1350, 680)
  93.     Set line_color = new_Shape.PenColor
  94.     line_color.Index = 2
  95.     new_Shape.PenWeight = 28
  96.     new_Shape.PenPattern = 1
  97.     
  98.     Set new_Shape = active_page.DrawLine(1600,650,1600,1500)
  99.     Set line_color = new_Shape.PenColor
  100.     line_color.SetRGB(192,220,192)
  101.     new_Shape.PenWeight = 28
  102.     new_Shape.PenPattern = 1
  103.     
  104.     Set new_Shape = active_page.BeginShape() 
  105.     new_Shape.PenWeight = 28
  106.     new_Shape.PenPattern = 1
  107.     Set line_color = new_Shape.PenColor
  108.     line_color.SetRGB(192,220,192)
  109.     active_page.MoveTo(1600, 700)    
  110.     active_page.ArcTo(1600, 1250, 1900, 975)
  111.     active_page.EndShape()
  112.  
  113.     Set new_Shape = active_page.DrawLine(2000,380,2000,1310)
  114.     Set line_color = new_Shape.PenColor
  115.     line_color.SetRGB(32,255,255)
  116.     new_Shape.PenWeight = 28
  117.     '╨ú╤ü╤é╨░╨╜╨░╨▓╨╗╨╕╨▓╨░╨╡╨╝ Pattern ╨╗╨╕╨╜╨╕╨╕ ╨╛╨▒╤è╨╡╨║╤é╨░. ╨Æ╤ï╨▒╨╕╤Ç╨░╨╡╨╝ ╨╛╨┤╨╜╤â ╨╕╨╖ ╨┐╤â╨╜╨║╤é╨╕╤Ç╨╜╤ï╤à ╨╗╨╕╨╜╨╕╨╣.
  118.     new_Shape.PenPattern = 10
  119.     
  120.     Set new_Shape = active_page.DrawSector(2666, 1220, 2766, 900, 2117, 900)
  121.     Set line_color = new_Shape.PenColor
  122.     line_color.Index = 120
  123.     new_Shape.PenWeight = 28
  124.     new_Shape.PenPattern = 1
  125.     
  126.     Set new_Shape = active_page.DrawLine(2766, 900, 2117, 900)
  127.     Set line_color = new_Shape.PenColor
  128.     line_color.Index = 120
  129.     new_Shape.PenWeight = 28
  130.     new_Shape.PenPattern = 1    
  131. End Sub