Re-sizing of image in imageannotation

Jul 25, 2013 at 3:31 PM
I can display an oxyimage in a plotmodel using imageannotation.

There is a weird issue with the image zoom and resize. When I resize the window horizontally, horizontal axes changes values, which is fine, but the image also resizes, and the Y axis doesnt change. So I end with different height.

I tried to set both width and height, but then image is missing. Its a simple code. I am pasting below.
                byte[] b = new byte[160000];
                for (int i = 0; i < b.Length; i++) b[i] = 125;


                image = OxyImage.FromArgb(200, 200, b,96);

            
                model.Annotations.Add(new ImageAnnotation
                {
                    ImageSource = image,
                    X = new PlotLength(0, PlotLengthUnit.Data),
                    //Y = new PlotLength(0, PlotLengthUnit.Data),
                    Interpolate=false,
                    Width = new PlotLength(200, PlotLengthUnit.Data),

                    //Height = new PlotLength(200, PlotLengthUnit.Data),
                    //HorizontalAlignment = OxyPlot.HorizontalAlignment.Center,
                    //VerticalAlignment = OxyPlot.VerticalAlignment.Top

                });
Any tips are deeply appreciated.

PS: I checked other annotation examples, there they dont have such issue.
Jul 30, 2013 at 3:00 PM
Is it a possible bug??

If I set both width and height of imageannotation, the image is not rendered.
Aug 27, 2013 at 4:33 PM
Edited Aug 27, 2013 at 4:34 PM
I also encountered the same problem.
Is there any method can avoid this problem?
Thanks.
Aug 27, 2013 at 4:42 PM
yes. It is a bug. I posted a solution. you have to recompile after fixing here.
Aug 27, 2013 at 11:00 PM
Thank you! I have submitted the bug-fix. I also added some examples using reverse axes.
Aug 28, 2013 at 4:48 AM
BlindMonk wrote:
yes. It is a bug. I posted a solution. you have to recompile after fixing here.
Thank you very much!
I have built and tested it, it works. Your solution saved my life :)