0

i'm using a Integration.elementhost and inside this a canvas with a Image (i render with an opengl device into the imagesource...

i want to handle the interaction stuff now. Mousemove, up und down is working. But no mousewheel... In an prototype with a simple canvas it works. But not in my main appliction?! Do i need something special for the mousewheel event?

this here is my code:

  public ViewControl(View theView)
  {
     itsZVis = theView.Vis;
     itsView = theView;
     itsViewCanvas = new ViewCanvas(theView);
     Dock = System.Windows.Forms.DockStyle.Fill;

     itsViewImage = new System.Windows.Controls.Image();
     itsElementHost = new System.Windows.Forms.Integration.ElementHost();
     Controls.Add(itsElementHost);

     System.Windows.Controls.Canvas aBackgroundPanel = new System.Windows.Controls.Canvas();

     itsElementHost.Child = aBackgroundPanel;




     itsElementHost.Dock = DockStyle.Fill;
     aBackgroundPanel.Children.Add(itsViewImage);

     itsViewImage.MouseDown += itsViewImage_MouseDown;
     itsViewImage.MouseUp += itsViewImage_MouseUp;
     itsViewImage.MouseMove += itsViewImage_MouseMove;
     itsViewImage.MouseWheel += itsViewImage_MouseWheel;
  }

and by a traversing method (called by mousemove!) the ImageSource is changed after creating the image:

     // convert to bitmap
     var Image = System.Windows.Media.Imaging.BitmapSource.Create(iWidth, iHeight, 96d, 96d, ImageFormat, null, ipRGB, iBuffer, iStride);


     itsViewImage.Source = Image;

0 Answers0