源码肯定有的但不能发给你是公司的产品我可以给你一个思路就是用graphic32的TPositionedLayer建一个层 GridLayer := TPositionedLayer.create(self.Layers); GridLayer.Tag :=8; GridLayer.Location := GR32.FloatRect(0, 0, self.width, self.height); GridLayer.Scaled := true; GridLayer.MouseEvents := true; GridLayer.OnPaint :=PaintSimpleDrawingHandler;在上面画网格再把这层放上顶层你在graphic32上画图就可以了画网格的代码如下 procedure PaintSimpleDrawingHandler(Sender: TObject; Buffer: TBitmap32);var Cx,Cy,i: Integer; W2,H2: Integer; XX,YY: Integer; user_w: Boolean;beginuser_w := false; with TPositionedLayer(Sender).GetAdjustedLocation do begin W2 := 0; H2 := 0; Cx := FCompartmentWidth * FGridWidth; Cy := FCompartmentWidth * FGridHeight; buffer.PenColor := clRed32; //---------------------------------------------------//下面代码用于画出一个钜形框的x线 if FCompartmentWidth < 5 then begin user_w := true; Cx := FCompartmentWidth * FGridWidth div 5; Cy := FCompartmentWidth * FGridHeight div 5; end else begin Cx := FCompartmentWidth * FGridWidth div FCompartmentWidth; Cy := FCompartmentWidth * FGridHeight div FCompartmentWidth; end; for xx := 1 to Cy do begin if user_w then i := xx * 5 else i := xx * FCompartmentWidth; //----------------------- if (xx mod FCompartmentLineNumber)=0 then buffer.PenColor := FCompartmentColor else buffer.PenColor := FGridLineColor; //------------------------ buffer.MoveTof(1, i); buffer.LineTofs(FCompartmentWidth * FGridWidth - 1, i); end; for yy := 1 to Cx do begin xx := yy; if user_w then i := xx * 5 else i := xx * FCompartmentWidth; //----------------------- if (yy mod FCompartmentLineNumber)=0 then buffer.PenColor := FCompartmentColor else buffer.PenColor := FGridLineColor; //------------------------ buffer.MoveTof(i, 1); buffer.LineTofs(i, FCompartmentWidth * FGridHeight - 1); end; buffer.PenColor := FEdgeColor; buffer.MoveTof(0, 0); buffer.LineTofs(0, FGridHeight); buffer.MoveTof(0, 0); buffer.LineTofs(FGridWidth - 1, 0); buffer.MoveTof(FGridWidth - 1, 0); buffer.LineTofs(FGridWidth - 1, FGridHeight - 1); buffer.MoveTof(0, FGridHeight - 1); buffer.LineTofs(FGridWidth, FGridHeight - 1); end;end;