Board index » cppbuilder » Please tell me.

Please tell me.

Hi! Thanks for the one who helped me last time.

i have a problem...
I used "Image2->Canvas->Ellipse(165,224,182,243);" to show a ellipse on
the image2.
How can i erase the ellipse and show out the backgroud?

it may be a simple and silly question but please help me.
Thanks a lot.

 

Re:Please tell me.


Image2->Canvas->FillRect(Image2->Canvas->ClipRect);
-goldilocks
Quote
KIN wrote:
> Hi! Thanks for the one who helped me last time.

> i have a problem...
> I used "Image2->Canvas->Ellipse(165,224,182,243);" to show a ellipse on
> the image2.
> How can i erase the ellipse and show out the backgroud?

> it may be a simple and silly question but please help me.
> Thanks a lot.

Re:Please tell me.


Thanks for telling me that.However,it doesn't work in my program.
i can't erase the ellipse which is drawn on a bitmap.
does anyone have any solution?
Please tell me.
Thanks a lot.
Quote
Jeff Cottingham wrote:
> Image2->Canvas->FillRect(Image2->Canvas->ClipRect);
> -goldilocks

> KIN wrote:

> > Hi! Thanks for the one who helped me last time.

> > i have a problem...
> > I used "Image2->Canvas->Ellipse(165,224,182,243);" to show a ellipse on
> > the image2.
> > How can i erase the ellipse and show out the backgroud?

> > it may be a simple and silly question but please help me.
> > Thanks a lot.

Re:Please tell me.


void __fastcall TForm1::Button1Click(TObject *Sender)
{
    foo = new Graphics::TBitmap;
    foo->LoadFromFile("d:\\shipping.bmp");
    Image1->Canvas->Ellipse(1,2,182,243);
Quote
}

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

void __fastcall TForm1::Button2Click(TObject *Sender)
{
   Windows::TRect bar = Rect(1,2,182,243);
   Image1->Canvas->CopyRect(bar,foo->Canvas,bar);
  }

foo is declared in the header....
-goldilocks

Quote
KIN wrote:
> Thanks for telling me that.However,it doesn't work in my program.
> i can't erase the ellipse which is drawn on a bitmap.
> does anyone have any solution?
> Please tell me.
> Thanks a lot.

> Jeff Cottingham wrote:

> > Image2->Canvas->FillRect(Image2->Canvas->ClipRect);
> > -goldilocks

> > KIN wrote:

> > > Hi! Thanks for the one who helped me last time.

> > > i have a problem...
> > > I used "Image2->Canvas->Ellipse(165,224,182,243);" to show a ellipse on
> > > the image2.
> > > How can i erase the ellipse and show out the backgroud?

> > > it may be a simple and silly question but please help me.
> > > Thanks a lot.

Re:Please tell me.


Quote
KIN wrote in message <36B2C3B3.D46CB...@hotmail.com>...
>Hi! Thanks for the one who helped me last time.

>i have a problem...
>I used "Image2->Canvas->Ellipse(165,224,182,243);" to show a ellipse on
>the image2.
>How can i erase the ellipse and show out the backgroud?

>it may be a simple and silly question but please help me.
>Thanks a lot.

You can not "undraw" stuff, if thats what your looking for.

If your drawing is made ex in OnPaint, you have to set up the drawing prior
to this, and ex. indicate that the ellipse has to be excluded.

Lars

Other Threads