Write into a TImage object! * URGENT *

Greeting!

I just can't find a method to use a image object to write into it. I need to use a zone (the canvas property of the image) to draw custom shapes for a homework.

I've done this in the past and now I just don't seeem to remember how it was done.

Thank you for your time!

Best regards,
Ciprian

Comments

  • : Greeting!
    :
    : I just can't find a method to use a image object to write into it. I need to use a zone (the canvas property of the image) to draw custom shapes for a homework.
    :
    : I've done this in the past and now I just don't seeem to remember how it was done.
    :
    : Thank you for your time!
    :
    : Best regards,
    : Ciprian
    :


    It`s a page from Borland C++ Help it may be usefull

    void __fastcall TForm1::FormCreate(TObject *Sender)

    {
    THeaderSection *pSection;
    for (int i = 0; i <= 4; i++)
    {
    pSection = HeaderControl1->Sections->Add();
    pSection->Text = "Section " + IntToStr(i);
    pSection->MinWidth = pSection->Text.Length * HeaderControl1->Font->Size;
    // Owner draw every other section
    if (i % 2 == 0)
    pSection->Style = hsOwnerDraw;
    else
    pSection->Style = hsText;
    }

    }

    void __fastcall TForm1::HeaderControl1DrawSection(THeaderControl *HeaderControl, THeaderSection *Section, const TRect &Rect, bool Pressed)

    {
    if (Pressed)
    HeaderControl->Canvas->Font->Color = clRed;
    else
    HeaderControl->Canvas->Font->Color = clBlue;
    HeaderControl->Canvas->TextOut(Rect.Left + HeaderControl->Canvas->Font->Size, Rect.Top + 2, "Custom " + IntToStr(Section->Index));
    }
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion