想用 ExtFloodFill 实现填充,遇到问题,请大虾指教:(1)
Graphics vGraphics = Graphics.FromImage(MyBitmap);
ExtFloodFill(hdc, 10, 10, ColorTranslator.ToWin32(Color.White), FillType.FLOODFILLSURFACE);
this.pictureBox1.Image = MyBitmap;填充会填满整个画布!(而画线条之类的都可以)
(2)
Graphics vGraphics = this.pictureBox1.CreateGraphics();
ExtFloodFill(hdc, 10, 10, ColorTranslator.ToWin32(Color.Blue ), FillType.FLOODFILLBORDER);可以出现填充效果,但是不能将填充效果保存在BITMAP ,或者PICTUREBOX里, 。该怎么做?
Graphics vGraphics = Graphics.FromImage(MyBitmap);
ExtFloodFill(hdc, 10, 10, ColorTranslator.ToWin32(Color.White), FillType.FLOODFILLSURFACE);
this.pictureBox1.Image = MyBitmap;填充会填满整个画布!(而画线条之类的都可以)
(2)
Graphics vGraphics = this.pictureBox1.CreateGraphics();
ExtFloodFill(hdc, 10, 10, ColorTranslator.ToWin32(Color.Blue ), FillType.FLOODFILLBORDER);可以出现填充效果,但是不能将填充效果保存在BITMAP ,或者PICTUREBOX里, 。该怎么做?
是API 函数, :)现在的问题很奇怪, 画线条到BITMAP没有问题, 而填充到BITMAP就不行!画线条和填充到PICTUREBOX里没有问题,但不能保存,因为只是屏幕上看到了效果,PictureBox.Image 没有修改。
private static extern bool ExtFloodFill(IntPtr hDC, int x, int y, int colorRefColor, FillType fillType);