Generally, a horizontal line or a vertical line does not have a sawtooth effect. However, if a diagonal line is drawn using a canvas, the effect may be displayed, which may affect the vision, this is caused by Pixel problems! This is also the case when drawing a graph. The Sawtooth effect is only displayed when the image is rotated, moved, or zoomed in. Normally, it will not appear when the image is placed! Of course, the same is true for images! The effect of eliminating the teeth will consume memory. Generally, if there is no effect of the teeth or it is not necessary, you do not need to use the effect of eliminating the teeth! So how can we eliminate the effect of the Sawtooth?
Method 1 (this method is only applicable to eliminating drawn images and not to images (such as Bitmap )):
This method is: Set the paint brush:
View code
1 //Anti-aliasing2Paint. setantialias (True);
Method 2 (applicable to all ):
View code
1Canvas. setdrawfilter (NewPaintflagsdrawfilter (0, Paint. anti_alias_flag2| Paint. filter_bitmap_flag ));