今天又学到一招

mobile的自定义控件的时候

如果在onpaint里面贴图片之后出现闪屏的话就注意 了

比如在onpaint里面用这样了。

using (System.Drawing.Image im = new Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("ReflashTest.img_bound.png")))

会出现闪屏

这是应该的

因为每次刷新 进行new一次这个im对象了。所以卡了

因此 这个System.Drawing.Image im = new Bitmap(System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceStream("ReflashTest.img_bound.png"))

要写到上面去,

比如,在 属性 定义的地方写。

而不是在onpaint里面写

 

明白了吧

posted on 2010-12-13 17:27  龙ML  阅读(226)  评论(0)    收藏  举报

导航