0

Let's say I have a bitmap 500px and I'm drawing a line at run time on it. When the line max point is 250px, it normally stops right in the middle of the bitmap (since the width of the bitmap is double the size of the line).

Is there a way to tell the bitmap or the Graphics.Drawline or using Matrix (not sure) to have the line go all the way til the end, like if I were zooming in?

I'm reading about Matrix Transformation, is that the right way to achieve that?

SF Developer
  • 5,244
  • 14
  • 60
  • 106
  • Matrix transformation (IIRC from graphic module from Uni) would involve a 2d array with various co-efficients against certain axis. I think this might be a bit heavyweight, cant you just double the length of the line? – brumScouse Apr 28 '14 at 23:12
  • By double the length you mean to double the X values on the array I'm passing to the GraphicsPath?? The problem is that I don't know what's the real max length of the line/curve until I add that to my array. Not sure if you mean to recalculate the values inside the array after I fill it with the right values – SF Developer Apr 28 '14 at 23:47
  • 1
    Use Graphics.ScaleTransform(). – Hans Passant Apr 29 '14 at 01:30

1 Answers1

0

Thanks to Hans Passant !!
The solution is to use the method

myGraphicsInstance.ScaleTransform(float , float);

available on the Graphics Class

SF Developer
  • 5,244
  • 14
  • 60
  • 106