Page 1 of 3
DPlot and Programs
Posted: Tue Jul 08, 2003 9:28 am
by Blueb
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
Posted: Tue Jul 08, 2003 12:29 pm
by DPlotAdmin
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.
Posted: Wed Jul 09, 2003 9:12 am
by Blueb
Ok, Thanks.
It'll take a few days to convert the VB include file over to Pure, then I'll try to use with DPlot Jr.
Bob
TextPointLabel command
Posted: Wed Mar 10, 2004 9:23 pm
by guibson
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
Posted: Wed Mar 10, 2004 10:23 pm
by DPlotAdmin
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:
Code: Select all
[SelectCurve(2)]
[TextPointLabel(32,-5,5,1,1,8,"Howdy")]
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:
Code: Select all
ret=DPlot_Command(DocNum,"[SelectCurve(2)][TextPointLabel(32,-5,5,1,1,8,"Howdy")]")
you'll get a syntax error. Instead you have to break the command up and add quotation marks, as in:
Code: Select all
ret=DPlot_Command(DocNum,"[SelectCurve(2)][TextPointLabel(32,-5,5,1,1,8," & chr$(34) & "Howdy" & chr$(34) & ")]")
Edit: The above shows my inexperience with VB. This is equivalent and much easier:
Code: Select all
ret=DPlot_Command(DocNum,"[SelectCurve(2)][TextPointLabel(32,-5,5,1,1,8,""Howdy"")]")
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
Code: Select all
ret=DPlot_Command(DocNum,"[SelectCurve(2)][TextPointLabel(32,-5,5,1,1,0," & chr$(34) & "Howdy" & chr$(34) & ")]")
or
Code: Select all
ret=DPlot_Command(DocNum,"[SelectCurve(2)][TextPointLabel(32,-5,5,1,1," & chr$(34) & "Howdy" & chr$(34) & ")]")
(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
Code: Select all
ret=DPlot_Command(DocNum,"[SelectCurve(2)][TextPointLabel(32,-5,5,1,1,8," & chr$(34) & "$Y" & chr$(34) & ")]")
which is also what you get if the label is omitted:
Code: Select all
ret=DPlot_Command(DocNum,"[SelectCurve(2)][TextPointLabel(32,-5,5,1,1,8," & chr$(34) & chr$(34) & ")]")
Please let me know if this doesn't clear it up for you.
RE: TextPointLabel command
Posted: Fri Mar 12, 2004 3:45 am
by guibson
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
Posted: Fri Mar 12, 2004 9:03 am
by DPlotAdmin
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.
ContourCustomColors command
Posted: Tue Mar 23, 2004 11:42 am
by guibson
Hi,
Can you show me an exemple using the ContourCustomColors method? I'm with vb6.
Thanks a lot!
________
Buy Vapormatic
Posted: Tue Mar 23, 2004 12:21 pm
by DPlotAdmin
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)
Re : ContourCustomColors command
Posted: Tue Mar 23, 2004 12:37 pm
by guibson
Thanks a lot, it runs very, very well!!!
________
Ford gyron history
Symbol on a 3D Plot
Posted: Thu Mar 25, 2004 5:15 pm
by guibson
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
Posted: Thu Mar 25, 2004 5:28 pm
by DPlotAdmin
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.
Superpose a circle on a bitmap from DPlot Jr.
Posted: Tue Mar 30, 2004 3:30 pm
by guibson
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
Posted: Tue Mar 30, 2004 11:51 pm
by DPlotAdmin
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.
Image scale
Posted: Wed Mar 31, 2004 3:01 pm
by guibson
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
Posted: Wed Mar 31, 2004 3:10 pm
by DPlotAdmin
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.
Getting pixel coordinates for an input X,Y,Z from a 3D plot
Posted: Mon Apr 05, 2004 2:45 pm
by DPlotAdmin
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.
Re : Getting pixel coordinates for an input X,Y,Z from a 3D
Posted: Mon Apr 05, 2004 7:36 pm
by guibson
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
Posted: Mon Apr 05, 2004 8:09 pm
by DPlotAdmin
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.
[DeleteThinTriangles(20)]
Posted: Tue Apr 06, 2004 9:50 am
by guibson
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 :
Code: Select all
Ret = DPlot_Command(DocNum, "[DeleteThinTriangles(20)]")
Thanks and have a good day!
________
Plymouth Arrow History
Posted: Tue Apr 06, 2004 10:02 am
by DPlotAdmin
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.
Re
Posted: Tue Apr 06, 2004 11:51 am
by guibson
I was with the wrong version. Now it's work. Thankyou.
Now, I try to print and send the command
Code: Select all
Ret = DPlot_Command(DocNum, "[FilePrint()]")
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
Re
Posted: Tue Apr 06, 2004 12:07 pm
by guibson
I was with the wrong version. Now it's work. Thankyou.
Now, I try to print and send the command
Code: Select all
Ret = DPlot_Command(DocNum, "[FilePrint()]")
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
Posted: Tue Apr 06, 2004 12:27 pm
by DPlotAdmin
[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.
Printing issue
Posted: Tue Apr 06, 2004 5:52 pm
by guibson
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: Select all
Ret = DPlot_Command(DocNum, "[FilePrint(1)]")
there is not printer dialog and no print out. If I use the command like this
Code: Select all
Ret = DPlot_Command(DocNum, "[FilePrint()]")
There is no printer dialog like expected and there is a print out.
Little bit tricky
________
CHRYSLER F PLATFORM
Printing issue
Posted: Tue Apr 06, 2004 7:54 pm
by guibson
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: Select all
Ret = DPlot_Command(DocNum, "[FilePrint(1)]")
there is not printer dialog and no print out. If I use the command like this
Code: Select all
Ret = DPlot_Command(DocNum, "[FilePrint()]")
There is no printer dialog like expected and there is a print out.
Little bit tricky
________
Jaguar xjr-15
Printing issue (suite)
Posted: Tue Apr 06, 2004 8:05 pm
by guibson
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
Posted: Tue Apr 06, 2004 9:17 pm
by DPlotAdmin
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!
Just to make you feel better, if you
could print a metafile of a 3D plot the spool file would be much, much bigger
. [
edit: actually the spool file would be about the same size either way. The metafile would be enormous, though) There's no mistake. Though I've never waited more than 10 minutes or so, 3D files are huge relative to XY plots. If you can do w/o the resolution, use lower print quality (lower resolution) settings.
Print solution
Posted: Wed Apr 07, 2004 1:23 pm
by guibson
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 :
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
You have to assign the picture to a picturebox like that :
Code: Select all
Picture1.Picture = CreateBitmapPicture(hBitmap, 0)
'You print the picture with the following command
Printer.PaintPicture Picture1.Picture, 0, 0
Now you take a break and drink a cup of coffee
________
AXELA
Posted: Wed Apr 07, 2004 1:41 pm
by DPlotAdmin
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.
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.