Crainiate Community

Support and discussion for users of Crainiate component software products
Welcome to Crainiate Community Sign in | Join | Help
in Search

PreRender bug ?

Last post 12-20-2007 5:52 PM by Ireneusz Patalas. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 12-04-2007 2:09 PM

    PreRender bug ?

    Hello,

    I found weird behavior of the control. I guess it might be a bug. I have my own mechanism of drawing a watermark on the diagram (similar to the one in the docs), which is drawn in the overrided OnPreRender method of the Render object.
    Generally it works perfectly, but in one special condition I found it is probably called after the elements are drawn, because watermark is above the elements. It happens during the drag & drop operation on the elements, just after you mousedown over the element and move the mouse a little. Until you release the button the watermark is drawn on top. The same happens even if the elements movement is blocked (AllowMove = false). A semi-transparent UpdateElement is created in both situations and it's the only element that is drawn above the watermark.
     

    Filed under:
    • 87.105.212.19
  • 12-07-2007 8:30 AM In reply to

    Re: PreRender bug ?

    I will look into this for you,

    Best wishes,
    James

    • 212.183.134.130
  • 12-07-2007 8:44 AM In reply to

    Re: PreRender bug ?

    Thank you, I'm looking forward to the feedback.
    • 87.105.212.19
  • 12-19-2007 8:38 PM In reply to

    Re: PreRender bug ?

    When an element is updated by the user, the existing rendered diagram is cached and the semi-transparent copy of the element you see on the screen is drawn over the top. When customising the renderer, you will draw any custom rendering over this cached bitmap if you do not check the Locked property.

    The updated sample from the help file should look like this

    protected override void OnPreRender(System.Drawing.Graphics graphics)
    {
        
        if (!Locked && Watermark != string.Empty)
        {
            SolidBrush brush = new SolidBrush(Color.FromArgb(128,Color.LightGray));
            Font font = new Font("Arial",72,FontStyle.Bold);
    
            graphics.TextRenderingHint = TextRenderingHint.AntiAlias;
            graphics.DrawString(Watermark, font, brush, new PointF(30,30));
            graphics.TextRenderingHint = TextRenderingHint.SystemDefault;
    
     
    
            base.OnPreRender (graphics);
        }
    }
    
    

     

    • 86.142.154.35
  • 12-20-2007 5:52 PM In reply to

    Re: PreRender bug ?

    Thank you very much. Works perfectly.
    • 62.12.164.170
Page 1 of 1 (5 items)