C++C++17Language FeatureLearn C++

How To Use Skia Images in C++ Builder?

How To Use Skia Images in C++ Builder

The latest RAD Studio / C++ Builder 12 comes with a lot of new features, one of which is Skia graphics library support in C++. Skia is an open-source graphic library that provides to support a variety of hardware and software platforms. Skia provides smooth 2D graphics that uses GPU efficiently. Skia supports a lot of new image formats, such as .bmp, .jpg, .gif, .gif animation, .svg, .ico, .webp, .wbmp and raw images (.arw, .cr2, .dng, .nef, .nrw, .orf, .raf, .rw2, .pef and .srw). It also provides excellent support for the SVG image format which is a Scalable Vector Graphics form. In this post, we explain about the image support added by the inclusion of Skia in C++ Builder and how you can use that support in your own programs and apps.

What is Skia in modern C++?

Skia is an open-source graphic library that provides support variety of hardware and software platforms. Skia is sponsored and managed by Google but is available for use by anyone under the BSD Free Software License. Mainly designed for Google Chrome and ChromeOS, Android, Flutter, Mozilla Firefox and Firefox OS, and many other products. The core components are done by the Skia development team but they consider contributions from any source.

How To Use Skia Images in C++ Builder?

How to load WebP image into a TImage in C++?

The new C++ Builder 12 allows you to use modern image formats, such as .bmp, .jpg, .gif, .gif animation, .svg, .ico, .webp, .wbmp and raw images (.arw, .cr2, .dng, .nef, .nrw, .orf, .raf, .rw2, .pef and .srw). Here is how you can load a webp image,

How to load an encoded image from a file in C++?

The new C++ Builder 12 allows you to load encoded image formats from a file, such as a WEBP or JPEG image as in example below,

How to encode an image from a SkImage in C++?

The new C++ Builder 12 allows you to encode image formats from a file, such as a WEBP or JPEG image as in example below,

How to load animated gif images in C++?

The new C++ Builder 12 allows you to load animated gifs from a file, to display them in animation, you should drag TSkAnimatedImage from palette, then you can write this code to load an animated gif

If you want to see more examples, please install the latest RAD Studio / C++ Builder 12.1 full or trial version and check this sample in Samples folder:
C:\Users\Public\Documents\Embarcadero\Studio\23.0\Samples\CPP\Multi-Device Samples\Skia4Delphi project. It has many examples that runs different Skia graphical examples.

How To Use Skia Images in C++ Builder C++ logo

C++ Builder is the easiest and fastest C and C++ compiler and IDE for building simple or professional applications on the Windows operating system. It is also easy for beginners to learn with its wide range of samples, tutorials, help files, and LSP support for code. RAD Studio’s C++ Builder version comes with the award-winning VCL framework for high-performance native Windows apps and the powerful FireMonkey (FMX) framework for UIs.

There is a free C++ Builder Community Edition for students, beginners, and startups; it can be downloaded from here. For professional developers, there are Professional, Architect, or Enterprise versions of C++ Builder and there is a trial version you can download from here.

Oh hi there 👋
It’s nice to meet you.

Sign up to receive awesome C++ content in your inbox, every day.

We don’t spam! Read our privacy policy for more info.

About author

Dr. Yilmaz Yoru has 35+ years of coding with more than 30+ programming languages, mostly C++ on Windows, Android, Mac-OS, iOS, Linux, and some other operating systems. He graduated and received his MSc and PhD degrees from the Department of Mechanical Engineering of Eskisehir Osmangazi University. He is the founder and CEO of ESENJA LLC Company. His interests are Programming, Thermodynamics, Fluid Mechanics, Artificial Intelligence, 2D & 3D Designs, and high-end innovations.
Related posts
C++C++11C++14C++17C++20Introduction to C++Learn C++Syntax

Learn Default Constructors Of Classes In Modern C++

Artificial Intelligence TechC++C++11C++14C++17Learn C++

How To Develop Special AI Activation Functions In C++?

Artificial Intelligence TechC++C++11C++14C++17Language FeatureLearn C++

Learn How To Read The WAV Waveform Audio File Format In C++

C++C++11Learn C++

What Is Assignment Operator Overloading?