Skip to content

C++ in the Multi-Device Enterprise

In every conversation, social network post and industry article, you hear about the need for multi-device support inside an Enterprise. Terms like BYOD appear in most articles and Enterprise strategies. Computing in a modern Enterprise is not only a Microsoft Windows world. Enterprise organizations need to support a wide array of devices that their employees are using to be more productive. The modern enterprise also needs to support additional software architectures including multi-tier systems, cloud computing, REST and SOAP web services and more.

A large percentage of the desktop applications used in enterprises are written using C++.  Included in this list are Microsoft Office, OpenOffice and most of the web browsers.  C++ has been used inside enterprises for business critical applications and multi-tier architectures including SOAP, REST and CORBA.  Most enterprise operating platforms are also built with C++.  Most enterprise SQL databases are also built using C++.

When you look at the growth of BYOD (Bring Your Own Device) use inside enterprises you will see that many of the mobile apps that are used are built with C++. It’s not just a Windows and Intel only world anymore.

Java is also very present in Enterprise computing today.  Did you know that the HotSpot Java Virtual Machine is written in C++?  When Java developers need to get closer to the operating system and hardware, they use the JNI (Java Native Interface) to get to their native C++ code.

If you want to compile and deploy your apps in a multi-device enterprise you have choices in what tools, frameworks and SDKs you can use to build Windows, Mac, Web and Mobile applications.

Multiple vendor tools targeting multi-devices or one tool chain and codebase

The old way to target multi-devices:  Windows dev team and Mac dev team using different tools and language variants.  This tool approach causes duplicate development and QA efforts.  This approach leads to increased development cost.  You end up with slower time to market or delay in delivering a Mac version.

  • Windows/SDK and Windows/RT – C# or C++ using .NET or MFC
  • OSX/SDK – C++ or Objective-C
  • iOS/SDK – C++ or Objective-C
  • Android/SDK – Java

The C++Builder way allows you to use one development team, one tool.  You can create the application once. Click to compile to Windows. Click to compile to Mac from the same project. No extra development effort.  This approach reduces the lines of code by up to 80% using C++Builder’s proven visual development solution.  The results: Faster time to market for Win/Mac at lower cost.

Traditional cross-platform tools

You could choose to use one or more C++ language compilers along with a common framework like Qt or WxWidgets.  This approach still requires separate development efforts for each device form factor and device type. This approach may not scale to other platforms, software architectures, services and form factors.

HTML5 cross-platform tools

For your enterprise multi-device development you might choose to use an HTML5 cross platform approach using Embarcadero’s HTML5 Builder, Adobe Phonegap, and products from Sencha and Kendo.  You may not be able to tune your applications for better user experience, performance and execution predictability because of a virtual machine being between your application and the device.

“Platform Native” virtual code tools

This type of multi-device approach allows you to use a common programming language while you still would build your applications using several different platform SDKs.

Rapid, Native Code Multi-Device Enterprise Development

Using C++Builder’s component based, visual development and optimizing native code C++ compilers, you can quickly prototype, build and deploy native device applications for Intel processors and use the same project codebase for ARM processors later this year (see RAD Studio Mobile Roadmap).  Using the C++Builder’s approach your applications have maximum performance, are highly tunable, have the smallest possible memory footprint, and provide a low latency user experience.

C++Builder directly supports all of the major enterprise databases, SOAP and REST web services, Microsoft Azure and Amazon cloud services.  There is also a large ecosystem of additional components and tools that support a wide range of additional enterprise architectures and services.

C++ is the choice for Multi-Device Enterprises

Here are just a few of the reasons why C++ (and C/C99) is the industry choice for native code, multi-device enterprise application development:

  • ž#2 and #4 languages for SourceForge open source projects
  • Top commercial software is written in C++ - Microsoft Word, Adobe Photoshop, Google Chrome, Firefox, Mac OS X, iOS, Oracle database, Microsoft SQL Server, MySQL, Games
  • Top web companies use C++ – Facebook, PayPal, Amazon

C++Builder XE3 provides the native, multi-device solution that enterprises demand:

  • Native Multi-Device Targeting Architecture
  • Windows & Mac today. iOS & Android announced for 2013
  • C++98, C++TR1, and C++11 language standards
  • ANSI C, ISO C, C99, and C11 language standards
  • Dinkumware STL and Boost 1.5
  • CLANG compatible - http://clang.llvm.org/
  • Agile C++ language extensions

Why is C++Builder XE3 the perfect fit for multi-device enterprise application development?  C++Builder XE3 provides:

  • Standards based C/C++ language – C++11
  • Agile, visual development
  • High Performance Seamless DB and Web/Cloud Services Connectivity
  • SQL database support for Oracle, DB2, MS SQL, InterBase, Firebird, PostgreSQL, MySQL, Sybase ASA, Sybase ASE, Informix, SQLite, MS Access, ODBC bridge, dbExpress bridge - using FireDAC multi-device data access (http://www.embarcadero.com/products/rad-studio/firedac).

Join me Tuesday March 26 for my webinars:  C++ in the Multi-Device Enterprise

  • Tuesday, March 26, 2013
  • 6:00AM PDT / 9:00AM EDT / 13:00 UTC
  • 11:00AM PDT / 2:00PM EDT / 18:00 UTC
  • 5:00PM PDT / 8:00PM EDT / 11:00AM 27-Mar Australia EDT

This webinar showcases how C++ can help satisfy the Enterprise’s need to support multiple devices on desktops, servers, web, mobile and multi-tiers in their infrastructure. Coverage includes C++Builder’s support for ISV and enterprise class integrated database, middleware and cloud computing. With C++Builder XE3, you get integrated support for SQL Server, Oracle, Sybase, DB2, InterBase, SQL Anywhere, SQLite, MySQL, and cloud services including Windows Azure and Amazon.

During the webinar, you will learn how to:

  • Leverage platform services, devices and sensors in your multi-device C++ applications
  • Build multi-device C++ applications that connect with enterprise SQL databases
  • Create multi-device C++ desktop applications that consume web services using SOAP and REST
  • Build scalable multi-tier, multi-device, master detail database applications

Register at http://forms.embarcadero.com/forms/AMUSCA1303CMulti-deviceWebinar3-26

Additional C++Builder Information

Watch/Download the C++Builder 64-bit Compiler Preview Video

Additional details about the 64-bit C++Builder compiler are available in the preview video.  Watch the C++ 64-bit compiler preview video on YouTube at http://www.youtube.com/watch?v=PwwMpBUoR6Y. You can also download the MP4 video file at http://cc.embarcadero.com/item/29197.  The preview video is 9 minutes long.

Try the C++Builder 64-bit compiler

The C++Builder XE3 and RAD Studio XE3 free trial downloads have been updated to include the new C++Builder 64-bit compiler.  Trial downloads are available at https://downloads.embarcadero.com/free/c_builder

Webinar: March 26 - C++ in the Multi-Device Enterprise

Join me, David I, on March 26, 2013 for my webinars (3 times during the day) showcasing how C++ can be used in the multi-device enterprise.

In every conversation, social network post and industry article, you hear about the need for multi-device support inside an Enterprise. Terms like BYOD appear in most articles and Enterprise strategies. Computing in a modern Enterprise is not only a Microsoft Windows world. Enterprise organizations need to support a wide array of devices that their employees are using to be more productive. The modern enterprise also needs to support additional software architectures including Cloud computing, multi-tier, REST and SOAP web services and more.

This webinar showcases how C++ can help satisfy the Enterprise’s need to support multiple devices on desktops, servers, web, mobile and multi-tiers in their infrastructure. Coverage includes C++Builder’s support for ISV and enterprise class integrated database, middleware and cloud computing. With C++Builder XE3, you get integrated support for SQL Server, Oracle, Sybase, DB2, InterBase, SQL Anywhere, SQLite, MySQL, and cloud services including Windows Azure and Amazon.

During the webinar, you will learn how to:

  • Leverage platform services, devices and sensors in your multi-device C++ applications
  • Build multi-device C++ applications that connect with enterprise SQL databases
  • Create multi-device C++ desktop applications that consume web services using SOAP and REST
  • Build scalable multi-tier, multi-device, master detail database applications

Dates/Times

Tuesday, March 26, 2013

  • 6:00AM PDT / 9:00AM EDT / 13:00 UTC
  • 11:00AM PDT / 2:00PM EDT / 18:00 UTC
  • 5:00PM PDT / 8:00PM EDT / 11:00AM 27-Mar Australia EDT

To register for the webinar go to

http://forms.embarcadero.com/forms/AMUSCA1303CMulti-deviceWebinar3-26

Multi-Device C++ is used everywhere on planet Earth and beyond!

In my conversation with Bjarne Stroustrup during the CodeRage 7 C++ Conference (replays of the sessions are available to watch and download) last December, Bjarne talked about how pervasive C++ is in enterprises, infrastructures, major application software and operating platforms. C++ is used to build Operating Systems, Libraries, Applications and Scalable Systems.  C++ is used in many different markets on planet Earth and beyond.

C++ is used in major operating systems including:

  • Microsoft Windows
  • Linux
  • Apple Mac OS X
  • Apple iOS
  • Solaris
  • HP-UX
  • Google Chrome OS
  • Google Android
  • Blackberry OS

C++ is used in Major Enterprise Databases including:

  • Oracle
  • MySQL
  • IBM DB2
  • Microsoft SQL Server
  • Informix

C++ is used to build many of the most popular application software programs and Internet sites including (just to name a very small number):

  • Microsoft Office
  • Open Office
  • Adobe Photoshop
  • Autodesk Maya
  • World of Warcraft
  • Mozilla Firefox
  • Intuit Quicken
  • Halo 3
  • PayPal
  • Amazon.com
  • Facebook
  • Google
C++ is used in applications for many "out of this world" and "deep inside the atom" systems:
  • NASA/JPL Mars Rover
  • The International Space Station - including "World Map (word document)" written in C++Builder
  • The CERN Large Hadron Collider

C++ is used in "Hard" real-time systems:

For building "Hard" Real-Time Systems, Bjarne, in the CodeRage 7 C++ conversation, said that for these types of critical applications, "every operation has to be predictable". In C++ everything is predictable with exception of the following:

  • New
  • Delete
  • Throw
  • dynamic_cast

How can you guarantee that code gets to a handler within a defined/short period of time? Bjarne said, "there is no guarantee in the C++ language". Bjarne said, "what is needed is a tool to analyze the throw paths to determine an upper bound for handling time." On Bjarne’s website there is a paper (pdf format) that can help developers who are building life, mission, business critical systems, "Practical and Verifiable C++ Dynamic Cast for Hard Real Time Systems", http://www.stroustrup.com/fdc_jcse.pdf.

C++ is used in the Joint Strike Fighter.  You can read the "JOINT STRIKE FIGHTER AIR VEHICLE C++ CODING STANDARDS FOR THE SYSTEM DEVELOPMENT AND DEMONSTRATION PROGRAM, Document Number 2RDU00001 Rev C, December 2005" document at http://www.stroustrup.com/JSF-AV-rules.pdf. The document provides guidance for C++ programmers "that will enable them to employ good programming style and proven programming practices leading to safe, reliable, testable, and maintainable code. Consequently, the rules contained in this document are required for Air Vehicle C++ development and recommended for non-Air Vehicle C++ development."  I believe that this document provides great advice for all C++ systems and application developers.

C++ is used to build Infrastructure Software

In an IEEE Computer Magazine January 2012 article, "Software Development for Infrastructure", Bjarne Stroustrup writes "Infrastructure software needs more stringent correctness, reliability, efficiency, and maintainability requirements than nonessential applications. This implies greater emphasis on up-front design, static structure enforced by a type system, compact data structures, simplified code structure, and improved tool support. Education for infrastructure and application developers should differ to reflect that emphasis." In the article, C++ code examples are used to highlight best practice programming techniques including:

  • Compute Less
  • Access Memory Less
  • Practice type-rich Programming
  • Use Libraries
  • Prefer highly structured code

C++Builder XE3 — Multi-Device C++ Development

The list of multi-device C++ goes on and on.  For ISVs and Enterprises the #1 application development challenge today is supporting the growing heterogeneous mix of client devices, UI approaches, OS versions, and emerging form factors. With traditional development approaches, for every new platform supported, a whole new team is required to create and manage a separate codebase. This approach multiplies your costs and time to market with each addition. To turn this mounting challenge into a competitive advantage developers need an edge, a way to virtually replicate their R&D staff several times over. C++Builder is the only native multi-device development solution for targeting desktops, laptops, Slates and tablets including Surface Pro. And coming in 2013, iOS and Android*. Embarcadero C++Builder XE3 enables C++ developers to easily target desktops, laptops, Slates and tablets including Surface Pro with a single C++ codebase.

Additional Lists of Systems and Applications built with C++

Where do you find C++ being used?

Post a comment with your favorite systems and applications that are built using C++.  Post links to cool sites that are built using C++.

FireMonkey XE3 DrawArc and FillArc on the form and a TImage Bitmap

I received an email from Marian Ionescu this morning asking me how to draw an Arc on a FireMonkey Timage Bitmap.  In FireMonkey XE2 there was a method, BitmapChanged, for a TBitmap that was refactored out in FireMonkey XE3.   To take a look, I build Delphi and C++Builder FireMonkey XE3 HD applications.  I placed a TImage and a TButton on my form.  Then I took some code from the FireMonkey XE3 help and Embarcadero Docwiki and wrote a simple program to draw and fill an arc on the Form’s Canvas and also on the TImage’s Bitmap.  Here is the Form declarations and the code for the Delphi and C++Builder examples (the source code projects are available on CodeCentral - see the links at the end of this blog article).

    // Delphi form declaration:
    TForm1 = class(TForm)
      Button1: TButton;
      Image1: TImage;
      procedure Button1Click(Sender: TObject);
      procedure FormCreate(Sender: TObject);
    private
      { Private declarations }
    public
      { Public declarations }
    end;
    // C++ form declaration:
    class TForm2 : public TForm
    {
    __published:	// IDE-managed Components
      TImage *Image1;
      TButton *Button1;
      void __fastcall Button1Click(TObject *Sender);
      void __fastcall FormCreate(TObject *Sender);
    private:	// User declarations
      TBitmap *MyBitmap;
    public:		// User declarations
      __fastcall TForm2(TComponent* Owner);
    };
    // Delphi event handling code
    procedure TForm1.Button1Click(Sender: TObject);
    var
      Center, Radius: TPointF;
      Opacity, StartAngle, SweepAngle: Single;
      ArcColor,FillColor : TAlphaColor;
    begin
        Center.X := 50;
        Center.Y := 60;
        Radius.X := 200;
        Radius.Y := 220;
        Opacity := 0.5;
        StartAngle := 100;
        SweepAngle := -90;
        ArcColor := claGreen;
        FillColor := claYellow;
    
        // draw on the TImage.Bitmap
    
        Image1.Bitmap.Canvas.BeginScene;
    
        Image1.Bitmap.Canvas.Stroke.Color := ArcColor;
        Image1.Bitmap.Canvas.Fill.Color := FillColor;
    
        // draw the arc
        Image1.Bitmap.Canvas.DrawArc(Center, Radius, StartAngle,
          SweepAngle, Opacity);
    
        // fill the arc
        Image1.Bitmap.Canvas.FillArc(Center, Radius, StartAngle,
          SweepAngle, Opacity);
    
        Image1.Bitmap.Canvas.EndScene;
    
        // draw on the form
    
        Canvas.BeginScene;
    
        Canvas.Stroke.Color := ArcColor;
        Canvas.Fill.Color := FillColor;
    
        // draw the arc
        Canvas.DrawArc(Center, Radius, StartAngle,
          SweepAngle, Opacity);
    
        // fill the arc
        Canvas.FillArc(Center, Radius, StartAngle,
          SweepAngle, Opacity);
    
        Canvas.EndScene;
    
    end;
    
    procedure TForm1.FormCreate(Sender: TObject);
    begin
      // create the bitmap in the TImage
        Image1.Bitmap.Create(Round(Image1.Width), Round(Image1.Height));
    end;
    // C++ event handling code
    void __fastcall TForm2::Button1Click(TObject *Sender)
    {
    	TPointF Center;
    	Center.X = 50;
    	Center.Y = 60;
    	TPointF Radius;
    	Radius.X = 200;
    	Radius.Y = 220;
    	float Opacity = 0.5;
    	float StartAngle = 100.0;
    	float SweepAngle = -90.0;
    	TAlphaColor ArcColor = claGreen;
    	TAlphaColor FillColor = claYellow;
    
    	// draw on the TImage->Bitmap
    
    	Image1->Bitmap->Canvas->BeginScene();
    
    	Image1->Bitmap->Canvas->Stroke->Color = ArcColor;
    	Image1->Bitmap->Canvas->Fill->Color = FillColor;
    
    	// draw the arc
    	Image1->Bitmap->Canvas->DrawArc(Center, Radius, StartAngle,
    	  SweepAngle, Opacity);
    
    	// fill the arc
    	Image1->Bitmap->Canvas->FillArc(Center, Radius, StartAngle,
    	  SweepAngle, Opacity);
    
    	Image1->Bitmap->Canvas->EndScene();
    
    	// draw on the form
    
    	Canvas->BeginScene();
    
    	Canvas->Stroke->Color = ArcColor;
    	Canvas->Fill->Color = FillColor;
    
    	// draw the arc
    	Canvas->DrawArc(Center, Radius, StartAngle,
    	  SweepAngle, Opacity);
    
    	// fill the arc
    	Canvas->FillArc(Center, Radius, StartAngle,
    	  SweepAngle, Opacity);
    
    	Canvas->EndScene();
    
    }
    //---------------------------------------------------------------------------
    void __fastcall TForm2::FormCreate(TObject *Sender)
    {
      // create the bitmap in the TImage
      TBitmap *MyBitmap = new TBitmap(Image1->Width, Image1->Height);
      Image1->Bitmap = MyBitmap;
    }

After clicking on the TButton, you will see the following displayed on the form:

The Code for both projects is available on CodeCentral at:

Delphi project - http://cc.embarcadero.com/item/29319

C++Builder project - http://cc.embarcadero.com/item/29320

Feb 14, 2013 - Delphi’s 18th birthday celebration - ongoing innovations and new multi-device support

Back on February 14, 1995 we launched the first version of Delphi at the Software Development Conference West in San Francisco California.  Building way beyond the previous 12 years of Turbo Pascal innovations, Delphi arrived on the scene combining a 16-bit Windows native code compiler, visual component architecture (properties, methods and events), visual two way tools IDE, Windows run-time library, and database support. Since that time, the development team has continued to add modern innovations to satisfy customer business requirements and support new multi-device application architectures.  There may be some developers who haven’t been following all of the new Delphi solutions.  Here are just a few of the many innovations that have appeared in the past 8 Delphi releases.

Delphi 2005

  • Multi-unit namespaces
  • for … in … do loops
  • inline functions
  • Nested types
  • Heterogeneous database access, multi-tier database applications
  • Refactoring, Source code History view
  • Unit testing

Delphi 2006

  • Code block completion/Surround, Editor Change Bars
  • Live Code Templates
  • UML Modeling, Audits, Metrics, Doc Gen
  • Design Patterns

Delphi 2007

  • MSBuild, Build Configurations
  • VCL - AJAX, Vista compatibility
  • Vista and XP Themes for applications
  • dbExpress - new framework, delegate drivers, Unicode database support

Delphi 2009

  • Unicode throughout the language, library and IDE
  • Generics and Anonymous Methods
  • Resource Editor, Class Explorer
  • DataSnap multi-tier
  • VCL – new components, Custom Hints, Ribbon Controls
  • Localization – Integrated Translation Environment, External Translation Manager

Delphi 2010

  • Windows 7, Multi-Touch and Gesture support, Direct-2D
  • IDE Insight, Source Code Formatter, Search task bar
  • Enhanced RTTI
  • Attributes
  • Background compilation
  • Breakpoints in threads, freeze/thaw threads
  • DataSnap – HTTP protocol support

Delphi XE

  • DataSnap – HTTPS, JavaScript, REST support
  • Subversion integration
  • Regular Expression library
  • AQtime, CodeSite, Beyond Compare, Final Builder
  • Cloud Services and Cloud Deployment

Delphi XE2

  • FireMonkey Win32/Win64/Mac Business Application Platform (HD and 3D)
  • Windows 64-bit and Mac development
  • VCL Styles
  • RTL support for Windows and Mac
  • LiveBindings for VCL and FireMonkey
  • DataSnap Monitoring and Control
  • DataSnap Connectors
  • dbExpress drivers for Mac, Windows 64-bit and new dbExpress ODBC driver
  • Cloud API support for Amazon
  • Deployment Manager and Platform assistant

Delphi XE3

  • Metropolis UI Applications for Delphi VCL and FireMonkey
  • FireMonkey Enhancements for XE3 including support for DirectX 10
  • FireMonkey support for Gestures, Anchors, Actions and Multimedia
  • VCL and FireMonkey sensor/device framework
  • VCL style support for Ribbon Controls
  • InterBase ToGo (embeddable SQL database) support for Windows and Mac
  • SQLite database support
  • Visual LiveBindings Designer and LiveBindings Enhancements
  • Entitlement List and Provisioning page for Sandboxing Mac OS X Applications
  • Mac OS X 10.8 (Mountain Lion) and Retina Display support

2013

All of the Delphi innovations, multiple platforms, FireMonkey, database support and multi-tier architectures have moved us forward into the next major advancement for Delphi: multi-device application development across Windows, Mac, iOS and Android.

If you want to see what’s coming soon for Delphi, join the product team at the Delphi Mobile Preview Webinar next Thursday (7 days after Valentine’s day), February 21, 2013.  The mobile preview webinar will take place three times to cover the planet Earth:

Delphi and RAD Studio Mobile Preview Webinar
Thursday, February 21, 2013
6:00AM PST / 9:00AM EST / 14:00 UTC
11:00AM PST / 2:00PM EST / 19:00 UTC
5:00PM PST / 8:00PM EST /
12:00PM 22-Feb Australia EDT

The new Delphi and RAD Studio development solution for iOS is coming soon. Now is a great time to get started on the path toward multi-device application development across Windows, Mac, iOS and then Android. Join us for this informative webinar to learn why mobile development is becoming increasingly important and the Delphi solution for mobile development.

  • Mobile opportunities for Delphi and RAD Studio developers
  • Developing iOS apps with Delphi from IDE to simulator to device
  • Delphi mobile UI and style tips
  • Data connectivity options with InterBase and SQLite for your mobile apps

Register and join the fun next Thursday athttp://forms.embarcadero.com/forms/AMUSCA1302RADMobilePreviewWebinar2-21

C++BuilderXE3 64-bit compiler - a compendium of my blog and video posts

For those of you who have been following my blog the past three months, you know I have been posting information and videos about our new C++Builder XE3 64-bit Windows compiler.  This blog post contains the 64-bit related videos and articles in one place so that you can easily find the links.  You can find my calendar of C++Builder XE3 31 videos at http://www.embarcadero.com/products/cbuilder/how-to-create-software-applications. You can also find the list of the CodeRage 7 C++ technical session replays at http://www.embarcadero.com/coderage/coderage-7-c-sessions.Post a comment and let me know if there additional 64-bit topics you want me to cover.

C++Builder XE3 64-bit blog and quick video posts

Watch/Download the C++Builder 64-bit Compiler Preview Video

Additional details about the 64-bit C++Builder compiler are available in the preview video.  Watch the C++ 64-bit compiler preview video on YouTube at http://www.youtube.com/watch?v=PwwMpBUoR6Y. You can also download the MP4 video file at http://cc.embarcadero.com/item/29197.  The preview video is 9 minutes long.

Try the C++Builder 64-bit compiler

The C++Builder XE3 and RAD Studio XE3 free trial downloads have been updated to include the new C++Builder 64-bit compiler.  Trial downloads are available at https://downloads.embarcadero.com/free/c_builder

Combining multiple image effect filters in your C++ FireMonkey applications

In previous blogs and videos, I showed you how to use the FireMonkey image effect components and image effect filters in your C++Builder XE3 Windows and Mac applications. "January 14 - Using Pixel Shader Image Effects in your C++Builder XE3 Windows and Mac apps" showed you how to use an image effect component in the UI of your application.  "January 19 - Using Image Effect Filters in your C++Builder XE3 Windows and Mac apps" showed you how to use a single effect filter and save the output bitmap to a file.  To use two or more image effect filters together to produce the desired bitmap output you can set an image filter’s InputFilter property.  According to the Embarcadero DocWiki entry: "Use InputFilter with a stack of filters when you want to put the result of one filter in the input of another filter. For example, if the result of Filter1 is used in Filter2, use the statement Filter2->InputFilter = Filter1;".

Here is an example C++ FireMonkey HD application source code and header file for a simple example that connects two image effects:  Sepia Filter and Magnify Filter.

Multiple Image Effect Demo Forms Designer and Structure Window

Multiple Image Effect Demo Forms Designer and Structure Window

MainForm.h:

//---------------------------------------------------------------------------

#ifndef MainFormH
#define MainFormH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <FMX.Controls.hpp>
#include <FMX.Forms.hpp>
#include <FMX.Objects.hpp>
#include <FMX.Types.hpp>
#include <FMX.Dialogs.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:	// IDE-managed Components
	TImage *Image1;
	TImage *Image2;
	TButton *OpenButton;
	TOpenDialog *OpenDialog1;
	TSaveDialog *SaveDialog1;
	TTrackBar *SepiaTrackBar;
	TLabel *Label1;
	TButton *SaveButton;
	TLabel *Label2;
	TTrackBar *MagnifyTrackBar;
	void __fastcall OpenButtonClick(TObject *Sender);
	void __fastcall FormCreate(TObject *Sender);
	void __fastcall SepiaTrackBarChange(TObject *Sender);
	void __fastcall SaveButtonClick(TObject *Sender);
private:	// User declarations
public:		// User declarations
    TFilterSepia * MySepiaFilter;
    TFilterMagnify * MyMagnifyFilter;
	__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif

MainForm.cpp:

//---------------------------------------------------------------------------

#include <fmx.h>
#pragma hdrstop
#include "FMX.Filter.hpp"
#include "FMX.Filter.Effects.hpp"
#include "MainForm.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.fmx"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
	: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::OpenButtonClick(TObject *Sender)
{
	if (OpenDialog1->Execute()) {
		Image1->Bitmap->LoadFromFile(OpenDialog1->FileName);
		SaveButton->Enabled = true;
		MySepiaFilter->Input = Image1->Bitmap;
		MySepiaFilter->Amount = SepiaTrackBar->Value / 100;
		MyMagnifyFilter->Center = TPointF(Image1->Bitmap->Width/2,Image1->Bitmap->Height/2);
		MyMagnifyFilter->Radius = 0.35;
		MyMagnifyFilter->InputFilter = MySepiaFilter; // set the Magnify Filter's input to the Sepia output
		MyMagnifyFilter->Magnification = MagnifyTrackBar->Value;
		Image2->Bitmap = MyMagnifyFilter->Output;
	}
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormCreate(TObject *Sender)
{
	MySepiaFilter = new TFilterSepia(this);
	MyMagnifyFilter = new TFilterMagnify(this);
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SepiaTrackBarChange(TObject *Sender)
{
	MySepiaFilter->Amount = SepiaTrackBar->Value / 100;
	MyMagnifyFilter->InputFilter = MySepiaFilter;
	MyMagnifyFilter->Magnification = MagnifyTrackBar->Value;
	Image2->Bitmap = MyMagnifyFilter->Output;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::SaveButtonClick(TObject *Sender)
{
	if (SaveDialog1->Execute()) {
		Image2->Bitmap->SaveToFile(SaveDialog1->FileName);
	}
}
//---------------------------------------------------------------------------

The following are screen captures of the demo application and the resulting saved bitmap:

I have also uploaded the complete project to CodeCentral at http://cc.embarcadero.com/item/29314

31 C++Builder XE3 videos in January - Jan 31 - Building a C++ multi-tier master/detail Customer and Sales database app

During each day of January 2013, I am creating a new video showing you how to use the new C++Builder XE3 compilers for Win32, Win64 and OSX to create multi-platform, database, multi-tier, HD and 3D applications. In this thirty-first video you’ll learn how to build a multi-tier, master/detail customer and sales C++ database application using C++Builder XE3 and DataSnap.  In this video you’ll learn how to create a DataSnap server (Windows 32 and 64) application from scratch, add database access components and then build the DataSnap client application to display the customer and sales data. The Embarcadero DocWiki has several articles about the DataSnap architecture (http://docwiki.embarcadero.com/RADStudio/XE3/en/DataSnap_Overview_and_Architecture), how to develop multi-tier applications (http://docwiki.embarcadero.com/RADStudio/XE3/en/Developing_DataSnap_Applications) and Creating Master-Detail relationships (http://docwiki.embarcadero.com/RADStudio/XE3/en/Creating_Master-Detail_Relationships).  This is the last of my 31 C++ videos in January 2013.  I hope you enjoyed all of the videos.  Post comments on my blog for additional videos that will help you take advantage of the great technology our C++ R&D team has put in C++Builder XE3.  You can find the complete calendar at http://www.embarcadero.com/products/cbuilder/how-to-create-software-applications.

January 31, 2013 - Building a C++ multi-tier master/detail Customer and Sales database application

Filename: 2013-01-31-CppDBMasterDetailDataSnapApp.mp4

Download: http://cc.embarcadero.com/item/29313

Watch on YouTube: http://www.youtube.com/watch?v=a3J_XMT2wzU

Duration: 12 minutes and 41 seconds

Size: 44mb

Format: MP4

Watch/Download the C++Builder 64-bit Compiler Preview Video

Additional details about the 64-bit C++Builder compiler are available in the preview video.  Watch the C++ 64-bit compiler preview video on YouTube at http://www.youtube.com/watch?v=PwwMpBUoR6Y. You can also download the MP4 video file at http://cc.embarcadero.com/item/29197.  The preview video is 9 minutes long.

Try the C++Builder 64-bit compiler

The C++Builder XE3 and RAD Studio XE3 free trial downloads have been updated to include the new C++Builder 64-bit compiler.  Trial downloads are available at https://downloads.embarcadero.com/free/c_builder

31 C++Builder XE3 videos in January - Jan 30 - Building your first multi-tier DataSnap app using C++Builder XE3

During each day of January 2013, I am creating a new video showing you how to use the new C++Builder XE3 compilers for Win32, Win64 and OSX to create multi-platform, database, multi-tier, HD and 3D applications. In this thirtieth video you’ll learn how to build your first Multi-Tier C++ application using C++Builder XE3 and DataSnap.  In developing your first DataSnap server (Windows 32 and 64) applications and client (Windows and Mac) applications you will see how to use TCP/IP to call remote methods and return results.  The Embarcadero DocWiki has several articles about the DataSnap architecture (http://docwiki.embarcadero.com/RADStudio/XE3/en/DataSnap_Overview_and_Architecture) and how to develop multi-tier applications (http://docwiki.embarcadero.com/RADStudio/XE3/en/Developing_DataSnap_Applications).  In the next video (January 31) you will also learn how to build a C++ master/detail database multi-tier application using DataSnap. Stay tuned to my blog for additional C++ programming videos each day.

January 30, 2013 - Building your first multi-tier DataSnap application using C++Builder XE3

Filename: 2013-01-30-CppFirstSimpleDataSnapServerAndClient.mp4

Download: http://cc.embarcadero.com/item/29312

Watch on YouTube: http://www.youtube.com/watch?v=K8j39gGxGwc

Duration: 12 minutes and 53 seconds

Size: 44.7mb

Format: MP4

Watch/Download the C++Builder 64-bit Compiler Preview Video

Additional details about the 64-bit C++Builder compiler are available in the preview video.  Watch the C++ 64-bit compiler preview video on YouTube at http://www.youtube.com/watch?v=PwwMpBUoR6Y. You can also download the MP4 video file at http://cc.embarcadero.com/item/29197.  The preview video is 9 minutes long.

Try the C++Builder 64-bit compiler

The C++Builder XE3 and RAD Studio XE3 free trial downloads have been updated to include the new C++Builder 64-bit compiler.  Trial downloads are available at https://downloads.embarcadero.com/free/c_builder

31 C++Builder XE3 videos in January - Jan 29 - Working with 3D models in your C++Builder Windows and Mac Apps

During each day of January 2013, I am creating a new video showing you how to use the new C++Builder XE3 compilers for Win32, Win64 and OSX to create multi-platform, database, multi-tier, HD and 3D applications. In this twenty-ninth video you’ll learn how to use industry standard 3D Model files (Collada DAE, Wavefront OBJ and ASCII Scene Export ASE) in your HD and 3D Windows (Win32/Win64) and Mac OS X applications using the TModel3D component. You can use the TModel3D component on a 3D form and on an HD form using a ViewPort3D.  The Embarcadero DocWiki has an "Importing a 3D Model" tutorial at http://docwiki.embarcadero.com/RADStudio/XE3/en/Importing_a_3D_Model_in_a_FireMonkey_Application. Stay tuned to my blog for additional C++ programming videos each day.

January 29, 2013 - Working with 3D models (DAE, OBJ, ASE) in your C++Builder Windows and Mac Apps

Filename: 2013-01-29-CppModel3D.mp4

Download: http://cc.embarcadero.com/Item/29311

Watch on YouTube: http://www.youtube.com/watch?v=A39ucuECCRM

Duration: 9 minutes and 31 seconds

Size: 45.6mb

Format: MP4

Watch/Download the C++Builder 64-bit Compiler Preview Video

Additional details about the 64-bit C++Builder compiler are available in the preview video.  Watch the C++ 64-bit compiler preview video on YouTube at http://www.youtube.com/watch?v=PwwMpBUoR6Y. You can also download the MP4 video file at http://cc.embarcadero.com/item/29197.  The preview video is 9 minutes long.

Try the C++Builder 64-bit compiler

The C++Builder XE3 and RAD Studio XE3 free trial downloads have been updated to include the new C++Builder 64-bit compiler.  Trial downloads are available at https://downloads.embarcadero.com/free/c_builder

Bad Behavior has blocked 4 access attempts in the last 7 days.

Close