DPlot and Programs
Moderator: DPlotAdmin
DPlot and Programs
This isn't specific to VB (in fact I use PureBasic).....
I have just purchased DPlot and have a few questions.
If I create an EXE and would like to display a DPlot chart (without the menu choices and buttons) in my program, is it possible to add only the required DLL's with my exe?
In other words, only what's necessary to display a chart without having the user install the 'Viewer Install Program'?
Regards,
--Bob
I have just purchased DPlot and have a few questions.
If I create an EXE and would like to display a DPlot chart (without the menu choices and buttons) in my program, is it possible to add only the required DLL's with my exe?
In other words, only what's necessary to display a chart without having the user install the 'Viewer Install Program'?
Regards,
--Bob
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
Bob,
There are no "plotting DLL's" to use. Your best bet is to use DPlot Jr along with DPLOTLIB.DLL. You can launch DPlot Jr in a hidden state and have your program send data to be plotted and retrieve a bitmap of that plot. There's a fair example of this in the DPlot Jr distribution along with the source code - see btest2.exe in particular.
I'm not familiar with PureBasic and it's possible that there will be issues with the API to the DPLOTLIB routines. If you download DPlot Jr and have trouble getting the DPLOTLIB routines to work, let me know and I'll look into obtaining PureBasic.
There are no "plotting DLL's" to use. Your best bet is to use DPlot Jr along with DPLOTLIB.DLL. You can launch DPlot Jr in a hidden state and have your program send data to be plotted and retrieve a bitmap of that plot. There's a fair example of this in the DPlot Jr distribution along with the source code - see btest2.exe in particular.
I'm not familiar with PureBasic and it's possible that there will be issues with the API to the DPLOTLIB routines. If you download DPlot Jr and have trouble getting the DPLOTLIB routines to work, let me know and I'll look into obtaining PureBasic.
TextPointLabel command
Hi,
I try to use de TextPointLabel command but the documentation is a little bit confuse for me. Can you show me a synthaxe exemple for this command? I'm using vb but the exemple can be just the string itself.
________
GEORGE W. WALKER
I try to use de TextPointLabel command but the documentation is a little bit confuse for me. Can you show me a synthaxe exemple for this command? I'm using vb but the exemple can be just the string itself.
________
GEORGE W. WALKER
Last edited by guibson on Fri Feb 11, 2011 10:47 pm, edited 1 time in total.
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
Sure. Here's a simple case - you want to label the 32nd point in the 2nd curve with the label "Howdy", with the label offset from the data point 5 X units to the left and 5 Y units up.
In a macro you'd use:
One thing many VB users get confused about is that character strings in DPlot commands are delineated with "double quotation marks", but so is the command itself. If you do this in VB:
you'll get a syntax error. Instead you have to break the command up and add quotation marks, as in:
Edit: The above shows my inexperience with VB. This is equivalent and much easier:
In both cases the 6th parameter ( the 8 ) tells DPlot that the X and Y coordinates are relative to the data point's coordinates, rather than an absolute position.
If instead you had used
or
(Options omitted), then the label would be placed at X=-5, Y=5. Note that no part of a label will be drawn if the point determined by X and Y is off of the plot, even though the referenced data point may be visible.
If instead of "Howdy" we want to label the point with it's amplitude, use
which is also what you get if the label is omitted:
Please let me know if this doesn't clear it up for you.
In a macro you'd use:
Code: Select all
[SelectCurve(2)]
[TextPointLabel(32,-5,5,1,1,8,"Howdy")]
Code: Select all
ret=DPlot_Command(DocNum,"[SelectCurve(2)][TextPointLabel(32,-5,5,1,1,8,"Howdy")]")
Code: Select all
ret=DPlot_Command(DocNum,"[SelectCurve(2)][TextPointLabel(32,-5,5,1,1,8," & chr$(34) & "Howdy" & chr$(34) & ")]")
Code: Select all
ret=DPlot_Command(DocNum,"[SelectCurve(2)][TextPointLabel(32,-5,5,1,1,8,""Howdy"")]")
If instead you had used
Code: Select all
ret=DPlot_Command(DocNum,"[SelectCurve(2)][TextPointLabel(32,-5,5,1,1,0," & chr$(34) & "Howdy" & chr$(34) & ")]")
Code: Select all
ret=DPlot_Command(DocNum,"[SelectCurve(2)][TextPointLabel(32,-5,5,1,1," & chr$(34) & "Howdy" & chr$(34) & ")]")
If instead of "Howdy" we want to label the point with it's amplitude, use
Code: Select all
ret=DPlot_Command(DocNum,"[SelectCurve(2)][TextPointLabel(32,-5,5,1,1,8," & chr$(34) & "$Y" & chr$(34) & ")]")
Code: Select all
ret=DPlot_Command(DocNum,"[SelectCurve(2)][TextPointLabel(32,-5,5,1,1,8," & chr$(34) & chr$(34) & ")]")
Last edited by DPlotAdmin on Thu May 12, 2005 5:36 pm, edited 1 time in total.
Visualize Your Data
support@dplot.com
support@dplot.com
RE: TextPointLabel command
Thank you for response. It's nice when we use a package and there is help! I now understand the command and check the help file because there is an error for TextPointLabel command...
I can now see the label but is there a manner to control the arrow associated?
________
Honda cb250
I can now see the label but is there a manner to control the arrow associated?
________
Honda cb250
Last edited by guibson on Fri Feb 11, 2011 10:47 pm, edited 1 time in total.
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
What error do you mean? Perhaps I've overlooked something, but it all looks correct to me.
There's no way to specify the arrow, no. Perhaps next time.
There's no way to specify the arrow, no. Perhaps next time.
Visualize Your Data
support@dplot.com
support@dplot.com
ContourCustomColors command
Hi,
Can you show me an exemple using the ContourCustomColors method? I'm with vb6.
Thanks a lot!
________
Buy Vapormatic
Can you show me an exemple using the ContourCustomColors method? I'm with vb6.
Thanks a lot!
________
Buy Vapormatic
Last edited by guibson on Fri Feb 11, 2011 10:47 pm, edited 1 time in total.
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
Make sure you use [ContourColorScheme(2)] in conjunction with ContourCustomColors or you won't get the expected results. Other than that it's fairly straightforward. You can define up to 16 colors, and the color palette that DPlot generates will be interpolated from those colors. If you specify the same number of contour levels as the number of colors, then the colors used in the plot will be exactly the colors specified with ContourCustomColors. Say you want low values to be blue (255*65536=16711680), high values to be red (255), with green in the middle (255*256=65280). So you'd use:
[ContourColorScheme(2)][ContourCustomColors(16711680,65280,255)]
If you set the number of contour levels to 3, you'll get blue, green, and red lines or bands. If instead you use 5 levels then you'll see, from low to high, (r,g,b)=(0,0,255), (0,127,127),(0,255,0),(127,127,0),(255,0,0)
[ContourColorScheme(2)][ContourCustomColors(16711680,65280,255)]
If you set the number of contour levels to 3, you'll get blue, green, and red lines or bands. If instead you use 5 levels then you'll see, from low to high, (r,g,b)=(0,0,255), (0,127,127),(0,255,0),(127,127,0),(255,0,0)
Visualize Your Data
support@dplot.com
support@dplot.com
Re : ContourCustomColors command
Last edited by guibson on Fri Feb 11, 2011 10:47 pm, edited 1 time in total.
Symbol on a 3D Plot
Hi,
Is it possible to put one symbol for a particular point on a 3D Plot with a command?
Thanks for your great job!
________
NEVADA MARIJUANA DISPENSARY
Is it possible to put one symbol for a particular point on a 3D Plot with a command?
Thanks for your great job!
________
NEVADA MARIJUANA DISPENSARY
Last edited by guibson on Fri Feb 11, 2011 10:47 pm, edited 1 time in total.
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
No, sorry. A couple of other users have asked for the ability to plot symbols at all data points, and that feature will definitely be added in the near future. I'll also be adding the "point label" feature to 3D plots, but I haven't considered adding symbols at specific points. I'll put this one in the "give it some thought" list.
Visualize Your Data
support@dplot.com
support@dplot.com
Superpose a circle on a bitmap from DPlot Jr.
Hi,
We can? t put a symbol on a 3D plot. So, I want to put a circle on a bitmap received from Dplot. The exemple you use give us the value of X and Y relative to the cursor position on the plot. I want to do the opposite. I know the X and Y values and want to translate it to X and Y screen coordinates. Is it possible to do it with the DPLOT_PLOTMETRICS structure?
Thanks and have a good day.
________
Honda cbr900rr history
We can? t put a symbol on a 3D plot. So, I want to put a circle on a bitmap received from Dplot. The exemple you use give us the value of X and Y relative to the cursor position on the plot. I want to do the opposite. I know the X and Y values and want to translate it to X and Y screen coordinates. Is it possible to do it with the DPLOT_PLOTMETRICS structure?
Thanks and have a good day.
________
Honda cbr900rr history
Last edited by guibson on Fri Feb 11, 2011 10:47 pm, edited 1 time in total.
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
Sorry, but for 3D plots that information isn't of much use. I could add a command to return X and Y display coordinates for a given X,Y,Z... trouble is in determining what device we're asking the question about. If you're simply producing a plot in DPlot then it is simple, but I don't think that's what you're interested in. I think it might be better to expand DPLOT_PLOTMETRICS to include scaling information for 3D plots, and your program could then figure out the placement on its own.
Visualize Your Data
support@dplot.com
support@dplot.com
Image scale
Hi,
I have a problem with the plot scale. 2 plots with the same scale don't look the same. The only difference is the data. How can fix the plot? I send 2 exemples.
First plot.

Second plot with the same scale.
[/img]
________
Dodge charger (1999 concept) history
I have a problem with the plot scale. 2 plots with the same scale don't look the same. The only difference is the data. How can fix the plot? I send 2 exemples.
First plot.
Second plot with the same scale.
________
Dodge charger (1999 concept) history
Last edited by guibson on Fri Feb 11, 2011 10:47 pm, edited 1 time in total.
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
Check a couple of settings:
Select Options>Contour Options. Check the settings for the X and Y scale factors (middle of the dialog at the bottom).
Select Options>Extents/Tick Marks/Size. If "Specify plot size" is checked, make sure you use the same values on both plots.
If this only happens on saved or copied bitmaps/metafiles rather than the display, check the settings under Edit>Copy>Dimensions.
Select Options>Contour Options. Check the settings for the X and Y scale factors (middle of the dialog at the bottom).
Select Options>Extents/Tick Marks/Size. If "Specify plot size" is checked, make sure you use the same values on both plots.
If this only happens on saved or copied bitmaps/metafiles rather than the display, check the settings under Edit>Copy>Dimensions.
Visualize Your Data
support@dplot.com
support@dplot.com
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
Getting pixel coordinates for an input X,Y,Z from a 3D plot
New DPLOTLIB.DLL (download http://www.dplot.com/lib/dplotlib.zip) will do what you want. This change requires DPlot 1.9.3.8 or later. A VB example using this new feature is available at http://www.dplot.com/lib/btest7.zip.
There is currently no documentation other than what is found in the VB source, but you should be able to follow that easily. One problem we haven't mentioned: there's no way to determine from VB whether the point in question is visible or not. The VB example will draw a circle at the correct location on the screen, but that point on the plot may be obscured by other portions of the plot.
There is currently no documentation other than what is found in the VB source, but you should be able to follow that easily. One problem we haven't mentioned: there's no way to determine from VB whether the point in question is visible or not. The VB example will draw a circle at the correct location on the screen, but that point on the plot may be obscured by other portions of the plot.
Visualize Your Data
support@dplot.com
support@dplot.com
Re : Getting pixel coordinates for an input X,Y,Z from a 3D
It runs well but if we print it, there is no point! Is it possible to plot the point directly in DPlot?
Thanks for your great job!
________
Ferrari 312Pb
Thanks for your great job!
________
Ferrari 312Pb
Last edited by guibson on Fri Feb 11, 2011 10:47 pm, edited 1 time in total.
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
Print it from DPlot? No, there wouldn't be a point since the point is only drawn in the VB example. You can of course print the bitmap in VB, but the resolution won't be all that good.
Adding symbols to 3D plots in DPlot is on the to-do list, but it will be a while before this is done.
Adding symbols to 3D plots in DPlot is on the to-do list, but it will be a while before this is done.
Visualize Your Data
support@dplot.com
support@dplot.com
[DeleteThinTriangles(20)]
Hi,
I used the last version of DPlot and when I send the command [DeleteThinTriangles(20)], I received this message : Error processing this command "[DeleteThinTriangles(20)]" .
But when I used the command with th edit menu in DPlot, It works. Here is an exemple of my code :
Thanks and have a good day!
________
Plymouth Arrow History
I used the last version of DPlot and when I send the command [DeleteThinTriangles(20)], I received this message : Error processing this command "[DeleteThinTriangles(20)]" .
But when I used the command with th edit menu in DPlot, It works. Here is an exemple of my code :
Code: Select all
Ret = DPlot_Command(DocNum, "[DeleteThinTriangles(20)]")
________
Plymouth Arrow History
Last edited by guibson on Fri Feb 11, 2011 10:47 pm, edited 1 time in total.
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
Check the version number on the About box. If it isn't 1.9.3.9, you're not using the beta release that added this command.
Visualize Your Data
support@dplot.com
support@dplot.com
Re
I was with the wrong version. Now it's work. Thankyou.
Now, I try to print and send the command and nothing append. I verified the DocNum and it is ok. I verified the print spooler and nothing is send to. What should I check?
________
Herbal vaporizer forum
Now, I try to print and send the command
Code: Select all
Ret = DPlot_Command(DocNum, "[FilePrint()]")
________
Herbal vaporizer forum
Last edited by guibson on Fri Feb 11, 2011 10:47 pm, edited 1 time in total.
Re
I was with the wrong version. Now it's work. Thankyou.
Now, I try to print and send the command and nothing append. I verified the DocNum and it is ok. I verified the print spooler and nothing is send to. What should I check?
________
Chrysler Pl Platform Specifications
Now, I try to print and send the command
Code: Select all
Ret = DPlot_Command(DocNum, "[FilePrint()]")
________
Chrysler Pl Platform Specifications
Last edited by guibson on Fri Feb 11, 2011 10:47 pm, edited 1 time in total.
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
[FilePrint()] should work if you have a default printer. Another user mentioned a few days ago that this doesn't work correctly for network printers, though I haven't had a chance to confirm this and don't really understand why that wouldn't work. Please let me know what sort of printer setup you have.
Visualize Your Data
support@dplot.com
support@dplot.com
Printing issue
Effectively, it does not print on a network printer. I can print if I capture a LPT port to a network printer. If I use the command like this there is not printer dialog and no print out. If I use the command like this There is no printer dialog like expected and there is a print out.
Little bit tricky
________
CHRYSLER F PLATFORM
Code: Select all
Ret = DPlot_Command(DocNum, "[FilePrint(1)]")
Code: Select all
Ret = DPlot_Command(DocNum, "[FilePrint()]")
Little bit tricky

________
CHRYSLER F PLATFORM
Last edited by guibson on Fri Feb 11, 2011 10:47 pm, edited 1 time in total.
Printing issue
Effectively, it does not print on a network printer. I can print if I capture a LPT port to a network printer. If I use the command like this there is not printer dialog and no print out. If I use the command like this There is no printer dialog like expected and there is a print out.
Little bit tricky
________
Jaguar xjr-15
Code: Select all
Ret = DPlot_Command(DocNum, "[FilePrint(1)]")
Code: Select all
Ret = DPlot_Command(DocNum, "[FilePrint()]")
Little bit tricky

________
Jaguar xjr-15
Last edited by guibson on Fri Feb 11, 2011 10:48 pm, edited 1 time in total.
Printing issue (suite)
Hi,
If we use the FilePrint command to print a 3D graph, it can take an hour for the print out! The file in the spool is 133MB! If we use the printing solution with a metafile, DPlot return a null value with the DPlot_GetEnhMetaFile() function. How can I print a 3D graph?
Thanks for your patience...
________
STOCKS TO BUY NOW
If we use the FilePrint command to print a 3D graph, it can take an hour for the print out! The file in the spool is 133MB! If we use the printing solution with a metafile, DPlot return a null value with the DPlot_GetEnhMetaFile() function. How can I print a 3D graph?
Thanks for your patience...

________
STOCKS TO BUY NOW
Last edited by guibson on Fri Feb 11, 2011 10:48 pm, edited 1 time in total.
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
Just to make you feel better, if you could print a metafile of a 3D plot the spool file would be much, much biggerIf we use the FilePrint command to print a 3D graph, it can take an hour for the print out! The file in the spool is 133MB!

Last edited by DPlotAdmin on Wed Apr 07, 2004 1:28 pm, edited 1 time in total.
Visualize Your Data
support@dplot.com
support@dplot.com
Print solution
Hi, I solve the printing problem for 3D graph. The solution is not perfect because it print a bitmap but it works.
With the pointer to a bitmap received by the DPlot_GetBitmapEx function, you send this pointer to the following function :
You have to assign the picture to a picturebox like that :
Now you take a break and drink a cup of coffee 
________
AXELA
With the pointer to a bitmap received by the DPlot_GetBitmapEx function, you send this pointer to the following function :
Code: Select all
'Global declaration
Private Declare Function OleCreatePictureIndirect Lib "olepro32.dll" (PicDesc As PicBmp, RefIID As GUID, ByVal fPictureOwnsHandle As Long, IPic As IPicture) As Long
Private Type GUID
Data1 As Long
Data2 As Integer
Data3 As Integer
Data4(7) As Byte
End Type
Private Type PicBmp
Size As Long
Type As Long
hBmp As Long
hPal As Long
Reserved As Long
End Type
'The function
Function CreateBitmapPicture(ByVal hBmp As Long, ByVal hPal As Long) As Picture
Dim R As Long, Pic As PicBmp, IPic As IPicture, IID_IDispatch As GUID
'Fill GUID info
With IID_IDispatch
.Data1 = &H20400
.Data4(0) = &HC0
.Data4(7) = &H46
End With
'Fill picture info
With Pic
.Size = Len(Pic) ' Length of structure
.Type = vbPicTypeBitmap ' Type of Picture (bitmap)
.hBmp = hBmp ' Handle to bitmap
.hPal = hPal ' Handle to palette (may be null)
End With
'Create the picture
R = OleCreatePictureIndirect(Pic, IID_IDispatch, 1, IPic)
'Return the new picture
Set CreateBitmapPicture = IPic
End Function
Code: Select all
Picture1.Picture = CreateBitmapPicture(hBitmap, 0)
'You print the picture with the following command
Printer.PaintPicture Picture1.Picture, 0, 0

________
AXELA
Last edited by guibson on Fri Feb 11, 2011 10:48 pm, edited 1 time in total.
- DPlotAdmin
- Posts: 2312
- Joined: Tue Jun 24, 2003 9:34 pm
- Location: Vicksburg, Mississippi
- Contact:
FilePrint(1) should now be fixed in the beta version just uploaded. You can get it here: http://www.dplot.com/beta/dplotbeta.exe (link changed to normal download). Please let me know if this fix does not work... but I'm reasonably certain it will.Effectively, it does not print on a network printer. I can print if I capture a LPT port to a network printer. If I use the command like this Code:
Ret = DPlot_Command(DocNum, "[FilePrint(1)]")
there is not printer dialog and no print out. If I use the command like thisCode:
Ret = DPlot_Command(DocNum, "[FilePrint()]")
There is no printer dialog like expected and there is a print out.
Last edited by DPlotAdmin on Fri Apr 28, 2006 10:16 pm, edited 1 time in total.
Visualize Your Data
support@dplot.com
support@dplot.com