HMG Graph based on Bos Taurus
Moderator: Rathinagiri
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: HMG Graph based on Bos Taurus
That shows your kindness and pride towards your profession. Kudos.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
HMG Graph based on Bos Taurus
I see, Very extensive breeds types in cattle... sorry for my joking.srvet_claudio wrote:In this case it is not a joke and it has no double meaning the name, Bos Taurus is the scientific name of the cattle.
Your work is a true tribute to these noble animals that we enjoy so much of them...
Wikipedia (portuguese) says: Bos taurus
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Re: HMG Graph based on Bos Taurus
Any news about what's the problem about bad working library?
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: HMG Graph based on Bos Taurus
From my side, HMG.3.4.2 doesn't give this problem.
Marek can you confirm that HMG.3.4.2 is also giving problem?
This info will be useful in finding out the bug, I think.
Marek can you confirm that HMG.3.4.2 is also giving problem?
This info will be useful in finding out the bug, I think.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: HMG Graph based on Bos Taurus
I've tried with hmg342 sp4 and problem still exists.
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: HMG Graph based on Bos Taurus
I have spotted the problem with draw line.
This test code stops exactly at 9957 (for me) in HMG 3.4.3 and runs fully up to 10000 in HMG 3.4.2 (Marek, for me, 3.4.2 doesn't give problem!)
This test code stops exactly at 9957 (for me) in HMG 3.4.3 and runs fully up to 10000 in HMG 3.4.2 (Marek, for me, 3.4.2 doesn't give problem!)
Code: Select all
#include <hmg.ch>
Function Main
define window main at 0, 0 width 800 height 600 main
define button start
row 10
col 10
caption 'Start'
action start_test()
end button
define label test
row 10
col 110
value ''
end label
end window
Main.Center
Main.Activate
Return
function start_test
local j
local hBitMap, hDC, BTStruct
cfile :='image.bmp'
hBitMap := BT_BitmapCreateNew ( 2000, 2000, { 255, 255, 255 } )
hDC := BT_CreateDC( hBitMap, BT_HDC_BITMAP, @BTStruct )
for j := 1 to 10000
BT_DrawLine (hDC, 10, 10, 150, 150, { 0, 0, 0 }, { 0, 0, 0 }, 0.1 )
main.test.value := str( j )
next j
BT_DeleteDC( BTstruct )
BT_BitmapSaveFile(hBitmap, cfile )
BT_BitmapRelease( hBitmap )
return nil
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: HMG Graph based on Bos Taurus
Claudio,
c_Bos_Taurus.c file has undergone a change to BT_DRAW_HDC_POLY() from BT_DRAW_HDC_POLYLine (in Line 1053). I think the problem might be there. Can you check up please?
The above testing code will help you.
c_Bos_Taurus.c file has undergone a change to BT_DRAW_HDC_POLY() from BT_DRAW_HDC_POLYLine (in Line 1053). I think the problem might be there. Can you check up please?
The above testing code will help you.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: HMG Graph based on Bos Taurus
I've tested function drawing graphs embedded in my app. I've observed thait if you prepare small standalone sample, problem occurs later, when it's calldd from huge app, it occurs after few calls.
What I need to change? Sources of Bos Taurus?
What I need to change? Sources of Bos Taurus?
Re: HMG Graph based on Bos Taurus
Hi Marek,mol wrote:What I need to change? Sources of Bos Taurus?
Yes, it is.
For example, there is the missed cleaning of hBrush variable in the C-function BT_DRAW_HDC_POLY
This function should be fixed as below
Code: Select all
HB_FUNC( BT_DRAW_HDC_POLY )
{
HDC hDC;
HPEN hPen;
HBRUSH hBrush;
HPEN OldPen;
HBRUSH OldBrush;
INT nCountX, nCountY;
COLORREF ColorLine, ColorFill;
INT nWidthLine, nLen;
INT nPOLY, i;
#ifndef __MINGW_H
POINT aPoint [2048];
#endif
hDC = (HDC) HB_PARNL (1);
nCountX = (INT) hb_parinfa(2,0);
nCountY = (INT) hb_parinfa(3,0);
ColorLine = (COLORREF) hb_parnl (4);
nWidthLine = (INT) hb_parni (5);
ColorFill = (COLORREF) hb_parnl (6);
nPOLY = (INT) hb_parni (7);
nLen = min( nCountX, nCountY );
if ( nLen > 0 )
{
#ifdef __MINGW_H
POINT aPoint[ nLen ];
#endif
for ( i=0; i < nLen; i++ )
{ aPoint[ i ].x = hb_parvni ( 2, i + 1 );
aPoint[ i ].y = hb_parvni ( 3, i + 1 );
}
SaveDC(hDC);
hPen = CreatePen(PS_SOLID, nWidthLine, ColorLine);
OldPen = ( HPEN ) SelectObject(hDC, hPen);
hBrush = CreateSolidBrush( ColorFill );
OldBrush = ( HBRUSH ) SelectObject(hDC, hBrush);
switch( nPOLY )
{
case BT_DRAW_POLYLINE:
Polyline( hDC, aPoint, nLen );
break;
case BT_DRAW_POLYGON:
Polygon( hDC, aPoint, nLen );
break;
case BT_DRAW_POLYBEZIER:
PolyBezier( hDC, aPoint, nLen );
break;
}
SelectObject( hDC, OldBrush );
DeleteObject(hBrush);
SelectObject( hDC, OldPen );
DeleteObject(hPen);
RestoreDC(hDC, -1);
hb_retl( TRUE );
}
else
hb_retl( FALSE );
}
There are a similar bugs with the missed SelectObject calling in the others functions also.SelectObject( hDC, OldBrush );
...
SelectObject( hDC, OldPen );
Hope that helps
Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein