View previous topic :: View next topic |
Author |
Message |
coylen
Joined: 13 Mar 2009 Posts: 1
|
Posted: Fri Mar 13, 2009 6:00 am Post subject: Problem with Plotmetrics |
|
|
I have had a look round the forum and can't find any previous posts of this problem, my appologies if it is already elsewhere.
I have been interfacing with dplot using the dplotlib to achieve some graphing functions with VB.net 2008. I have been using the DPLOT_GetBitmapEx function and have noticed a strange anomoly.
It would appear that when the bitmap requested becomes small that the program whilst retruning the requested sized bitmap does not provide the correct metrics as it changes the bitmap from being one drawn at the requested size to one that is generated at the default size and then scaled to the requested size.
In way of example when i request a 310×344 bitmap the retuned metrics are:
hll=55
vll=300
hur=292
vur=34
whereas a small chane in requested size 265×344 returns:
hll=55
vll=644
hur=512
vur=34
given the rest of the information returned i cannot find the size of the plot on which the metrics are based and therefore cannot work out how to scale the metrics to suit the retruned bitmap.
Am I doing something stupid? |
|
Back to top |
|
|
DPlotAdmin Site Admin
Joined: 24 Jun 2003 Posts: 2311 Location: Vicksburg, Mississippi
|
Posted: Fri Mar 13, 2009 9:43 am Post subject: |
|
|
No, you aren't doing anything stupid. The bitmap scaling was added fairly recently and I didn't think to update the "metrics" values. I'll spend some time on this over the weekend. Off the top of my head... if the requested width or height are less than 300 pixels then both are both multiplied by whatever power of 2 makes them > 300. So dividing hll, vll, etc. by that same scale factor should give you the correct answers. One obvious problem is that the result often won't be a whole number. So whatever you're doing with those values may be off by 1 pixel. _________________ Visualize Your Data
support@dplot.com |
|
Back to top |
|
|
DPlotAdmin Site Admin
Joined: 24 Jun 2003 Posts: 2311 Location: Vicksburg, Mississippi
|
Posted: Mon Jun 01, 2009 4:34 pm Post subject: |
|
|
Fixed in version 2.2.3.4
Quote: | Bug fix: Starting with version 2.2.2.7, if a bitmap was requested with width or height less than 300 pixels, then DPlot multiplies those values by whatever power of 2 achieves a width and height > 300, then resizes the bitmap by that same scale factor. This all works well, but the associated DPLOT_PLOTMETRICS values obtained with DPlot_GetBitmapEx were those for the larger bitmap, not the bitmap returned. This made it impossible to scale mouse position to plot space (unless, of course, your program knew the scale factor used by DPlot). |
_________________ Visualize Your Data
support@dplot.com |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|