Board index » cppbuilder » GDI+ and C++ builder 6

GDI+ and C++ builder 6


2004-11-25 07:26:23 PM
cppbuilder37
Hi,
I need Antialiasing and GDI thru vcl don't provide it. I choose GDI+ to
improve graphics rendering (smooth curves and fonts, transparency...)
I get gdiplus.zip from, i think Michel Leunen page,
www.leunen.com/cbuilder/gdiplus.html (great work)
I try a simple program (very simple) only to startup and Shutdow the GDI+
engine.
In the options, i set headers path to headers extract from gdiplus and i set
STRICT define (with _DEBUG because i m in debug mode), i put this path at
the top of headers path option.
in the .h i set
#include <windows.h>
#include <algorithm>
using std::min;
using std::max;
#include <gdiplus.h>
before
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
and i include in the private part
Gdiplus::GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;
in the .cpp
i put GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); in the
ctor
and
Gdiplus::GdiplusShutdown(gdiplusToken); in the dtor
when i try to compile i get :
[C++ Error] GdiplusEnums.h(545): E2447 'EmfPlusRecordType' must be a
previously defined enumeration tag
[C++ Warning] GdiplusHeaders.h(681): W8022 'Bitmap::Clone(const Rect
&,int)' hides virtual function 'Image::Clone()'
if i comment the 545 line (a forward declaration of the enum
'EmfPlusRecordType' ) and i link the result with the .lib from the gdiplus
it works.
Is there an option to set to remove the error without alter the header.
Thanks JML
 
 

Re:GDI+ and C++ builder 6

Ok i try to display simple text and a line but i see nothing
I catch the Form OnPaint event.
Gdiplus::Graphics graphics(Canvas->Handle);
graphics.SetTextRenderingHint(Gdiplus::TextRenderingHintSingleBitPerPixel);
Gdiplus::Font myFont(L"Arial", 16);
Gdiplus::PointF origin(10.0f,10.0f);
Gdiplus::SolidBrush black(Gdiplus::Color(255, 0, 0, 0));
graphics.DrawString(L"String rotation",-1,&myFont,origin,&black);
Gdiplus::Pen pen(Gdiplus::Color(255, 0, 0, 255));
graphics.DrawLine(&pen, 0, 0, 200, 100);
Why don't i see nothing ?
"jean-michel" < XXXX@XXXXX.COM >wrote in message
Quote
Hi,
I need Antialiasing and GDI thru vcl don't provide it. I choose GDI+ to
improve graphics rendering (smooth curves and fonts, transparency...)
I get gdiplus.zip from, i think Michel Leunen page,
www.leunen.com/cbuilder/gdiplus.html (great work)
I try a simple program (very simple) only to startup and Shutdow the GDI+
engine.

In the options, i set headers path to headers extract from gdiplus and i
set
STRICT define (with _DEBUG because i m in debug mode), i put this path at
the top of headers path option.

in the .h i set

#include <windows.h>
#include <algorithm>
using std::min;
using std::max;
#include <gdiplus.h>

before
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>

and i include in the private part
Gdiplus::GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;

in the .cpp
i put GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); in the
ctor
and
Gdiplus::GdiplusShutdown(gdiplusToken); in the dtor

when i try to compile i get :
[C++ Error] GdiplusEnums.h(545): E2447 'EmfPlusRecordType' must be a
previously defined enumeration tag
[C++ Warning] GdiplusHeaders.h(681): W8022 'Bitmap::Clone(const Rect
&,int)' hides virtual function 'Image::Clone()'

if i comment the 545 line (a forward declaration of the enum
'EmfPlusRecordType' ) and i link the result with the .lib from the
gdiplus
it works.

Is there an option to set to remove the error without alter the header.

Thanks JML




 

Re:GDI+ and C++ builder 6

It's fun it works in release but not in debug mode and when i desable the
inline expansion text are not displayed :))
Anybody knows the options set to keep the debug mode?
JML
 

{smallsort}

Re:GDI+ and C++ builder 6

jean-michel wrote:
Quote
It's fun it works in release but not in debug mode and when i desable the
inline expansion text are not displayed :))
Anybody knows the options set to keep the debug mode?
No, it seems some GDI+ functions can only be used in release mode. Don't
forget BCB doesn't offcialy support GDI+. You have to live with it.
Michel
--
----------------------------------------
Michel Leunen
mailto: see my homepage.
C++Builder, C++BuilderX, BCC5.5.1 Web site:
www.leunen.com/
----------------------------------------
 

Re:GDI+ and C++ builder 6

Thank you,
Is-it supported by C++ BuilderX?
Is there some C++6 libraries like GDI+ (smooth graphics, Antialiased Font),
speedy one. To create some hight graphical quality application (as Flash).
Jean-Michel
"Michel Leunen" < XXXX@XXXXX.COM >wrote in message
Quote
jean-michel wrote:
>It's fun it works in release but not in debug mode and when i desable
the
>inline expansion text are not displayed :))
>Anybody knows the options set to keep the debug mode?

No, it seems some GDI+ functions can only be used in release mode. Don't
forget BCB doesn't offcialy support GDI+. You have to live with it.

Michel
--
----------------------------------------
Michel Leunen
mailto: see my homepage.
C++Builder, C++BuilderX, BCC5.5.1 Web site:
www.leunen.com/
----------------------------------------
 

Re:GDI+ and C++ builder 6

jean-michel wrote:
Quote
Is-it supported by C++ BuilderX?
No, it doesn't either.
Quote
Is there some C++6 libraries like GDI+ (smooth graphics, Antialiased Font),
speedy one. To create some hight graphical quality application (as Flash).
If BCB6 has problems with GDI+, use BCB5 or the free commandline tool
instead. It seems that these compilers do not have the same problems as
BCB6 regarding GDI+.
Look here for graphical issues: www.efg2.com/Lab/
Michel
--
----------------------------------------
Michel Leunen
mailto: see my homepage.
C++Builder, C++BuilderX, BCC5.5.1 Web site:
www.leunen.com/
----------------------------------------
 

Re:GDI+ and C++ builder 6

I find this work it seemed to be a mature project
graphics32.org/wiki/pub/page/Main/HomePage
Jean-Michel
But i don't find any Components library like TEdit, TLabel .... Smooth and
clean as Flash results
"Michel Leunen" < XXXX@XXXXX.COM >wrote in message
Quote
jean-michel wrote:

>Is-it supported by C++ BuilderX?

No, it doesn't either.

>Is there some C++6 libraries like GDI+ (smooth graphics, Antialiased
Font),
>speedy one. To create some hight graphical quality application (as
Flash).

If BCB6 has problems with GDI+, use BCB5 or the free commandline tool
instead. It seems that these compilers do not have the same problems as
BCB6 regarding GDI+.
Look here for graphical issues: www.efg2.com/Lab/

Michel
--
----------------------------------------
Michel Leunen
mailto: see my homepage.
C++Builder, C++BuilderX, BCC5.5.1 Web site:
www.leunen.com/
----------------------------------------
 

Re:GDI+ and C++ builder 6

I am having relatively good success with GDI+ and I am doing many great
things with it. Under the compiler tab I set the option to treat enumerated
types as int and that has seemed to help me. I am however having a {*word*193}
problem with TStreamAdapter and the Image object.
"jean-michel" < XXXX@XXXXX.COM >wrote in message
Quote
Hi,
I need Antialiasing and GDI thru vcl don't provide it. I choose GDI+ to
improve graphics rendering (smooth curves and fonts, transparency...)
I get gdiplus.zip from, i think Michel Leunen page,
www.leunen.com/cbuilder/gdiplus.html (great work)
I try a simple program (very simple) only to startup and Shutdow the GDI+
engine.

In the options, i set headers path to headers extract from gdiplus and i
set
STRICT define (with _DEBUG because i m in debug mode), i put this path at
the top of headers path option.

in the .h i set

#include <windows.h>
#include <algorithm>
using std::min;
using std::max;
#include <gdiplus.h>

before
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>

and i include in the private part
Gdiplus::GdiplusStartupInput gdiplusStartupInput;
ULONG_PTR gdiplusToken;

in the .cpp
i put GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL); in the
ctor
and
Gdiplus::GdiplusShutdown(gdiplusToken); in the dtor

when i try to compile i get :
[C++ Error] GdiplusEnums.h(545): E2447 'EmfPlusRecordType' must be a
previously defined enumeration tag
[C++ Warning] GdiplusHeaders.h(681): W8022 'Bitmap::Clone(const Rect
&,int)' hides virtual function 'Image::Clone()'

if i comment the 545 line (a forward declaration of the enum
'EmfPlusRecordType' ) and i link the result with the .lib from the
gdiplus
it works.

Is there an option to set to remove the error without alter the header.

Thanks JML