Quartz OpenGL ES 注 3 注 4 図 2 注 5 3 3D OpenGL ES Quartz Quartz Jun

Size: px
Start display at page:

Download "Quartz OpenGL ES 注 3 注 4 図 2 注 5 3 3D 4 5 2 OpenGL ES Quartz Quartz Jun. 2011-135"

Transcription

1 iphone Quartz ios ios YOSHIDA Yuuichi 注 1 注 2 図 1 1 ios Objective-C 2 Google 1 Map Kit 3 Cocoa Touch Software Design

2 Quartz OpenGL ES 注 3 注 4 図 2 注 5 3 3D OpenGL ES Quartz Quartz Jun

3 3 4 1 UIView drawrect - (void)drawrect:(cgrect)rect { // レンダリングコードをここに 書 く 5 Quartz 2 drawrect - (void)drawrect:(cgrect)rect { // レンダリングコードをここに 書 く CGContextSetRGBFillColor(context, 0.0, 1.0, 0.0, 1.0); CGContextFillRect(context, CGRectMake(10, 10, 100, 100)); 3 CGContextMoveToPoint(context, 10, 10); CGContextAddLineToPoint(context, 20, 10); CGContextAddLineToPoint(context, 20, 20); CGContextAddLineToPoint(context, 10, 20); CGContextAddLineToPoint(context, 10, 10); CGContextDrawPath(context, kcgpathstroke); 図 3 Quartz 図 4 Quartz リスト1 リスト2 注 6 図 5 6 Quartz 2D Programming Guide a p p l e. c o m / l i b r a r y / m a c / # d o c u m e n t a t i o n / graphicsimaging/conceptual/drawingwithquartz2d/ Introduction/Introduction.html Software Design

4 Quartz リスト 3 リスト4 4 - (void)drawroundcornerrect:(cgrect)rect mode:(cgpathdrawingmode)mode radius:(float) radius { 5 - (void)drawrectwithshadow { CGFloat minx = CGRectGetMinX(rect); CGFloat midx = CGRectGetMidX(rect); CGFloat maxx = CGRectGetMaxX(rect); CGFloat miny = CGRectGetMinY(rect); CGFloat midy = CGRectGetMidY(rect); CGFloat maxy = CGRectGetMaxY(rect); CGContextMoveToPoint(context, minx, midy); CGContextAddArcToPoint(context, minx, miny, midx, miny, radius); CGContextAddArcToPoint(context, maxx, miny, maxx, midy, radius); CGContextAddArcToPoint(context, maxx, maxy, midx, maxy, radius); CGContextAddArcToPoint(context, minx, maxy, minx, midy, radius); CGContextDrawPath(context, mode); // 影 を 付 ける 前 の 状 態 を 保 存 する CGContextSaveGState(context); UIColor *blackcolor = [UIColor blackcolor]; CGContextSetShadowWithColor(context, CGSizeMake(0, 1), 2.0, [blackcolor CGColor]); CGContextSetRGBFillColor(context, 0.0, 1.0, 0.0, 1.0); CGContextFillRect(context, CGRectMake(10, 10, 100, 100)); // 影 を 付 ける 前 の 状 態 を 復 帰 する CGContextRestoreGState(context); // 他 のオブジェクトをここで 描 画 する 6 図 6 リスト5 注 7 7 OpenGL glpushmatrix glpopmatrix Jun

5 6 - (void)testclipping { CGContextSaveGState(context); CGContextAddArc(context, 100, 100, 30, 0, 360, 0); CGContextClip(context); UIColor *greencolor = [UIColor greencolor]; CGContextSetFillColorWithColor(context, [greencolor CGColor]); CGContextFillRect(context, CGRectMake(100, 100, 50, 50)); CGContextRestoreGState(context); 7 CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB(); CGFloat colors[] = { / 255.0, / 255.0, / 255.0, 1.0, 70.0 / 255.0, 70.0 / 255.0, 70.0 / 255.0, 1.0, ; CGGradientRef gradient = CGGradientCreateWithColorComponents( space, colors, NULL, sizeof(colors)/(sizeof(colors[0])*4)); CGColorSpaceRelease(space); 7 図 7 リスト 6 リスト7 リスト8 リスト Software Design

6 Quartz 図 8 注 8 NSString *str world."; [str drawatpoint:cgpointmake(10, 10) withfont:[uifont boldsystemfontofsize:12]]; リスト10 図 9 8 h t t p : / / d e v e l o p e r. a p p l e. c o m / l i b r a r y / ios/#documentation/uikit/reference/nsstring_ UIKit_Additions/Reference/Reference.html (void)drawgradientcolor { CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB(); CGFloat colors[] = { / 255.0, / 255.0, / 255.0, 1.0, 70.0 / 255.0, 70.0 / 255.0, 70.0 / 255.0, 1.0, ; CGGradientRef gradient = CGGradientCreateWithColorComponents( space, colors, NULL, sizeof(colors)/(sizeof(colors[0])*4)); CGColorSpaceRelease(space); CGContextDrawLinearGradient( context, gradient, CGPointMake(100, 100), CGPointMake(100, 200), kcggradientdrawsbeforestartlocation kcggradientdrawsafterendlocation); CGGradientRelease(gradient); 9 - (void)drawgradientrhombus { CGColorSpaceRef space = CGColorSpaceCreateDeviceRGB(); CGFloat colors[] = { / 255.0, / 255.0, / 255.0, 1.0, 20.0 / 255.0, 20.0 / 255.0, 20.0 / 255.0, 1.0, ; CGGradientRef gradient = CGGradientCreateWithColorComponents( space, colors, NULL, sizeof(colors)/(sizeof(colors[0])*4)); CGColorSpaceRelease(space); CGContextSaveGState(context); CGContextMoveToPoint(context, 160,160); CGContextAddLineToPoint(context, 240, 240); CGContextAddLineToPoint(context, 160, 320); CGContextAddLineToPoint(context, 80, 240); CGContextAddLineToPoint(context, 160, 160); CGContextClip(context); CGContextDrawLinearGradient( context, gradient, CGPointMake(160, 160), CGPointMake(160, 320), kcggradientdrawsbeforestartlocation kcggradientdrawsafterendlocation); CGGradientRelease(gradient); CGContextRestoreGState(context); Jun

7 (void)layoutanddrawtext { // 引 数 CGPoint p = CGPointMake(30, 30); float width = 200; float height = 480; float fontsize = 20; NSString *str world. Do you like ios programming? " " 初 めまして!iOSプログラミングはお 好 きですか?"; UIColor *yellow = [UIColor yellowcolor]; UIColor *black = [UIColor blackcolor]; UIFont *font = [UIFont boldsystemfontofsize:fontsize]; // 文 字 列 のサイズ CGSize strsize = [str sizewithfont:font constrainedtosize:cgsizemake(width,height) linebreakmode:uilinebreakmodecharacterwrap]; CGRect renderingrect; renderingrect.origin = p; renderingrect.size = strsize; // 背 景 色 のレンダリング [yellow setfill]; CGContextFillRect(context, renderingrect); // 文 字 列 のレンダリング [black setfill]; [str drawinrect:renderingrect withfont:font linebreakmode:uilinebreakmodecharacterwrap]; - (void)set; - (void)setfill; - (void)setstroke; 注 9 注 10 注 11 Quartz 9 QuartzDemo/Introduction/Intro.html 10 David Gelphman Bunny Laden Morgan Kaufmann 2005 ISBN ios 22tch ios API ios SDK HACKS ISBN Software Design

Microsoft Word - iPhone_finalv3.doc

Microsoft Word - iPhone_finalv3.doc 1 Apple iphone, iphone,, GPS,, Apple iphone SDK. 5 ipad, 6 OS ios 4.0 ios4.0, API, API, iphone/ipad iphone/ipad., iphone/ipad,, Hello, World!,, iphone. 2 iphone SDK iphonesdk iphone SDK 4 ( 1) API Core

More information

AirPrintPublic

AirPrintPublic Printing on ios 4.2 Yutaka Yasuda, Kyoto Sangyo University AirPrint iphone / ipad Safari ios 4.2 2011 3 HP eprint ASCII.jp x MacPeople OS X AirPrint -- Apple Geeks 19 http://ascii.jp/elem/000/000/575/575397/

More information

170403_1_FABEX_2017会場案内マップ

170403_1_FABEX_2017会場案内マップ OFFICIAL GUIDE MAP 07 4 4 34 000700 3 0 7 J a p a n M e a t I n d u s t r y F a i r 4 t h 4/3 4/4 4/ 4/34 4/3 4/4 4/4 4/4 4/4 4/4 4/4 4/3 4/4 4/3 4/4 4/ 4/4 4/4 4/4 P-0 4 3 4 4 :0 3:0 3:40 4:30 4:50 5:40

More information

-----------------------------------------------------------------------------------------1 --------------------------------------------------------------------------------------1 -------------------------------------------------------------------------------------1

More information

›¼’à”v“lŠÍ1−ª

›¼’à”v“lŠÍ1−ª 3 1 1 2 3 4 5 6 7 8 8 10 12 14 16 18 20 22 24 2 1 2 3 4 5 6 7 8 9 10 11 12 26 28 30 32 34 36 38 40 42 44 46 48 50 4 3 1 2 3 4 5 52 54 56 58 60 6 62 7 8 9 10 64 66 68 70 72 5 1 1 4 2 5 6 6 7 1 8 1 9 2 10

More information

1 2 3 4 1 2 3 4 1 2 3 4 12 3 4

1 2 3 4 1 2 3 4 1 2 3 4 12 3 4 1 2 3 4 5 6 1 2 3 4 5 6 1 2 1 2 1 2 1 2 1 2 3 4 12 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 1 2 3 4 12 3 4 1 2 3 4 5 6 7 8 1 2 3 46 7 1 2 3 4 5 6 7 1 2 3 4 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 16 7 8 92 3 46 7 :

More information

- 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 2-12 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 1 - 2 - 3 6 1 1-4 - 5 - 6 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 130 3 130 5 2 50 1.5 48 59 62 63-9 - 1 - 2 - 3 () - 4 - 5 -

More information

S1460...........\1.E4

S1460...........\1.E4 3 4 3 4 5 3 4 5 3 4 3 4 3 3 3 3 4 3 4 3 3 4 4 3 3 3 3 4 3 4 3 3 3 3 3 3 4 3 4 3 4 5 4 3 5 4 3 3 4 5 3 4 5 4 3 4 3 3 4 3 4 3 3 3 3 3 4 3 3 4! "! " " 0 6 ! " 3 4 3 3 4 3 ! " 3 3 4 5 4 5 6 3 3

More information

1 105 2 4 50 3 ISBN 4 25 2013 1 ISBN 5 128p ISBN978-4-8340-0013-9 ISBN 2

1 105 2 4 50 3 ISBN 4 25 2013 1 ISBN 5 128p ISBN978-4-8340-0013-9 ISBN 2 1 2 39 3 14 13 16 17 36 21 30 32 1 1 105 2 4 50 3 ISBN 4 25 2013 1 ISBN 5 128p ISBN978-4-8340-0013-9 ISBN 2 39 32p ISBN978-4-251-00517-5 62p ISBN978-4-00-110579-7 1 33p ISBN978-4-477-01141-7 3 32p ISBN978-4-591-01270-3

More information

(()) () ( ) () () () () () () ( ) () () () () () () () () () () () () ( ) () ( ) () () () ( ) () () () () () ( ) () () () () ( ) () ( ) () () ( ) () ( ) () () () () () () () () () () () () () () () ()

More information

496

496 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 ISBN4-258-17041-0

More information

() () () () ( ) () () () () () () () () () () () () () () () () () () () () () () ( () () () () () () () () () () () () ) () ( ) () () ( ) () () () () () () () () () () () () () () () () () () () ()()

More information

ISBN 0 00 00 00 0 0 ISBN 0 0 ISBN---.000-0

ISBN 0 00 00 00 0 0 ISBN 0 0 ISBN---.000-0 ISBN 0 00 00 00 0 0 ISBN 0 0 ISBN---.000-0 0 ISBN 0 00 00 00 0 0 ISBN 0 0 ISBN---.000-0 ISBN 0 00 00 00 0 0 ISBN 0 0 ISBN---.000-0 ISBN 0 00 00 00 0 0 ISBN 0 0 ISBN---.000-0 ISBN 0 00 00 00 0 0 ISBN 0

More information

0 00 000 000 ISBN 0 0 0 ISBN 0 0 0 ISBN---.00-

0 00 000 000 ISBN 0 0 0 ISBN 0 0 0 ISBN---.00- 0 0 0 --- -0--0-- 00 0 00-0 0 0 0 0 000-00- 0 00 000 000 ISBN 0 0 0 ISBN 0 0 0 ISBN---.00- 0 00 000 000 ISBN 0 0 0 ISBN 0 0 0 ISBN---.00- ISBN 0 0 0 ISBN 0 0 0 0 00 000 000 ISBN---.00- 0 00 000 000 ISBN

More information

2015-s6-4g-pocket-guidebook_H1-4.indd

2015-s6-4g-pocket-guidebook_H1-4.indd 56C504-01 2 47 47 32 3435 35 2124 26 26 26 424343 434446 4646 12 14 16 18 20 4 28 30 31 36 37 38 42 47 48 49 4 4 4 3 4 5 16 16 6 6 18 18 32 32 30 30 7 20 20 8 9 28 31 10 Do you have a? 36 Do you have

More information

index View Controller

index View Controller Creative Application Summer Camp Kengo Part - lesson 2 2011/08/26 index View Controller summer 2.1 View View (1) View View = View UIView View UIView (ex. ) UIView ( ) (, ) (c) / View (2) View 1. View 2.

More information

O1-1 O1-2 O1-3 O1-4 O3-1 O3-2 O3-3 O3-4 ES1-1 ES1-2 ES1-3 ES2-1 ES2-2 ES2-3 ES2-4 O2-1 O2-2 O2-3 O2-4 O2-5 O4-1 O4-2 O4-3 O4-4 O5-1 O5-2 O5-3 O5-4 O7-1 O7-2 O7-3 O7-4 O9-1 O9-2 O9-3 O9-4 O12-1 O12-2

More information

iOSにおける描画と印刷のガイド (TP )

iOSにおける描画と印刷のガイド (TP ) ios における 描画と印刷のガイド 目次 ios での描画と印刷 7 初めに 8 カスタム UI ビューを導入すれば描画の自由度が高まる 8 アプリケーションはオフスクリーンビットマップや PDF に描画できる 10 印刷に関する一連のオプション 10 高解像度画面対応への変更は容易 11 関連項目 11 ios における描画の考え方 12 UIKit のグラフィックスシステム 12 ビューの描画サイクル

More information

endo.PDF

endo.PDF MAP 18 19 20 21 3 1173 MAP 22 700800 106 3000 23 24 59 1984 358 358 399 25 12 8 1996 3 39 24 20 10 1998 9,000 1,400 5,200 250 12 26 4 1996 156 1.3 1990 27 28 29 8 606 290 250 30 11 24 8 1779 31 22 42 9

More information

caim04

caim04 CAIM03ImageToolBox.swiftCAIM04_1ImageToolBox.swift Command+A() Command+C() CAIM04_1ImageToolBox.swift Command+V( ImageToolBox.fillCircle import Foundation // class ImageToolBox { ) // () static func fillcircle(_

More information

JavaScriptCore

JavaScriptCore http://kishikawakatsumi.com Twitter @k_katsumi 24/7 twenty-four seven http://d.hatena.ne.jp/kishikawakatsumi/ JSContext *context = [[JSContext alloc] init]; JSValue *result = [context evaluatescript:@"2

More information

†ı25”Y„o-PDF.ren

†ı25”Y„o-PDF.ren 12,000 10,000 8,000 6,000 4,000 2,000 0 1998 1999 2000 2001 2002 2003 2004 1,200 1,000 800 600 400 200 0 1998 1999 2000 2001 2002 2003 2004 $ "! ''" '' ''$ ''% ''& '''! " ' & % $ "! ''" ' '$ '% '& ''!

More information

76

76 ! # % & % & %& %& " $ 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 % & &! & $ & " & $ & # & ' 91 92 $ % $'%! %(% " %(% # &)% & 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 !$!$ "% "%

More information

第4回報告書.PDF

第4回報告書.PDF 7 8 () 13001630 / - 3 - 6 10 () 13001630 2. 3. 6 18 ()13001630 6 24 () 13001630 21 7 8 () 13001630 / 7 22 () 13001630 8 12 () 13001630 Context - 4 - 8 26 ()13001630 7 9 9 ()13001630 21 9 24 13001630 10

More information

HCI プログラミング 5 回目ウィンドウに画像を表示してみよう 今日の講義で学ぶ内容 画像の表示 画像のエフェクト 画像のビューポート指定 画像の表示 1 画像を表示してみましょう 画像の表示はクラス ImageView により管理されます ソースファイル名 :Sample5_1.java //

HCI プログラミング 5 回目ウィンドウに画像を表示してみよう 今日の講義で学ぶ内容 画像の表示 画像のエフェクト 画像のビューポート指定 画像の表示 1 画像を表示してみましょう 画像の表示はクラス ImageView により管理されます ソースファイル名 :Sample5_1.java // HCI プログラミング 5 回目ウィンドウに画像を表示してみよう 今日の講義で学ぶ内容 画像の表示 画像のエフェクト 画像のビューポート指定 画像の表示 1 画像を表示してみましょう 画像の表示はクラス ImageView により管理されます ソースファイル名 :Sample5_1.java // 画像の表示 public class Sample5_1 extends Application //

More information

JavaScript演習

JavaScript演習 JavaScript 入 門 1 JavaScript( 言 語 )とは 情 報 システムのプログラミング ソースコード 記 述, 外 部 ファイル 保 存, コンパイル,テスト,デバッグ... 大 変 な 作 業 もっと 手 軽 なプログラミング 特 別 な 言 語 処 理 系 は 不 要! Webブラウザだけで 実 行 可 能 ( 実 際 は,HTMLファイル 内 or 外 部 ファイル として

More information

WebGL OpenGL GLSL Kageyama (Kobe Univ.) Visualization / 57

WebGL OpenGL GLSL Kageyama (Kobe Univ.) Visualization / 57 WebGL 2014.04.15 X021 2014 3 1F Kageyama (Kobe Univ.) Visualization 2014.04.15 1 / 57 WebGL OpenGL GLSL Kageyama (Kobe Univ.) Visualization 2014.04.15 2 / 57 WebGL Kageyama (Kobe Univ.) Visualization 2014.04.15

More information

caim03

caim03 ImageToolBox.swift fillrect fillcolor x1,y1,x2,y2 static func fillrect(_ img:caimimage, x1:int, y1:int, x2:int, y2:int, color:caimcolor) { // let mat = img.matrix // let wid = img.width // let hgt = img.height

More information

caim03

caim03 ImageToolBox.swift fillrect fillcolor x1,y1,x2,y2 static func fillrect(_ img:caimimage, x1:int, y1:int, x2:int, y2:int, color:caimcolor) { // let mat = img.matrix // let wid = img.width // let hgt = img.height

More information

第三学年  総合的な学習の指導案(国際理解・英語活動)

第三学年  総合的な学習の指導案(国際理解・英語活動) NAT NAT NAT NAT NAT NAT All English NAT 20 One One One One One Show Time Silent Night Are You Sleeping? NAT NAT NAT NAT NAT What color do you like? ( NA ( ) Good afternoon, boys & girls. Good afternoon,

More information

SSKP

SSKP 1977 12 3 3 18 123567 21 2 11 SSKP 4053 SSKP No.60 1 1977 12 3 3 18 123567 21 2 11 SSKP 4053 12 10 44 37 21 16 2 1977 12 3 3 18 123567 21 2 11 SSKP 4053 44 39 12 3 1977 12 3 3 18 123567 21 2 11 SSKP 4053

More information

OpenGL GLSL References Kageyama (Kobe Univ.) Visualization / 58

OpenGL GLSL References Kageyama (Kobe Univ.) Visualization / 58 WebGL *1 2013.04.23 *1 X021 2013 LR301 Kageyama (Kobe Univ.) Visualization 2013.04.23 1 / 58 OpenGL GLSL References Kageyama (Kobe Univ.) Visualization 2013.04.23 2 / 58 Kageyama (Kobe Univ.) Visualization

More information

1 1 2 Unix 1 3 4 4 SVG 6 4.1 SVG................................... 6 4.2 SVG......................... 6 4.3 SVG.............................. 7 4.4..

1 1 2 Unix 1 3 4 4 SVG 6 4.1 SVG................................... 6 4.2 SVG......................... 6 4.3 SVG.............................. 7 4.4.. WWW 17 2 10 1 1 2 Unix 1 3 4 4 SVG 6 4.1 SVG................................... 6 4.2 SVG......................... 6 4.3 SVG.............................. 7 4.4................................. 8 4.5...........................

More information

CocoaDrawingGuide

CocoaDrawingGuide 基本的な描画エレメント 複雑に見えるグラフィックスももともとは単純な要素から始まっています Cocoaでは全ての描画の基礎に なる基本的なエレメントが提供されており これを組み合わせたり変形したりすることによってどんな複雑 な描画を実現できるようになっています ここではそれら基本的なエレメントについて解説します ジオメトリ サポート Cocoaでは 点や四角形など 基本的な幾何学図形を扱うために独自のデータ型

More information

橡Taro9-生徒の活動.PDF

橡Taro9-生徒の活動.PDF 3 1 4 1 20 30 2 2 3-1- 1 2-2- -3- 18 1200 1 4-4- -5- 15 5 25 5-6- 1 4 2 1 10 20 2 3-7- 1 2 3 150 431 338-8- 2 3 100 4 5 6 7 1-9- 1291-10 - -11 - 10 1 35 2 3 1866 68 4 1871 1873 5 6-12 - 1 2 3 4 1 4-13

More information

27短01研01斉藤.indd

27短01研01斉藤.indd WordPress を用いたホームページ作成 Making a homepage using the WordPress 斎藤敏之 Toshiyuki SAITOH キーワード 1. はじめに WordPress WordPress PC PC WordPress HTML CSS HTML CSS WordPress 2.HTMLとCSSの基礎 HTML CSS World Wide Web Consortium

More information

79!! 21

79!! 21 79!! 21 94 94 138 94 8 15 1 100 10 25 65 138 30 94 1 138 94 !! 1570 km 1.5 79 7 12 138 11 72 11 72 15 11 72 11 72 11 15 11 72 15 12 138 11 72 12 21 12 94 12 21 12 12 94 12 138 12 138 11 79 12 12 138

More information

2

2 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 2 3 01 02 03 4 04 05 06 5 07 08 09 6 10 11 12 7 13 14 15 8 16 17 18 9 19 20 21 10 22 23 24 11 FIELD MAP 12 13 http://www.pref.ishikawa.jp/shinrin/zei/index.html

More information

Microsoft Word - hozon-fujimura-HP-伊勢工業高校における造船教育の歴史から学ぶ20160713

Microsoft Word - hozon-fujimura-HP-伊勢工業高校における造船教育の歴史から学ぶ20160713 1233 1 600 300 1578 1636 1800 Google 2 3 1853 1854 2000 1842 1848 300 1800 4 300 800 5 6 7 8 9 10 14 6 2 4 3 1 2 1 13 3 3 3 1 3 3 1 1 1 10 1 14 14 2 23 3 136 1 72 1 6 1 22 2 236 12 236 11 10% 7% 16% 17%

More information