Example: /MacCG/CG Ovals

Online Documentation   -   Statistics   -   FAQ   -   Plugin Parts (All, Dependencies)   -   Class hierarchy

New in Version 22.2 22.3 22.4 22.5 23.0 23.1 23.2 23.3 23.4 23.5 24.0 24.1

The list of the   topics,   classes,   interfaces,   controls,   modules,   global methods by category,   global methods by name,   screenshots,   licenses   and   examples.

Platforms to show: All Mac Windows Linux Cross-Platform

/MacCG/CG Ovals


Required plugins for this example: MBS MacCG Plugin, MBS MacCF Plugin

You find this example project in your Plugins Download as a Xojo project file within the examples folder: /MacCG/CG Ovals

This example is the version from Sun, 17th Mar 2012.

Project "CG Ovals.xojo_binary_project"
FileTypes
Filetype text
End FileTypes
Class Window1 Inherits Window
EventHandler Sub Paint(g As Graphics) dim c as CGContextMBS dim center as CGPointMBS center=CGMakePointMBS(g.Width/2,g.Height/2) c=me.CGContextMBS c.BeginPath c.SetRGBFillColor 1,0,0,0.5 c.AddOval center, 100,150 c.FillPath c.BeginPath c.SetRGBFillColor 0,0,1,0.5 c.AddOval center, 100,50 c.FillPath c.Flush End EventHandler
End Class
MenuBar MenuBar1
MenuItem UntitledMenu1 = ""
MenuItem FileMenu = "&File"
MenuItem FileQuit = "Quit"
MenuItem EditMenu = "&Edit"
MenuItem EditUndo = "&Undo"
MenuItem UntitledMenu0 = "-"
MenuItem EditCut = "Cu&t"
MenuItem EditCopy = "&Copy"
MenuItem EditPaste = "&Paste"
MenuItem EditClear = "Clear"
End MenuBar
Class App Inherits Application
End Class
Module Util
Sub AddOval(extends c as CGContextMBS, center as CGPOintMBS, a as single, b as single) dim pi as single pi=ACos(0)*2.0 c.SaveGState c.TranslateCTM center.x, center.y c.ScaleCTM a,b c.MoveToPoint 1,0 c.AddArc 0, 0, 1, 0.0, 2*pi, false c.ClosePath c.RestoreGState End Sub
End Module
End Project

See also:

The items on this page are in the following plugins: MBS MacCG Plugin.


💬 Ask a question or report a problem