Canvas Origin lazarus / 39-Graphics ---------------------------------------------------------------------- JimKueneman · 2017-05-06 17:06 Is there the concept of the viewport origin in TCanvas that I an change the definition of what 0, 0 means to the drawing functions?  I have a large viewport of rectangles and would like to move them around in the client window by changing the origin of the canvas, that way I can always draw the rectangle to the point that I have defined its upper left corner to be. Thanks, Jim ---------------------------------------------------------------------- taazz · 2017-05-06 18:50 Quote from: JimKueneman on May 06, 2017, 07:06:21 pmIs there the concept of the viewport origin in TCanvas that I an change the definition of what 0, 0 means to the drawing functions?  I have a large viewport of rectangles and would like to move them around in the client window by changing the origin of the canvas, that way I can always draw the rectangle to the point that I have defined its upper left corner to be. Not to my knowledge. I have a custom canvas that supports something similar in my simplegraph's port to lcl at https://sourceforge.net/projects/evssimplegraph/ it has two properties offsetx, offsety which are used internally to offset the coordinates of the canvas drawing methods only. I do not know how useful this would be to you (not much I assume) at least you'll have a starting point. ---------------------------------------------------------------------- User137 · 2017-05-07 11:07 You can make a temporary TBitmap size it to the viewport. Draw graphics in it and finally draw the bitmap on the main canvas. Any graphics that you draw that go over boundaries of the bitmap are clipped out. ---------------------------------------------------------------------- Thaddy · 2017-05-07 11:27 Maybe you can move a TPaintbox around in your case, given left-top. [edit] Just tested that. Works pretty good...