bounds:Returns the TRect for a rectangle of given dimensions.function Bounds(ALeft, ATop, AWidth, AHeight: Integer): TRect;DescriptionCall Bounds to obtain a TRect for a rectangle with upper left corner at the point (ALeft, ATop) with width AWidth and height AHeight.

解决方案 »

  1.   

    Tcanvas.brushcopy:Copies a portion of a bitmap onto a rectangle on the canvas, replacing one of the colors of the bitmap with the brush of the canvas. procedure BrushCopy(const Dest: TRect; Bitmap: TBitmap; const Source: TRect; Color: TColor);DescriptionUse BrushCopy to achieve special effects such as making the copied image partially transparent. BrushCopy is provided mainly for backward compatibility. Use a TImageList instead of BrushCopy.Dest specifies the rectangular portion of the canvas that will receive the copy of the bitmap. Bitmap specifies the graphic to copy from. Source specifies the rectangular area of Bitmap to copy. Color specifies the color in Bitmap to replace with the Brush of the canvas.To use BrushCopy to make the copied image partially transparent, specify the color of the surface of the canvas (clBackground for example) as the Color of the Brush property, then call BrushCopy.if(pbitmap):
    判断的应该是pbitmap指向的不为空则往pcanvas中画图
      

  2.   

    全答上来?哥们你这不是出难题吗?万一有人会一样也不敢说了if(pbitmap){}里的这句啥意思?
    相当于
    if(NULL!=pbitmap){...}if(pbitmap)是判断啥的啊?
    判断pbitmap是否为不空的指针bounds()是啥?
    bounds()是把四个整型数合成一个TRect类型的值,呀呀,不知道在BCB中是怎么定义的。请问pcanvas->brushcopy()这方法是怎么定义的啊,啥用?
    TCanvas::BrushCopy()在Delphi中叫TCanvas.BrushCopy: 
    procedure BrushCopy(const Dest: TRect; Bitmap: TBitmap; const Source: TRect; Color: TColor);
    void BrushCopy( const TRect &Dest, TBitmap &Bitmap, cosnt TRect &Source, TColor Color ); // 在BCB中是不是这样定义的,我只是瞎猜的,猜不对不要打我,我会解释Delphi版本的。
    从位图Bitmap的一个矩形范围(Source)中复制到这个Canvas的一个矩形范围(Dest),其中在Bitmap中颜色值为Color的象素将会用这个Canvas的Brush(画刷)来代替。就是说用Canvas.Brush来画颜色值等于Color参数的值的部分,当然仅仅在Dest矩形块中。