Atalasoft
Welcome to Atalasoft Community Sign in | Join | Help
in

How to draw a rectangle the fast way?

Last post 04 Oct 2007, 5:15 AM by DPZ. 4 replies.
Sort Posts: Previous Next
  •  27 Sep 2007, 8:53 AM 12600

    How to draw a rectangle the fast way?

    Hi,

     at the moment I'm programming a tool, in which I need to draw rectangles into tif-images. The problem I have is, that the drawing is very slow, it lasts about one second until the rectangle is drawn. But I need it much more faster so that there is nearly no delay.

    So my question is: How can I perform the drawing of a rectangle faster? I tried it with the draw.rectangle-method, I tried it pixel-by-pixel and also with copying a box with the size of the rectangle into the image with the merge-method.

    Is there any other way to do this?

     I hope you can help me with this problem.

     Thanks for your answers, with kind regards

    DPZ

  •  28 Sep 2007, 1:32 AM 12606 in reply to 12600

    Re: How to draw a rectangle the fast way?

    try the rendering-functions (and doublebuffer = true), or do you need to save the rectangles in the image?

     

    Oliver

     

  •  02 Oct 2007, 6:25 AM 12618 in reply to 12606

    Re: How to draw a rectangle the fast way?

    Hi,

     thanks for your answer, I'll try this solution as soon as possible. I don't have to save the rectangles, but they are changing their position very often (it's a mouse move event).

    If I use the rendering-functions, how can I manually call it, without using the DoubleBufferPaintAfter-Event, or is this not possible? I'm quite new to ImgX and don't have much experiance with it, so my questions might sound stupid for you, but I don't know how to do it :D

    DPZ

  •  04 Oct 2007, 2:37 AM 12627 in reply to 12618

    Re: How to draw a rectangle the fast way?

    the movement should not be a problem, we do the same thing, we show a rectangle with text beside the mouse cursor. The DoubleBufferPaintAfter-event should be calles automatically, if not, you may of course call it, as you need it.

    Oliver

     

  •  04 Oct 2007, 5:15 AM 12628 in reply to 12627

    Re: How to draw a rectangle the fast way?

    Hello again,

     after several hours I managed to be able to draw some images by using the rendering-functions. But the problem I have now, is that I need to get the rendered "objects" on top of the imported image, not behind it. If I use the image as backgroundimage it is no problem, but because I need zoom the image etc. I can't take it as backgroundimage (or can I and I only don't know how?)

    Edit: Now I am able to display the rendered object, I call the update-method and it is shown correctly. But along with this goes a new problem: My Buttons and Comboboxes etc. are not displayed correctly anymore, they are just white blanks in my form and the whole program gets very slow. If I remove the update-call it is as fast as before, but it doesn't show the rectangle anymore ...

    So how can I solve this new problem?

    Edit2: Problem solved, thanks for yout tip with the rendering functions !

    DPZ

View as RSS news feed in XML