DPlot Forum Index DPlot
http://www.dplot.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DPlot and Programs
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    DPlot Forum Index -> Basic
View previous topic :: View next topic  
Author Message
Blueb



Joined: 08 Jul 2003
Posts: 4
Location: Vancouver Island, Canada

PostPosted: Tue Jul 08, 2003 9:28 am    Post subject: DPlot and Programs Reply with quote

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
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Tue Jul 08, 2003 12:29 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Blueb



Joined: 08 Jul 2003
Posts: 4
Location: Vancouver Island, Canada

PostPosted: Wed Jul 09, 2003 9:12 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
guibson



Joined: 10 Mar 2004
Posts: 54

PostPosted: Wed Mar 10, 2004 9:23 pm    Post subject: TextPointLabel command Reply with quote

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


Last edited by guibson on Fri Feb 11, 2011 10:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Wed Mar 10, 2004 10:23 pm    Post subject: Reply with quote

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:
[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:
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:
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:
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:
ret=DPlot_Command(DocNum,"[SelectCurve(2)][TextPointLabel(32,-5,5,1,1,0," & chr$(34) & "Howdy" & chr$(34) & ")]")

or
Code:
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:
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:
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.
_________________
Visualize Your Data
support@dplot.com


Last edited by DPlotAdmin on Thu May 12, 2005 5:36 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
guibson



Joined: 10 Mar 2004
Posts: 54

PostPosted: Fri Mar 12, 2004 3:45 am    Post subject: RE: TextPointLabel command Reply with quote

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


Last edited by guibson on Fri Feb 11, 2011 10:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Fri Mar 12, 2004 9:03 am    Post subject: Reply with quote

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.
_________________
Visualize Your Data
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
guibson



Joined: 10 Mar 2004
Posts: 54

PostPosted: Tue Mar 23, 2004 11:42 am    Post subject: ContourCustomColors command Reply with quote

Hi,

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
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Tue Mar 23, 2004 12:21 pm    Post subject: Reply with quote

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)
_________________
Visualize Your Data
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
guibson



Joined: 10 Mar 2004
Posts: 54

PostPosted: Tue Mar 23, 2004 12:37 pm    Post subject: Re : ContourCustomColors command Reply with quote

Thanks a lot, it runs very, very well!!!
________
Ford gyron history


Last edited by guibson on Fri Feb 11, 2011 10:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
guibson



Joined: 10 Mar 2004
Posts: 54

PostPosted: Thu Mar 25, 2004 5:15 pm    Post subject: Symbol on a 3D Plot Reply with quote

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


Last edited by guibson on Fri Feb 11, 2011 10:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Thu Mar 25, 2004 5:28 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
guibson



Joined: 10 Mar 2004
Posts: 54

PostPosted: Tue Mar 30, 2004 3:30 pm    Post subject: Superpose a circle on a bitmap from DPlot Jr. Reply with quote

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


Last edited by guibson on Fri Feb 11, 2011 10:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Tue Mar 30, 2004 11:51 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
guibson



Joined: 10 Mar 2004
Posts: 54

PostPosted: Wed Mar 31, 2004 3:01 pm    Post subject: Image scale Reply with quote

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]
________
[URL=http://www.dodge-wiki.com/wiki/Dodge_Charger_(1999_concept)]Dodge charger (1999 concept) history[/URL]


Last edited by guibson on Fri Feb 11, 2011 10:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Wed Mar 31, 2004 3:10 pm    Post subject: Reply with quote

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.
_________________
Visualize Your Data
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Mon Apr 05, 2004 2:45 pm    Post subject: Getting pixel coordinates for an input X,Y,Z from a 3D plot Reply with quote

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.
_________________
Visualize Your Data
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
guibson



Joined: 10 Mar 2004
Posts: 54

PostPosted: Mon Apr 05, 2004 7:36 pm    Post subject: Re : Getting pixel coordinates for an input X,Y,Z from a 3D Reply with quote

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


Last edited by guibson on Fri Feb 11, 2011 10:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Mon Apr 05, 2004 8:09 pm    Post subject: Reply with quote

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.
_________________
Visualize Your Data
support@dplot.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
guibson



Joined: 10 Mar 2004
Posts: 54

PostPosted: Tue Apr 06, 2004 9:50 am    Post subject: [DeleteThinTriangles(20)] Reply with quote

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:
Ret = DPlot_Command(DocNum, "[DeleteThinTriangles(20)]")


Thanks and have a good day!
________
Plymouth Arrow History


Last edited by guibson on Fri Feb 11, 2011 10:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Tue Apr 06, 2004 10:02 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
guibson



Joined: 10 Mar 2004
Posts: 54

PostPosted: Tue Apr 06, 2004 11:51 am    Post subject: Re Reply with quote

I was with the wrong version. Now it's work. Thankyou.

Now, I try to print and send the command
Code:
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


Last edited by guibson on Fri Feb 11, 2011 10:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
guibson



Joined: 10 Mar 2004
Posts: 54

PostPosted: Tue Apr 06, 2004 12:07 pm    Post subject: Re Reply with quote

I was with the wrong version. Now it's work. Thankyou.

Now, I try to print and send the command
Code:
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


Last edited by guibson on Fri Feb 11, 2011 10:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Tue Apr 06, 2004 12:27 pm    Post subject: Reply with quote

[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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
guibson



Joined: 10 Mar 2004
Posts: 54

PostPosted: Tue Apr 06, 2004 5:52 pm    Post subject: Printing issue Reply with quote

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 this
Code:
Ret = DPlot_Command(DocNum, "[FilePrint()]")
There is no printer dialog like expected and there is a print out.

Little bit tricky Smile
________
CHRYSLER F PLATFORM


Last edited by guibson on Fri Feb 11, 2011 10:47 pm; edited 1 time in total
Back to top
View user's profile Send private message
guibson



Joined: 10 Mar 2004
Posts: 54

PostPosted: Tue Apr 06, 2004 7:54 pm    Post subject: Printing issue Reply with quote

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 this
Code:
Ret = DPlot_Command(DocNum, "[FilePrint()]")
There is no printer dialog like expected and there is a print out.

Little bit tricky Smile
________
Jaguar xjr-15


Last edited by guibson on Fri Feb 11, 2011 10:48 pm; edited 1 time in total
Back to top
View user's profile Send private message
guibson



Joined: 10 Mar 2004
Posts: 54

PostPosted: Tue Apr 06, 2004 8:05 pm    Post subject: Printing issue (suite) Reply with quote

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... Wink
________
STOCKS TO BUY NOW


Last edited by guibson on Fri Feb 11, 2011 10:48 pm; edited 1 time in total
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Tue Apr 06, 2004 9:17 pm    Post subject: Reply with quote

Quote:
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 Smile. [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.
_________________
Visualize Your Data
support@dplot.com


Last edited by DPlotAdmin on Wed Apr 07, 2004 1:28 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
guibson



Joined: 10 Mar 2004
Posts: 54

PostPosted: Wed Apr 07, 2004 1:23 pm    Post subject: Print solution Reply with quote

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:

'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:

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 Very Happy
________
AXELA


Last edited by guibson on Fri Feb 11, 2011 10:48 pm; edited 1 time in total
Back to top
View user's profile Send private message
DPlotAdmin
Site Admin


Joined: 24 Jun 2003
Posts: 2310
Location: Vicksburg, Mississippi

PostPosted: Wed Apr 07, 2004 1:41 pm    Post subject: Reply with quote

Quote:
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.
_________________
Visualize Your Data
support@dplot.com


Last edited by DPlotAdmin on Fri Apr 28, 2006 10:16 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    DPlot Forum Index -> Basic All times are GMT - 5 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
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