Board index » cppbuilder » Image->Cancas->Font question

Image->Cancas->Font question

Hi Developers,

I have following coding:

    TFont *schrift;
    schrift = new TFont();
    schrift->Name = "Copperplate Gothic Light";
    schrift->Height = -13;
    Image1->Canvas->Font = schrift;
    Image1->Canvas->TextOut(100,100, "werder");

My question: Why is the text very small, so that I cannot read anything with
height = -13.
If I set the font height for the Component Label to -13 then the text is
bigger...

Thanks for any explanation.
Mauro

 

Re:Image->Cancas->Font question


Quote
"Mauro" <maur...@gmx.de> wrote in message

news:3ee7776b@newsgroups.borland.com...

Quote
>     TFont *schrift;
>     schrift = new TFont();

<snip>

You don't need to create a second TFont instance.  Just modify the existing
one that is already present in the Canvas:

    Image1->Canvas->Font->Name = "Copperplate Gothic Light";
    Image1->Canvas->Font->Height = -13;
    Image1->Canvas->TextOut(100, 100, "werder");

Gambit

Re:Image->Cancas->Font question


Hi Remy,

thanks, this helps,
but is there a possibility to output the text transparent ??

Regards,
Mauro

"Remy Lebeau (TeamB)" <gambi...@yahoo.com> schrieb im Newsbeitrag
news:3ee77c6a$1@newsgroups.borland.com...

Quote

> "Mauro" <maur...@gmx.de> wrote in message
> news:3ee7776b@newsgroups.borland.com...

> >     TFont *schrift;
> >     schrift = new TFont();
> <snip>

> You don't need to create a second TFont instance.  Just modify the
existing
> one that is already present in the Canvas:

>     Image1->Canvas->Font->Name = "Copperplate Gothic Light";
>     Image1->Canvas->Font->Height = -13;
>     Image1->Canvas->TextOut(100, 100, "werder");

> Gambit

Re:Image->Cancas->Font question


Quote
"Mauro" <maur...@gmx.de> wrote in message

news:3ee788dd@newsgroups.borland.com...

Quote
> but is there a possibility to output the text transparent ??

TCanvas has no native support for that, so you'll have to call the Win32 API
function SetBkMode() to manipulate the underlying HDC directly:

    int oldMode = SetBkMode(Image1->Canvas->Handle, TRANSPARENT);
    Image1->Canvas->TextOut(100, 100, "werder");
    SetBkMode(Image1->Canvas->Handle, oldMode);

Gambit

Other Threads