|
Thanks for the diagram, that was helpful.
According to the documentation of the L_VecPaintDC function, the uWidth and uHeight are what would "flatten" out the vector space and make it a bitmap. Therefore, your source rectangles will be based on the values you pass to those parameters.
In your example, you are using the same values for this, which means your source rectangle is always the entire vector. To do what you're trying to accomplish, you would need to make the width and height the tile size, and then the source rectangle the entire vector space you're trying to do. In theory, these are the values you should use if I'm understanding your goal correctly:
DxfAPI.WinRect lcSource = (DxfAPI.WinRect)new Rectangle(-1200, -900, 2400, 1800); DxfAPI.WinRect lcDestination = (DxfAPI.WinRect)inDestination; // = ClientRectangle DxfAPI.WinRect lcDestinationClip = (DxfAPI.WinRect)inDestinationClip; // = e.ClipRectangle from the OnPaint event
// paint to the DC ... ThrowOnError( DxfAPI.L_VecPaintDC( lcHDC, ref m_Handle, 1200, 900, ref lcSource, IntPtr.Zero, ref lcDestination, ref lcDestinationClip, 0 ) );
|
|
Unfortunately, it appears there's a problem with the L_VecPaintDC or the documentation becuase it doesn't look like the source rectangles work unless they are completely within the bounds of the virtual width and height (uWidth, uHeight). When I used a source rectangle that was smaller than the virtual size it worked as expected and only the portion I selected was painted to the entire destination rectangle.
I have reproduced this problem and have reported it with the incident number 6810IDT. This incident will be reviewed and prioritized by our engineering department. I will contact you when I get more information from our developers.
The only way you will be able to work around this is to do the logic backwards, and apply the necessary math to alter the detination rectangle rather than the source rectangle.
If you have any more questions, please let me know.
Greg Ross LEADTOOLS Technical Support
|