Bonjour à tous,

Savez-vous s'il existe un équivalent de InteropBitmap dans System.Drawing ?

J'ai le code suivant :
Code C# : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
private void capGrabber_NewFrameArrived(object sender, EventArgs e)
        {
            //this.BitmapSource.Invalidate();
        }
 
        //InteropBitmap BitmapSource { get; set; }
 
        private void capGrabber_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            try
            {
                if ((_capGrabber.Width != default(int)) && (_capGrabber.Height != default(int)))
                {
                    uint pcount = (uint)(_capGrabber.Width * _capGrabber.Height * PixelFormats.Bgr32.BitsPerPixel / 8);
                    _section = CreateFileMapping(new IntPtr(-1), IntPtr.Zero, 0x04, 0, pcount, null);
                    _map = MapViewOfFile(_section, 0xF001F, 0, 0, pcount);
 
 
                    //this.BitmapSource = Imaging.CreateBitmapSourceFromMemorySection(_section, _capGrabber.Width,
                        _capGrabber.Height, PixelFormats.Bgr32, _capGrabber.Width * PixelFormats.Bgr32.BitsPerPixel / 8, 0) as InteropBitmap;
                    _capGrabber.Map = _map;
 
 
                    if (NewBitmapReady != null)
                        NewBitmapReady(this, null);
                }
            }
            catch { }
        }

Je souhaite que cela tourne sur une application console mais je ne peux pas utiliser Invalidate() sur l'InteropBitmap (le thread appelant ne peut pas y accéder...). Je souhaite seulement faire des sauvegardes de l'image sur disque toutes les X secondes. Je souhaite de plus enlever les dépendances à WPF (WindowsBase.dll...)

Merci d'avance.
Cordialement,
NeoKript