The document discusses the basic components of drawing in Android - Bitmap, Canvas, Drawing Primitives, and Paint. It provides examples of how to use the Canvas class to draw different primitives like points, lines, rectangles, arcs, and paths using a Paint object. It also demonstrates how to draw text, bitmaps and configure properties of the Paint like color, stroke and style.
This document discusses two methods for adding shadows to objects in 3D scenes - shadows as textures and creating shadows with a shadow buffer. The shadows as textures method works for point light sources casting shadows on flat surfaces by "painting" the shadows as textures, but requires computing the shape of each shadow. The shadow buffer method performs hidden surface removal by marking in a buffer any points hidden from the light source, then rendering the scene in two passes - first loading the shadow buffer and then rendering using the buffer values to determine shading.
Android Lollipop was released with new Camera2 APIs. This talk was delivered at the Samsung Developer's Conference 2014 showing how to use it and how it enables new use cases
Este documento resume la vida y obra del pintor español Pablo Ruiz Picasso. Nació en 1881 en Málaga y se convirtió en uno de los artistas más importantes del siglo XX. Pasó por varios periodos artísticos como el Azul, Rosa y Cubismo, donde desarrolló nuevas técnicas como el collage. También exploró la escultura cubista. Obras maestras incluyen Las señoritas de Avignon y el Guernica, pintado sobre el bombardeo de Guernica durante la Guerra Civil Española. Picasso
The document discusses HTML canvas and how to draw graphics on a canvas using JavaScript. It covers how to create a canvas element, get the rendering context, and use various drawing methods like fillRect(), strokeRect(), beginPath(), moveTo(), lineTo(), bezierCurveTo(), quadraticCurveTo() etc. to draw shapes, paths, images and text. It also discusses how to apply colors, gradients, patterns and shadows. The canvas state can be saved and restored using save() and restore() methods. Translations and rotations can be applied using translate() and rotate() methods.
This document discusses HTML canvas drawing and animation. It covers topics like getting a canvas reference, the canvas API, drawing shapes and text, applying transformations, using paths, gradients and patterns, handling events, and animating canvas content using requestAnimationFrame. The document provides details on various canvas methods, properties, and techniques for 2D drawing and basic animation.
This document discusses two methods for adding shadows to objects in 3D scenes - shadows as textures and creating shadows with a shadow buffer. The shadows as textures method works for point light sources casting shadows on flat surfaces by "painting" the shadows as textures, but requires computing the shape of each shadow. The shadow buffer method performs hidden surface removal by marking in a buffer any points hidden from the light source, then rendering the scene in two passes - first loading the shadow buffer and then rendering using the buffer values to determine shading.
Android Lollipop was released with new Camera2 APIs. This talk was delivered at the Samsung Developer's Conference 2014 showing how to use it and how it enables new use cases
Este documento resume la vida y obra del pintor español Pablo Ruiz Picasso. Nació en 1881 en Málaga y se convirtió en uno de los artistas más importantes del siglo XX. Pasó por varios periodos artísticos como el Azul, Rosa y Cubismo, donde desarrolló nuevas técnicas como el collage. También exploró la escultura cubista. Obras maestras incluyen Las señoritas de Avignon y el Guernica, pintado sobre el bombardeo de Guernica durante la Guerra Civil Española. Picasso
The document discusses HTML canvas and how to draw graphics on a canvas using JavaScript. It covers how to create a canvas element, get the rendering context, and use various drawing methods like fillRect(), strokeRect(), beginPath(), moveTo(), lineTo(), bezierCurveTo(), quadraticCurveTo() etc. to draw shapes, paths, images and text. It also discusses how to apply colors, gradients, patterns and shadows. The canvas state can be saved and restored using save() and restore() methods. Translations and rotations can be applied using translate() and rotate() methods.
This document discusses HTML canvas drawing and animation. It covers topics like getting a canvas reference, the canvas API, drawing shapes and text, applying transformations, using paths, gradients and patterns, handling events, and animating canvas content using requestAnimationFrame. The document provides details on various canvas methods, properties, and techniques for 2D drawing and basic animation.
The document compares and contrasts the Canvas and SVG elements in HTML. Canvas uses JavaScript to draw graphics via code and is rendered pixel by pixel, while SVG uses XML to draw graphics as scalable vector shapes. Canvas is better for games, charts, and advertising due to its faster rendering, while SVG is better for icons, logos, and charts due to its scalability and support for event handlers. Several common drawing methods like rectangles, circles, paths, and text are demonstrated for both Canvas and SVG.
This document provides guidance on custom charting in Android by breaking down the drawing process into layers. It discusses using a Canvas and Paint objects to draw primitives like rectangles, circles, and text. Key aspects covered include calculating marker positions, drawing gradients, guidelines, lines between markers, week labels, and scales. The document encourages learning the main Canvas and Paint APIs and breaking complex views into separate drawing functions for each layer.
The document discusses the HTML5 <canvas> element and 2D Canvas API. It provides details on:
- Creating a canvas element with an id, width, and height
- Getting a 2D drawing context object
- Common drawing methods like lineTo(), arc(), fillText(), strokeRect(), and clearRect()
- Setting properties like fillStyle, strokeStyle, and globalCompositeOperation
- Drawing shapes, images, and text
- Applying transformations with methods like translate(), rotate(), and save()/restore()
- Using requestAnimationFrame() for basic animation
The document provides an overview of the canvas element and its capabilities for 2D drawing and basic animation using JavaScript.
This document provides an introduction to HTML5 Canvas and describes some of its key drawing capabilities. It explains that the <canvas> element is used to draw graphics via scripting, usually with JavaScript. It then outlines several methods for drawing paths, boxes, circles, text, and images on the canvas. It also discusses using gradients, setting the coordinate system, and interacting with canvas elements through events.
The document discusses various methods for creating graphics and animation in .NET applications, including using the Graphics object to draw shapes, lines and filled areas; creating simple animation by changing or moving images over time; using the Timer component to automate animation; and incorporating drag-and-drop functionality.
The document discusses the user interface capabilities in MIDP, including custom items which allow custom rendering and input handling, and the canvas API which provides low-level graphics and event handling capabilities. It describes the key methods and features of custom items and the canvas, such as painting, sizing, and handling input events from touchscreens and keyboards. Examples are provided and future topics are outlined.
The document discusses the canvas drawing API in HTML5. It describes the canvas coordinate system, which differs from the standard Cartesian system used in math. Angles are measured clockwise from the positive x-axis. The canvas context object provides access to drawing methods like lineTo(), rect(), arc(), and fillStyle. Basic shapes can be drawn using lines, curves, rectangles, and fills on the canvas element.
The document discusses the Canvas element in HTML5 which allows dynamic rendering of 2D shapes and images in the browser using JavaScript. It provides basic context methods for drawing rectangles, strokes, gradients and images to the canvas. It also demonstrates how to add event listeners and animate drawings on the canvas.
The document provides an overview of advanced CSS techniques, including:
- Advanced CSS selectors like attribute selectors to target specific links, forms, and images.
- Box shadow spread to create the effect of multiple borders.
- Using border-radius to create flexible ellipse containers.
- CSS3 cursor properties, pointer events, transitions, and CSS arrows.
- Background patterns using gradients, and beautiful button styles using hover interactions and transitions.
- The Prefix Free CSS library to write CSS properties without vendor prefixes.
Support levels and browser compatibility are provided for each technique. The document aims to teach advanced styling options in CSS.
2D Graphics. Description of 2D graphic operations in Qt4. In this Chapter, you can learn how to handle the graphic scenes, views, and items in the Qt program.
Android 13 is now in Beta 3 with new features like predictive back gesture, photo picker, per-app language preferences, and improved copy and paste. It also includes changes like new notification permission rules and foreground service task manager. Android Studio Chipmunk is now stable with enhancements to Compose, jank detection, and Jetifier checks. The Android Jetpack suite was updated with new versions of libraries like Room, Paging, and Navigation. The Android Privacy Sandbox continues work on privacy-preserving APIs.
Android P includes several new features such as WiFi round-trip-time positioning, display cutout support, the ImageDecoder class for image decoding, and a unified biometric authentication API. It also improves existing features like notifications with enhanced messaging styles, and includes privacy and power management changes such as placing restrictions on background access to sensors and limiting apps' resource usage based on usage patterns.
The document discusses the benefits of exercise for mental health. Regular physical activity can help reduce anxiety and depression and improve mood and cognitive functioning. Exercise causes chemical changes in the brain that may help protect against mental illness and improve symptoms.
The document discusses Android architecture components. It describes key components like Lifecycles, LiveData, ViewModel, Room, Navigation, Paging, ViewModel SavedState, and Data Binding. It also discusses using architecture components with the MVVM pattern and clean architecture, including layers for the data, presentation and domain. It provides examples of implementing use cases and repositories, and testing use cases. It emphasizes benefits like testable and collaborative code and outlines best practices like proof of concepts for new learning.
Bitmap make our app more beautiful and there are some risk as well if we do not handle it correctly. There are many things about the bitmap that we have to know to understand how it works.
The document discusses Android Architecture Components (AAC) including Lifecycles, LiveData, ViewModel, and Room. It provides an example of building a timer application using these components. A TimerListener observes the Android lifecycle and manages a countdown timer. A TimerLiveData observes the timer and notifies observers of changes. A TimerViewModel exposes the timer data and methods to start/stop it. An Activity observes the TimerLiveData to update the UI and handle timer events.
The document summarizes the new features in Android Studio 3.2 beta, including AndroidX for reorganizing Android support library packages, dynamic delivery of APKs using app bundles, and dynamic delivery of features using dynamic feature modules. It provides details on migrating to AndroidX, building app bundles and dynamic feature modules, and how they allow serving optimized APKs based on user device configuration. The release also includes improvements to the build tools, emulator, and other developer tools.
This document provides an overview of Android Architecture Components and Repository pattern. It discusses the key classes in Architecture Components like Activity/Fragment, ViewModel, Repository, and Data Source. It also summarizes the latest release notes for Lifecycle, Room, and Paging libraries. Additionally, it covers the purpose of the Repository pattern in handling data operations and mediating between different data sources. Finally, it lists some common classes used in a Repository like ApiResponse, Resource, and NetworkBoundResource.
The document compares and contrasts the Canvas and SVG elements in HTML. Canvas uses JavaScript to draw graphics via code and is rendered pixel by pixel, while SVG uses XML to draw graphics as scalable vector shapes. Canvas is better for games, charts, and advertising due to its faster rendering, while SVG is better for icons, logos, and charts due to its scalability and support for event handlers. Several common drawing methods like rectangles, circles, paths, and text are demonstrated for both Canvas and SVG.
This document provides guidance on custom charting in Android by breaking down the drawing process into layers. It discusses using a Canvas and Paint objects to draw primitives like rectangles, circles, and text. Key aspects covered include calculating marker positions, drawing gradients, guidelines, lines between markers, week labels, and scales. The document encourages learning the main Canvas and Paint APIs and breaking complex views into separate drawing functions for each layer.
The document discusses the HTML5 <canvas> element and 2D Canvas API. It provides details on:
- Creating a canvas element with an id, width, and height
- Getting a 2D drawing context object
- Common drawing methods like lineTo(), arc(), fillText(), strokeRect(), and clearRect()
- Setting properties like fillStyle, strokeStyle, and globalCompositeOperation
- Drawing shapes, images, and text
- Applying transformations with methods like translate(), rotate(), and save()/restore()
- Using requestAnimationFrame() for basic animation
The document provides an overview of the canvas element and its capabilities for 2D drawing and basic animation using JavaScript.
This document provides an introduction to HTML5 Canvas and describes some of its key drawing capabilities. It explains that the <canvas> element is used to draw graphics via scripting, usually with JavaScript. It then outlines several methods for drawing paths, boxes, circles, text, and images on the canvas. It also discusses using gradients, setting the coordinate system, and interacting with canvas elements through events.
The document discusses various methods for creating graphics and animation in .NET applications, including using the Graphics object to draw shapes, lines and filled areas; creating simple animation by changing or moving images over time; using the Timer component to automate animation; and incorporating drag-and-drop functionality.
The document discusses the user interface capabilities in MIDP, including custom items which allow custom rendering and input handling, and the canvas API which provides low-level graphics and event handling capabilities. It describes the key methods and features of custom items and the canvas, such as painting, sizing, and handling input events from touchscreens and keyboards. Examples are provided and future topics are outlined.
The document discusses the canvas drawing API in HTML5. It describes the canvas coordinate system, which differs from the standard Cartesian system used in math. Angles are measured clockwise from the positive x-axis. The canvas context object provides access to drawing methods like lineTo(), rect(), arc(), and fillStyle. Basic shapes can be drawn using lines, curves, rectangles, and fills on the canvas element.
The document discusses the Canvas element in HTML5 which allows dynamic rendering of 2D shapes and images in the browser using JavaScript. It provides basic context methods for drawing rectangles, strokes, gradients and images to the canvas. It also demonstrates how to add event listeners and animate drawings on the canvas.
The document provides an overview of advanced CSS techniques, including:
- Advanced CSS selectors like attribute selectors to target specific links, forms, and images.
- Box shadow spread to create the effect of multiple borders.
- Using border-radius to create flexible ellipse containers.
- CSS3 cursor properties, pointer events, transitions, and CSS arrows.
- Background patterns using gradients, and beautiful button styles using hover interactions and transitions.
- The Prefix Free CSS library to write CSS properties without vendor prefixes.
Support levels and browser compatibility are provided for each technique. The document aims to teach advanced styling options in CSS.
2D Graphics. Description of 2D graphic operations in Qt4. In this Chapter, you can learn how to handle the graphic scenes, views, and items in the Qt program.
Android 13 is now in Beta 3 with new features like predictive back gesture, photo picker, per-app language preferences, and improved copy and paste. It also includes changes like new notification permission rules and foreground service task manager. Android Studio Chipmunk is now stable with enhancements to Compose, jank detection, and Jetifier checks. The Android Jetpack suite was updated with new versions of libraries like Room, Paging, and Navigation. The Android Privacy Sandbox continues work on privacy-preserving APIs.
Android P includes several new features such as WiFi round-trip-time positioning, display cutout support, the ImageDecoder class for image decoding, and a unified biometric authentication API. It also improves existing features like notifications with enhanced messaging styles, and includes privacy and power management changes such as placing restrictions on background access to sensors and limiting apps' resource usage based on usage patterns.
The document discusses the benefits of exercise for mental health. Regular physical activity can help reduce anxiety and depression and improve mood and cognitive functioning. Exercise causes chemical changes in the brain that may help protect against mental illness and improve symptoms.
The document discusses Android architecture components. It describes key components like Lifecycles, LiveData, ViewModel, Room, Navigation, Paging, ViewModel SavedState, and Data Binding. It also discusses using architecture components with the MVVM pattern and clean architecture, including layers for the data, presentation and domain. It provides examples of implementing use cases and repositories, and testing use cases. It emphasizes benefits like testable and collaborative code and outlines best practices like proof of concepts for new learning.
Bitmap make our app more beautiful and there are some risk as well if we do not handle it correctly. There are many things about the bitmap that we have to know to understand how it works.
The document discusses Android Architecture Components (AAC) including Lifecycles, LiveData, ViewModel, and Room. It provides an example of building a timer application using these components. A TimerListener observes the Android lifecycle and manages a countdown timer. A TimerLiveData observes the timer and notifies observers of changes. A TimerViewModel exposes the timer data and methods to start/stop it. An Activity observes the TimerLiveData to update the UI and handle timer events.
The document summarizes the new features in Android Studio 3.2 beta, including AndroidX for reorganizing Android support library packages, dynamic delivery of APKs using app bundles, and dynamic delivery of features using dynamic feature modules. It provides details on migrating to AndroidX, building app bundles and dynamic feature modules, and how they allow serving optimized APKs based on user device configuration. The release also includes improvements to the build tools, emulator, and other developer tools.
This document provides an overview of Android Architecture Components and Repository pattern. It discusses the key classes in Architecture Components like Activity/Fragment, ViewModel, Repository, and Data Source. It also summarizes the latest release notes for Lifecycle, Room, and Paging libraries. Additionally, it covers the purpose of the Repository pattern in handling data operations and mediating between different data sources. Finally, it lists some common classes used in a Repository like ApiResponse, Resource, and NetworkBoundResource.
The document discusses new features and tools for Android development including updates to the Android development IDE, top requested developer features like the Design Support library and vector images, and new annotations in Android M like WorkerThread, Size, and FloatRange. It provides links to additional resources on the "What's New in Android Development Tools" video, Data Binding guide, Android M developer preview blog post, and Android M developer preview website.
The document discusses updates to Google Play Services including new features for Cast SDK, Remote Display API, Play Games Analytics, Lite Mode, Google Place API for Android, and sensors. It also lists several Google developer APIs and provides links to their documentation pages.
The document provides instructions for creating a custom list view in Android. It explains that a list view displays data items and uses an adapter to link the data to views. It demonstrates how to create a custom adapter class that extends BaseAdapter and overrides methods like getCount(), getItem(), and getView(). The getView() method is used to inflate a custom row layout and populate it with data for each list item. The document also shows how to set up the list view in an activity's layout, populate it with sample data, and assign the custom adapter.
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofsAlex Pruden
This paper presents Reef, a system for generating publicly verifiable succinct non-interactive zero-knowledge proofs that a committed document matches or does not match a regular expression. We describe applications such as proving the strength of passwords, the provenance of email despite redactions, the validity of oblivious DNS queries, and the existence of mutations in DNA. Reef supports the Perl Compatible Regular Expression syntax, including wildcards, alternation, ranges, capture groups, Kleene star, negations, and lookarounds. Reef introduces a new type of automata, Skipping Alternating Finite Automata (SAFA), that skips irrelevant parts of a document when producing proofs without undermining soundness, and instantiates SAFA with a lookup argument. Our experimental evaluation confirms that Reef can generate proofs for documents with 32M characters; the proofs are small and cheap to verify (under a second).
Paper: https://eprint.iacr.org/2023/1886
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
Pushing the limits of ePRTC: 100ns holdover for 100 daysAdtran
At WSTS 2024, Alon Stern explored the topic of parametric holdover and explained how recent research findings can be implemented in real-world PNT networks to achieve 100 nanoseconds of accuracy for up to 100 days.
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIVladimir Iglovikov, Ph.D.
Presented by Vladimir Iglovikov:
- https://www.linkedin.com/in/iglovikov/
- https://x.com/viglovikov
- https://www.instagram.com/ternaus/
This presentation delves into the journey of Albumentations.ai, a highly successful open-source library for data augmentation.
Created out of a necessity for superior performance in Kaggle competitions, Albumentations has grown to become a widely used tool among data scientists and machine learning practitioners.
This case study covers various aspects, including:
People: The contributors and community that have supported Albumentations.
Metrics: The success indicators such as downloads, daily active users, GitHub stars, and financial contributions.
Challenges: The hurdles in monetizing open-source projects and measuring user engagement.
Development Practices: Best practices for creating, maintaining, and scaling open-source libraries, including code hygiene, CI/CD, and fast iteration.
Community Building: Strategies for making adoption easy, iterating quickly, and fostering a vibrant, engaged community.
Marketing: Both online and offline marketing tactics, focusing on real, impactful interactions and collaborations.
Mental Health: Maintaining balance and not feeling pressured by user demands.
Key insights include the importance of automation, making the adoption process seamless, and leveraging offline interactions for marketing. The presentation also emphasizes the need for continuous small improvements and building a friendly, inclusive community that contributes to the project's growth.
Vladimir Iglovikov brings his extensive experience as a Kaggle Grandmaster, ex-Staff ML Engineer at Lyft, sharing valuable lessons and practical advice for anyone looking to enhance the adoption of their open-source projects.
Explore more about Albumentations and join the community at:
GitHub: https://github.com/albumentations-team/albumentations
Website: https://albumentations.ai/
LinkedIn: https://www.linkedin.com/company/100504475
Twitter: https://x.com/albumentations
“An Outlook of the Ongoing and Future Relationship between Blockchain Technologies and Process-aware Information Systems.” Invited talk at the joint workshop on Blockchain for Information Systems (BC4IS) and Blockchain for Trusted Data Sharing (B4TDS), co-located with with the 36th International Conference on Advanced Information Systems Engineering (CAiSE), 3 June 2024, Limassol, Cyprus.
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfPaige Cruz
Monitoring and observability aren’t traditionally found in software curriculums and many of us cobble this knowledge together from whatever vendor or ecosystem we were first introduced to and whatever is a part of your current company’s observability stack.
While the dev and ops silo continues to crumble….many organizations still relegate monitoring & observability as the purview of ops, infra and SRE teams. This is a mistake - achieving a highly observable system requires collaboration up and down the stack.
I, a former op, would like to extend an invitation to all application developers to join the observability party will share these foundational concepts to build on:
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...Neo4j
Leonard Jayamohan, Partner & Generative AI Lead, Deloitte
This keynote will reveal how Deloitte leverages Neo4j’s graph power for groundbreaking digital twin solutions, achieving a staggering 100x performance boost. Discover the essential role knowledge graphs play in successful generative AI implementations. Plus, get an exclusive look at an innovative Neo4j + Generative AI solution Deloitte is developing in-house.
In the rapidly evolving landscape of technologies, XML continues to play a vital role in structuring, storing, and transporting data across diverse systems. The recent advancements in artificial intelligence (AI) present new methodologies for enhancing XML development workflows, introducing efficiency, automation, and intelligent capabilities. This presentation will outline the scope and perspective of utilizing AI in XML development. The potential benefits and the possible pitfalls will be highlighted, providing a balanced view of the subject.
We will explore the capabilities of AI in understanding XML markup languages and autonomously creating structured XML content. Additionally, we will examine the capacity of AI to enrich plain text with appropriate XML markup. Practical examples and methodological guidelines will be provided to elucidate how AI can be effectively prompted to interpret and generate accurate XML markup.
Further emphasis will be placed on the role of AI in developing XSLT, or schemas such as XSD and Schematron. We will address the techniques and strategies adopted to create prompts for generating code, explaining code, or refactoring the code, and the results achieved.
The discussion will extend to how AI can be used to transform XML content. In particular, the focus will be on the use of AI XPath extension functions in XSLT, Schematron, Schematron Quick Fixes, or for XML content refactoring.
The presentation aims to deliver a comprehensive overview of AI usage in XML development, providing attendees with the necessary knowledge to make informed decisions. Whether you’re at the early stages of adopting AI or considering integrating it in advanced XML development, this presentation will cover all levels of expertise.
By highlighting the potential advantages and challenges of integrating AI with XML development tools and languages, the presentation seeks to inspire thoughtful conversation around the future of XML development. We’ll not only delve into the technical aspects of AI-powered XML development but also discuss practical implications and possible future directions.
Securing your Kubernetes cluster_ a step-by-step guide to success !KatiaHIMEUR1
Today, after several years of existence, an extremely active community and an ultra-dynamic ecosystem, Kubernetes has established itself as the de facto standard in container orchestration. Thanks to a wide range of managed services, it has never been so easy to set up a ready-to-use Kubernetes cluster.
However, this ease of use means that the subject of security in Kubernetes is often left for later, or even neglected. This exposes companies to significant risks.
In this talk, I'll show you step-by-step how to secure your Kubernetes cluster for greater peace of mind and reliability.
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionAggregage
Join Maher Hanafi, VP of Engineering at Betterworks, in this new session where he'll share a practical framework to transform Gen AI prototypes into impactful products! He'll delve into the complexities of data collection and management, model selection and optimization, and ensuring security, scalability, and responsible use.
3. Basic Drawing Component in Android
• Bitmap
• Canvas
• Drawing Primitive
• Paint
Hold the pixels
Host the draw calls
Rect, Path, Text, Bitmap, …
Describe the color and styles for the drawing
4. Basic Drawing Component in Android
• Bitmap
• Canvas
• Drawing Primitive
• Paint
Hold the pixels
Host the draw calls
Rect, Path, Text, Bitmap, …
Describe the color and styles for the drawing
5. Basic Drawing Component in Android
• Bitmap
• Canvas
• Drawing Primitive
• Paint
Hold the pixels
Host the draw calls
Rect, Path, Text, Bitmap, …
Describe the color and styles for the drawing
6. Basic Drawing Component in Android
• Bitmap
• Canvas
• Drawing Primitive
• Paint
Hold the pixels
Host the draw calls
Rect, Path, Text, Bitmap, …
Describe the color and styles for the drawing
12. Point
Line
Rect
Arc
Round Rect
Circle
Color
Path
Text
Bitmap
val canvas: Canvas = /* ... */
val paint: Paint = /* ... */
val startX = 30f
val startY = 30f
val endX = 100f
val endY = 100f
canvas.drawLine(
startX,
startY,
endX,
endY,
paint
)
Canvas
Drawing Primitives
Paint
Compositing Mode
นี่คือ Line
อันนี้ก็ LINE
13. val canvas: Canvas = /* ... */
val paint: Paint = /* ... */
val left = 20f
val top = 20f
val right = 200f
val bottom = 150f
canvas.drawRect(
left,
top,
right,
bottom,
paint
)
Canvas
Drawing Primitives
Paint
Compositing Mode
Point
Line
Rect
Arc
Round Rect
Circle
Color
Path
Text
Bitmap
14. val canvas: Canvas = /* ... */
val paint: Paint = /* ... */
val rect = RectF(
20f,
20f,
200f,
150f
)
canvas.drawRect(rect, paint)
Canvas
Drawing Primitives
Paint
Compositing Mode
Point
Line
Rect
Arc
Round Rect
Circle
Color
Path
Text
Bitmap
15. val canvas: Canvas = /* ... */
val paint: Paint = /* ... */
val left = 100f
val top = 100f
val right = 200f
val bottom = 200f
val startAngle = 160f
val sweepAngle = 180f
val useCenter = false
canvas.drawArc(
left, top, right, bottom,
startAngle, sweepAngle,
useCenter, paint
)
Canvas
Drawing Primitives
Paint
Compositing Mode
Point
Line
Rect
Arc
Round Rect
Circle
Color
Path
Text
Bitmap
16. Canvas
Drawing Primitives
Paint
Compositing Mode
val left = 100f
val top = 100f
val right = 200f
val bottom = 200f
val startAngle = 160f
val sweepAngle = 180f
(100, 100)
(200, 200)
Point
Line
Rect
Arc
Round Rect
Circle
Color
Path
Text
Bitmap
17. Canvas
Drawing Primitives
Paint
Compositing Mode
val left = 100f
val top = 100f
val right = 200f
val bottom = 200f
val startAngle = 160f
val sweepAngle = 180f
270°
90°
0°180°
Point
Line
Rect
Arc
Round Rect
Circle
Color
Path
Text
Bitmap
18. Canvas
Drawing Primitives
Paint
Compositing Mode
val left = 100f
val top = 100f
val right = 200f
val bottom = 200f
val startAngle = 160f
val sweepAngle = 180f
Sweep 180°
Start at 160°
Point
Line
Rect
Arc
Round Rect
Circle
Color
Path
Text
Bitmap
19. val canvas: Canvas = /* ... */
val paint: Paint = /* ... */
val rectF = RectF(
20f,
20f,
200f,
150f)
val radius = 10f
canvas.drawRoundRect(
rectF,
radius,
radius,
paint
)
Canvas
Drawing Primitives
Paint
Compositing Mode
Point
Line
Rect
Arc
Round Rect
Circle
Color
Path
Text
Bitmap
20. val canvas: Canvas = /* ... */
val paint: Paint = /* ... */
canvas.drawCircle(
100f,
100f,
50f,
paint
)
Canvas
Drawing Primitives
Paint
Compositing Mode
Point
Line
Rect
Arc
Round Rect
Circle
Color
Path
Text
Bitmap
21. val canvas: Canvas = /* ... */
canvas.drawColor(Color.parseColor("#28353E"))
Canvas
Drawing Primitives
Paint
Compositing Mode
Point
Line
Rect
Arc
Round Rect
Circle
Color
Path
Text
Bitmap
22. val canvas: Canvas = /* ... */
val paint: Paint = /* ... */
val path = Path().apply {
moveTo(20f, 20f)
lineTo(40f, 20f)
arcTo(
RectF(40f, 5f, 70f, 35f),
180f, -180f, false
)
lineTo(90f, 20f)
lineTo(90f, 90f)
lineTo(20f, 90f)
close()
}
canvas.drawPath(path, paint)
Canvas
Drawing Primitives
Paint
Compositing Mode
Point
Line
Rect
Arc
Round Rect
Circle
Color
Path
Text
Bitmap
23. val canvas: Canvas = /* ... */
val paint: Paint = /* ... */
val path = Path().apply {
moveTo(20f, 20f)
lineTo(40f, 20f)
arcTo(
RectF(40f, 5f, 70f, 35f),
180f, -180f, false
)
lineTo(90f, 20f)
lineTo(90f, 90f)
lineTo(20f, 90f)
close()
}
canvas.drawPath(path, paint)
Canvas
Drawing Primitives
Paint
Compositing Mode
Point
Line
Rect
Arc
Round Rect
Circle
Color
Path
Text
Bitmap
24. Canvas
Drawing Primitives
Paint
Compositing Mode
Point
Line
Rect
Arc
Round Rect
Circle
Color
Path
Text
Bitmap
val canvas: Canvas = /* ... */
val paint: Paint = /* ... */
val path = Path().apply {
moveTo(20f, 20f)
lineTo(40f, 20f)
arcTo(
RectF(40f, 5f, 70f, 35f),
180f, -180f, false
)
lineTo(90f, 20f)
lineTo(90f, 90f)
lineTo(20f, 90f)
close()
}
canvas.drawPath(path, paint)
25. Canvas
Drawing Primitives
Paint
Compositing Mode
Point
Line
Rect
Arc
Round Rect
Circle
Color
Path
Text
Bitmap
val canvas: Canvas = /* ... */
val paint: Paint = /* ... */
val path = Path().apply {
moveTo(20f, 20f)
lineTo(40f, 20f)
arcTo(
RectF(40f, 5f, 70f, 35f),
180f, -180f, false
)
lineTo(90f, 20f)
lineTo(90f, 90f)
lineTo(20f, 90f)
close()
}
canvas.drawPath(path, paint)
26. Canvas
Drawing Primitives
Paint
Compositing Mode
Point
Line
Rect
Arc
Round Rect
Circle
Color
Path
Text
Bitmap
val canvas: Canvas = /* ... */
val paint: Paint = /* ... */
val path = Path().apply {
moveTo(20f, 20f)
lineTo(40f, 20f)
arcTo(
RectF(40f, 5f, 70f, 35f),
180f, -180f, false
)
lineTo(90f, 20f)
lineTo(90f, 90f)
lineTo(20f, 90f)
close()
}
canvas.drawPath(path, paint)
27. Canvas
Drawing Primitives
Paint
Compositing Mode
Point
Line
Rect
Arc
Round Rect
Circle
Color
Path
Text
Bitmap
val canvas: Canvas = /* ... */
val paint: Paint = /* ... */
val path = Path().apply {
moveTo(20f, 20f)
lineTo(40f, 20f)
arcTo(
RectF(40f, 5f, 70f, 35f),
180f, -180f, false
)
lineTo(90f, 20f)
lineTo(90f, 90f)
lineTo(20f, 90f)
close()
}
canvas.drawPath(path, paint)
28. Canvas
Drawing Primitives
Paint
Compositing Mode
Point
Line
Rect
Arc
Round Rect
Circle
Color
Path
Text
Bitmap
val canvas: Canvas = /* ... */
val paint: Paint = /* ... */
val path = Path().apply {
moveTo(20f, 20f)
lineTo(40f, 20f)
arcTo(
RectF(40f, 5f, 70f, 35f),
180f, -180f, false
)
lineTo(90f, 20f)
lineTo(90f, 90f)
lineTo(20f, 90f)
close()
}
canvas.drawPath(path, paint)
29. Canvas
Drawing Primitives
Paint
Compositing Mode
Point
Line
Rect
Arc
Round Rect
Circle
Color
Path
Text
Bitmap
val canvas: Canvas = /* ... */
val paint: Paint = /* ... */
val path = Path().apply {
moveTo(20f, 20f)
lineTo(40f, 20f)
arcTo(
RectF(40f, 5f, 70f, 35f),
180f, -180f, false
)
lineTo(90f, 20f)
lineTo(90f, 90f)
lineTo(20f, 90f)
close()
}
canvas.drawPath(path, paint)
33. Point
Line
Rect
Arc
Round Rect
Circle
Color
Path
Text
Bitmap
val canvas: Canvas = /* ... */
val paint: Paint = /* ... */
val bitmap: Bitmap = /* ... */
val source = Rect(
0,
0,
bitmap.width,
bitmap.height
)
val destination = Rect(
0,
0,
bitmap.width / 2,
bitmap.height / 2
)
canvas.drawBitmap(bitmap, source, destination, paint)
Canvas
Drawing Primitives
Paint
Compositing Mode
34. Point
Line
Rect
Arc
Round Rect
Circle
Color
Path
Text
Bitmap
val canvas: Canvas = /* ... */
val paint: Paint = /* ... */
val bitmap: Bitmap = /* ... */
val source: Rect = /* ... */
val left = 10f
val top = 10f
val destination = RectF(
0 + left,
0 + top,
(bitmap.width / 2) + left,
(bitmap.height / 2) + top
)
canvas.drawBitmap(bitmap, source, destination, paint)
Canvas
Drawing Primitives
Paint
Compositing Mode
44. val canvas: Canvas = /* ... */
// Clear all
canvas.drawColor(Color.WHITE, PorterDuff.Mode.CLEAR)
Canvas
Drawing Primitives
Paint
Compositing Mode
45. Compositing Mode
“Compositing Digital Images” by Thomas Porter and Tom Duff
Canvas
Drawing Primitives
Paint
Compositing Mode
android.graphics.PorterDuff.Mode