|
On a project with several CXGraph, how can i do to save/load, because the CXGraph Load and Save work with one CXGraph, and Serialize is protected?
reg19b
|
|
|
|
|
Really a great job!!!
Here's a problem I've found:
Open the test app, double click the graph object to invoke the properties dialog. While you move this dialog around, the graph object behind it repaints incorrectly.
Look forward to a bug fix asap.
Thanks again for you great work.
Max
|
|
|
|
|
how can i get the pointer on the data (m_pData in CXGraphDataSerie), the variable is protected and there is no method get on it.
reg19b
|
|
|
|
|
You're right, this one's missing. I'll implement it in the next release.
|
|
|
|
|
Is there any other way to get the pointer m_pData
reg19b
|
|
|
|
|
Thank you for your great library. And as for scientific drawing purpose,Polor chart and smith chart are used frenquently also. Do you have any plan on it. Is it possible to
change you nice library to display other type of charts?
Thank you very much!
|
|
|
|
|
When I unzipped XGraph_demo.zip I notice the XGraph10.lib and XGraph10d.lib are already in the project. Which compiled right 1st. time. But I don't understand were XGraph10.lib came from before it was compiled. I compiled XGraph_src which gave me XGraph10d.lib. IF you took XGraph10.lib out of XGraph_demo. Are the source file there to recompile another DLL.? Am I compiling wrong? To compile I'm using mfc in a shared dll. Build XGraph10d.dll. I use MSVC++
|
|
|
|
|
Did you change to a release build?
-=- James (Sonork:100.21837)
"There is nothing worse than being oblivious to the fact that you do not know what you are doing."
[Get Check Favorites 1.5 Now!]
|
|
|
|
|
Hi!
I'm trying now for several days to implement your tool in my project. From another tool I expect something like: add the *.lib, include the *.h and make the *.dll available.
But I can't find the *.h file! There are lots of them, and when I include them I get many errors.
Thanks in advance!
Marc
|
|
|
|
|
I want to show my data in logarithmic scale. How can I do this? Please help..
|
|
|
|
|
Logarithmic scale is not implemented yet! Are there any people who figured out how this could be developped ?
François
|
|
|
|
|
x-axis-value=lg(x-value)
y-axis-value=lg(y-value)
You can use ln, log<x> etc. Scale may be different for each axis.
kiamor
|
|
|
|
|
Well! I think I can understand what you mean!
But, still, the axes won't display as logarithmic axes thanks to this.
|
|
|
|
|
If i want to use the properties dialog only with keyboard (tab key to change the activ control), there are any problems. The tab control don't get the focus and if i set the focus by click, i cannot go to next control by pressing the tab key.
In a other case, one control on an page has the focus, so i can change from one control to another by pressing the tab key. But the tab control never gor the focus.
can anybody help me
thanks
Holger
|
|
|
|
|
A very very nice piece of work !
Unfortunately, when compiled with VC++ 6, the program crashes when I invoke the Properties panel by right clicking. There's some "cannot be read" error.
Can you tell me how to fix it, please ?
A fan of your work
|
|
|
|
|
I had the same problem (compiling on VC++6.0 and executing on Windows XP) but I got rid of it by also compiling the library on the same platform and then replacing .lib and .dll used in XGraph_demo project.
|
|
|
|
|
I remove line
pDCEx->m_bMono = pDCEx->m_bPrinting = false;
in OnDrawItem() and Axis dialog and Curve dialog can work, but they sometimes be black. Do anyone know the meaning of m_bMono and m_bPrinting in CDCEx?
|
|
|
|
|
Hi,
I succeeded to get rid of the crash by changing:
CDC dc;
dc.Attach (lpDrawItemStruct->hDC);
int nSaveDC = ::SaveDC(lpDrawItemStruct->hDC);
CDCEx *pDCEx = (CDCEx*) &dc;
to:
CDCEx dc;
dc.Attach (lpDrawItemStruct->hDC);
int nSaveDC = ::SaveDC(lpDrawItemStruct->hDC);
CDCEx *pDCEx = &dc;
As CDCEx is derived from CDC (see GfxUtils.h) we can get a pointer
to the CDC portion of CDCEx by casting a pointer to CDCEx to a pointer
to CDC but the reverse is an error and may work or not work randomly
depending on the compiler.
Hope this help
JCD
|
|
|
|
|
Yep, that worked. Now, the DLL and Demo builds on my VC7 without major errors.
Many thanks !
hros
|
|
|
|
|
I have the same problem with using Properties panel.
When compiled with VC++ 6, the program crashes when I invoke the Properties panel by right clicking. There's some "cannot be read" error.
However I tried to replace .lib and .dll created with the source project.
But I compiled the source project, I recovered the .lib and .dll files, that I copy in my own project directory. But the result is the same.
I think that I did a mistake or perhaps I forgot a step.
The Properties panel works in the DemoProject but not in mine!
Seb
|
|
|
|
|
This is a really useful peice of work. Thanks very much.
However, there is one little bug that I am aware of. If you have a multiple axis graph (e.g. if you load the test.xgd ) and then re-size the window so that it is as narrow as possible (i.e. you try and make the width zero), this generates a divide by zero exception error and the application crashes.
regards,
Gary McHale
|
|
|
|
|
Could any one give me hint How I can save and reopen the Graph for editing ?
|
|
|
|
|
If u tell me your email address i can send the most recent version including property persistence.
|
|
|
|
|
Can anyone tell me how to save the graph to Bitmap Image
|
|
|
|
|
Try this (Use WriteWindowToDIB( LPTSTR szFile, CWnd *pWnd ))
HANDLE DDBToDIB( CBitmap& bitmap, DWORD dwCompression, CPalette* pPal ) <br />
{<br />
BITMAP bm;<br />
BITMAPINFOHEADER bi;<br />
LPBITMAPINFOHEADER lpbi;<br />
DWORD dwLen;<br />
HANDLE hDIB;<br />
HANDLE handle;<br />
HDC hDC;<br />
HPALETTE hPal;<br />
<br />
<br />
ASSERT( bitmap.GetSafeHandle() );<br />
<br />
if( dwCompression == BI_BITFIELDS )<br />
return NULL;<br />
<br />
hPal = (HPALETTE) pPal->GetSafeHandle();<br />
if (hPal==NULL)<br />
hPal = (HPALETTE) GetStockObject(DEFAULT_PALETTE);<br />
<br />
bitmap.GetObject(sizeof(bm),(LPSTR)&bm);<br />
<br />
bi.biSize = sizeof(BITMAPINFOHEADER);<br />
bi.biWidth = bm.bmWidth;<br />
bi.biHeight = bm.bmHeight;<br />
bi.biPlanes = 1;<br />
bi.biBitCount = bm.bmPlanes * bm.bmBitsPixel;<br />
bi.biCompression = dwCompression;<br />
bi.biSizeImage = 0;<br />
bi.biXPelsPerMeter = 0;<br />
bi.biYPelsPerMeter = 0;<br />
bi.biClrUsed = 0;<br />
bi.biClrImportant = 0;<br />
<br />
int nColors = (1 << bi.biBitCount);<br />
if( nColors > 256 ) <br />
nColors = 0;<br />
dwLen = bi.biSize + nColors * sizeof(RGBQUAD);<br />
<br />
hDC = GetDC(NULL);<br />
hPal = SelectPalette(hDC,hPal,FALSE);<br />
RealizePalette(hDC);<br />
<br />
hDIB = GlobalAlloc(GMEM_FIXED,dwLen);<br />
<br />
if (!hDIB){<br />
SelectPalette(hDC,hPal,FALSE);<br />
ReleaseDC(NULL,hDC);<br />
return NULL;<br />
}<br />
<br />
lpbi = (LPBITMAPINFOHEADER)hDIB;<br />
<br />
*lpbi = bi;<br />
<br />
GetDIBits(hDC, (HBITMAP)bitmap.GetSafeHandle(), 0L, (DWORD)bi.biHeight,<br />
(LPBYTE)NULL, (LPBITMAPINFO)lpbi, (DWORD)DIB_RGB_COLORS);<br />
<br />
bi = *lpbi;<br />
<br />
if (bi.biSizeImage == 0){<br />
bi.biSizeImage = ((((bi.biWidth * bi.biBitCount) + 31) & ~31) / 8) <br />
* bi.biHeight;<br />
<br />
if (dwCompression != BI_RGB)<br />
bi.biSizeImage = (bi.biSizeImage * 3) / 2;<br />
}<br />
<br />
dwLen += bi.biSizeImage;<br />
if (handle = GlobalReAlloc(hDIB, dwLen, GMEM_MOVEABLE))<br />
hDIB = handle;<br />
else{<br />
GlobalFree(hDIB);<br />
<br />
SelectPalette(hDC,hPal,FALSE);<br />
ReleaseDC(NULL,hDC);<br />
return NULL;<br />
}<br />
<br />
lpbi = (LPBITMAPINFOHEADER)hDIB;<br />
<br />
BOOL bGotBits = GetDIBits( hDC, (HBITMAP)bitmap.GetSafeHandle(),<br />
0L,
(DWORD)bi.biHeight,
(LPBYTE)lpbi
+ (bi.biSize + nColors * sizeof(RGBQUAD)),<br />
(LPBITMAPINFO)lpbi,
(DWORD)DIB_RGB_COLORS);
<br />
if( !bGotBits )<br />
{<br />
GlobalFree(hDIB);<br />
<br />
SelectPalette(hDC,hPal,FALSE);<br />
ReleaseDC(NULL,hDC);<br />
return NULL;<br />
}<br />
<br />
SelectPalette(hDC,hPal,FALSE);<br />
ReleaseDC(NULL,hDC);<br />
return hDIB;<br />
}<br />
<br />
BOOL WriteDIB( LPTSTR szFile, HANDLE hDIB)<br />
{<br />
BITMAPFILEHEADER hdr;<br />
LPBITMAPINFOHEADER lpbi;<br />
<br />
if (!hDIB)<br />
return FALSE;<br />
<br />
CFile file;<br />
if( !file.Open( szFile, CFile::modeWrite|CFile::modeCreate) )<br />
return FALSE;<br />
<br />
lpbi = (LPBITMAPINFOHEADER)hDIB;<br />
<br />
int nColors = 1 << lpbi->biBitCount;<br />
<br />
hdr.bfType = ((WORD) ('M' << 8) | 'B');
hdr.bfSize = GlobalSize (hDIB) + sizeof( hdr );<br />
hdr.bfReserved1 = 0;<br />
hdr.bfReserved2 = 0;<br />
hdr.bfOffBits = (DWORD) (sizeof( hdr ) + lpbi->biSize +<br />
nColors * sizeof(RGBQUAD));<br />
<br />
file.Write( &hdr, sizeof(hdr) );<br />
<br />
file.Write( lpbi, GlobalSize(hDIB) );<br />
<br />
return TRUE;<br />
}<br />
<br />
BOOL WriteWindowToDIB( LPTSTR szFile, CWnd *pWnd )<br />
{<br />
CBitmap bitmap;<br />
CWindowDC dc(pWnd);<br />
CDC memDC;<br />
CRect rect;<br />
<br />
memDC.CreateCompatibleDC(&dc); <br />
<br />
pWnd->GetWindowRect(rect);<br />
<br />
bitmap.CreateCompatibleBitmap(&dc, rect.Width(),rect.Height() );<br />
<br />
CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);<br />
memDC.BitBlt(0, 0, rect.Width(),rect.Height(), &dc, 0, 0, SRCCOPY); <br />
<br />
CPalette pal;<br />
if( dc.GetDeviceCaps(RASTERCAPS) & RC_PALETTE )<br />
{<br />
UINT nSize = sizeof(LOGPALETTE) + (sizeof(PALETTEENTRY) * 256);<br />
LOGPALETTE *pLP = (LOGPALETTE *) new BYTE[nSize];<br />
pLP->palVersion = 0x300;<br />
<br />
pLP->palNumEntries = <br />
GetSystemPaletteEntries( dc, 0, 255, pLP->palPalEntry );<br />
<br />
pal.CreatePalette( pLP );<br />
<br />
delete[] pLP;<br />
}<br />
<br />
memDC.SelectObject(pOldBitmap);<br />
<br />
HANDLE hDIB = DDBToDIB( bitmap, BI_RGB, &pal );<br />
<br />
if( hDIB == NULL )<br />
return FALSE;<br />
<br />
WriteDIB( szFile, hDIB );<br />
<br />
GlobalFree( hDIB );<br />
return TRUE;<br />
}<br />
|
|
|
|