LEADTOOLS Support
Imaging
Imaging SDK Questions
RasterImagePainter.Paint doesn't allow for sub-pixel positioning
#1
Posted
:
Wednesday, July 1, 2015 12:33:06 AM(UTC)
Groups: Registered
Posts: 1
Hi,
I'm currently trying to use the RasterImagePainter.Paint() method to draw an image to my System.Drawing.Graphics object.
However, I have the requirement for sub-pixel positioning of the image. This is because there are cases where I perform a scale (enlarge) transform on the graphics object.
Since the RasterImagePainter.Paint() method only accepts a LeadRect which in turn consists of integers, I can only position on 'whole' pixels.
What I need is something like the System.Drawing.Graphics.DrawImage() overload, which accepts floats for the image target position and size.
Is there any way to accomplisch this with LEADTOOLS directly? I prefer to not first having to convert my RasterImage to a GDI+ image and then use Graphics.Draw(), which is my current workaround.
Please let me know if the question is not clear or if you need more information.
Thanks!
#2
Posted
:
Thursday, July 2, 2015 12:13:38 AM(UTC)
Groups: Registered, Tech Support
Posts: 179
Like you noticed, the coordinates accepted by our RasterImagePainter.Paint() method overloads are all integers. Although we have another rectangle type for double values (LeadRectD), it is not used in any of the Paint methods.
One thing you could do is use the ChangeToImage() method for converting the Leadtools.RasterImage to a GDI+ System.Drawing.Image. If your bitmap is compatible, this method does not copy the data, which causes little overhead when you use it.
Edited by moderator Friday, March 17, 2017 6:21:38 PM(UTC)
| Reason: Not specified
Mohamed Abedallah
Developer Support Engineer
LEAD Technologies, Inc.
![LEAD Logo LEAD Logo](https://www.leadtools.com/images/new-site-images/leadtools-logo-header.png)
LEADTOOLS Support
Imaging
Imaging SDK Questions
RasterImagePainter.Paint doesn't allow for sub-pixel positioning
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.