آقا gc.collect() نوشتم عجب چیزیه
نمیزاره از 46 مگ میشتر بشه! برای مشاهده این لینک/عکس می بایست عضو شوید ! برای عضویت اینجا کلیک کنید
فقط یه سوال البته میدونم زیاد سوال پرسیدم ببخشد شما رو هم اذیت کردم این gc.collect() چطور فریم هایی که توی فرم چاپ شدن رو پاک نمیکنه یعنی برنامه من هیچ ایرادی توش نیفتاد ولی حافظه خالی شد! ظاهرا اشغال حافظه مال همین عکس های چاپ شده توی فرم و توی پیکچرباکس هستن یا من اشتباه میکنم؟کد:Capture capture = new Capture(); private void timer1_Tick(object sender, EventArgs e) { using (var nextFrame = capture.QueryFrame()) { if (nextFrame != null) { pictureBox1.Image = nextFrame.ToBitmap(); } } Bitmap myBitmap3 = new Bitmap(pictureBox1.Image); Color pixle1 = myBitmap3.GetPixel(100, 100); Color pixle2 = myBitmap3.GetPixel(400, 250); if (pixle1 == Color.FromArgb(24, 53, 73) || pixle2 == Color.FromArgb(24, 53,73)) { myBitmap3.MakeTransparent(Color.FromArgb(24, 53, 73)); gfx.DrawImage(myBitmap3, 1, 1); GC.Collect(); } else { GC.Collect(); } }






پاسخ با نقل قول
Bookmarks