|
hello
I am Develope this Program ... It is wondful .. but Blt Function make it Memory increase ...
sample code is .. .
canvas.Blt(m_pBackBuf,&client,&client);,
m_pBackBuf->Blt(m_pSufaceBuf,&client,&rcsrc);
whenever i use Blt function ,it increase memory
how do i solve this problem ...
please help me ..
thank you bye~
|
|
|
|
|
i solved this problem
DDSurface.cpp File ...
HRESULT NDDSurface::AttachClipper(LPDIRECTDRAWSURFACE7 pddSurface, int num_rects, LPRECT clip_list)
{
...
if(DirectDrawCreateClipper(0,&lpClipper,NULL) != DD_OK)
.....
Add=> if ( lpClipper )
{
lpClipper->Release();
}
}
Bye~^^
|
|
|
|
|
Can I use this in an embedded Visual C++ (eVC++ 4.0) pocketPC or Windows CE application? Is there anything I should watch out for?
|
|
|
|
|
How I can Draw Teeths In Gdi+
please Help Me I want that
and thank you
|
|
|
|
|
when I compile it in DirectX9.0, it give me link errors as following:
error LNK2019: unresolved external symbol "public: __thiscall CxImage::CxImage(void)" (??0CxImage@@QAE@XZ) referenced in function "protected: __thiscall CTestDoc::CTestDoc(void)" (??0CTestDoc@@IAE@XZ)
TestDoc.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall CxImage::~CxImage(void)" (??1CxImage@@UAE@XZ) referenced in function "public: virtual __thiscall CTestDoc::~CTestDoc(void)" (??1CTestDoc@@UAE@XZ)
TestDoc.obj : error LNK2019: unresolved external symbol "public: bool __thiscall CxImage::ReadFile(char const *,unsigned long)" (?ReadFile@CxImage@@QAE_NPBDK@Z) referenced in function "public: virtual int __thiscall CTestDoc::OnOpenDocument(char const *)" (?OnOpenDocument@CTestDoc@@UAEHPBD@Z)
TestView.obj : error LNK2019: unresolved external symbol "public: unsigned char * __thiscall CxImage::GetBits(void)" (?GetBits@CxImage@@QAEPAEXZ) referenced in function "public: virtual void __thiscall CTestView::OnDraw(class CDC *)" (?OnDraw@CTestView@@UAEXPAVCDC@@@Z)
.\Debug/Test.exe : fatal error LNK1120: 4 unresolved externals
|
|
|
|
|
Does the DirectDraw Application support the DirectX Overlay-mode?
Best regards,
Stefan
|
|
|
|
|
Hi ...
I have just tried your code but cannot get a correct color drawn.
I get a bright yellow when I called canvas.Fill(RGB(0, 255, 0);
I believe RGB(0, 255, 0) should be bright green.
Have any suggestion?
--OBeJe--
|
|
|
|
|
I want to display multiple video channels on screen using direxdraw, and try to do it in two ways:
1)create a primary surface and several overlay surfaces, with every overlay surface displaying one video channel;
2)create as many directdraw object as required, each object has its own primary and overlay surfaces.
Can i implement multiple displaying in these two ways, or is there any better ways?
Choose what i love, love what i choose.
|
|
|
|
|
It seemed that there is a bug of "Memory leak".
After inserting the following code
if(m_pScreen != NULL)
{
delete m_pScreen;
m_pScreen = NULL;
}
in HRESULT CDDCanvasImpl::Release(), it is removed.
Is that right?
|
|
|
|
|
In my project I have a memory leak only when I call
CCanvas::Blt(CCanvas *pSrcCanvas, LPRECT pDestRect, LPRECT pSrcRect);
As you wrote memory leak problem may be solved by inserting
if(m_pScreen != NULL)
{
delete m_pScreen;
m_pScreen = NULL;
}
in HRESULT CDDCanvasImpl::Release();
So, you mean that HRESULT CDDCanvasImpl::Release() will looks like:
HRESULT CDDCanvasImpl::Release()
{
HRESULT val;
if(m_pScreen != NULL)
{
delete m_pScreen;
m_pScreen = NULL;
}
val = m_pSurface->Release();
if(m_pSurface !=NULL)
{
delete m_pSurface;
m_pSurface = NULL;
}
return val;
}
But this variant is not working due to runtime error "Access violation reading location".
|
|
|
|
|
Very useful fot me ! Thanks again!;P
|
|
|
|
|
You used the Bridge structural Design Pattern in the designing this DLL. Use the right DP in the right place , very good !
I think this is one more step forward , maybe we can use Composite DP in CCanvas.
Best regards... ;);););););)
|
|
|
|
|
You used the Bridge structural Design Pattern in the designing this DLL. Use the right DP in the right place , very good !
I think this is one more step forward , maybe we can use Composite DP in CCanvas.
Best regards... ;);););););)
|
|
|
|
|
Does the code load images other than .BMP files?
The article says "You can use it to display standard image formats (BMP, Jpeg, Png, tiff...)" but the code seems to just call the LoadImage function (which will only load .BMP files).
Does anyone know how to load .JPG files using DirectDraw?
|
|
|
|
|
does anyone know how to use directx 9.0 to do image interlace. which mean, combine to image and interlace them together and display a 3D image on a second monitor(3D monitor)...
thank you..
|
|
|
|
|
Good code overall - a nice abstract layer over DirectDraw.
A prior comment about the locking performance overhead is right on target, however - many locks and unlocks are a BAD THING.
If I were you, I'd add in a batching mechanism, sorta like this:
Add methods into the Canvas class:
BeginBatchOperation(...);
EndBatchOperation(...);
Lock the surface in the Begin method, and set some sort of flag representing the lock state. Then, in subsequent graphics operations, check the lock state. If the current surface is locked, directly perform the underlying surface access; don't relock/unlock the surface. Then, when the EndBatch is called, unlock the surface and toggle the flag.
I'm guessing here, but I'd imagine you'd see an exponential increase in drawing speed
[EDIT] If you want to be really cool/safe, add in an exception mechanism if you call a begin and don't call an end... [/EDIT]
Just my $.02
Jeremy Kimball
|
|
|
|
|
DirectX vs GDI
I need more complex ways to compare the differences between DirectX and GDI. In order to prove that DirectX is much more better than using GDI.
I need like a further test of the speed between using DirectX and GDI. Or even other tests that can shoe that DirectX is better.
Can u help me thanks.
vistra.
|
|
|
|
|
Anyway,Is is possible to compile it in Dx9SDK or Dx8.1 SDK?
And I Can't find "ndmutil.h" in PlatformSDK of 2002.10 which is Dx8.1
who can help me.
|
|
|
|
|
I'm very sorry to tell you that is my mistake.But the file is so easy that you can write it by yourself:
//******************************************************************
//ndmutil.h
//******************************************************************
#define SAFEDELETE(p) if(p){ delete p; p = NULL;}
#define RELEASE(x) if(x != NULL) { x->Release(); x = NULL; }
#define ODS(a) OutputDebugString(a)
extern void DDError(HRESULT hErr, HWND hWnd);
//End
|
|
|
|
|
|
How about support for polyline and polygon?
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
before a very good idea gets canned by public opinion i thought i would modify the code to do some speed tests.
i modified it so that i could also choose to do the image drawing via the hdc extracted from the DD surface.
image.Stretch(canvas.GetDC(), 0, 0, 512, 512);
canvas.ReleaseDC();
i also added 2 tests:
1. simple redraw x 100 (invalidate(); UpdateWindow();)
2. zoom from scale factor 100 -> 1
i got the following times per redraw with the CView client rect sized at 1140x740.
Test DirectDraw DirectDrawHdc GDIHdc
-----------------------------------------------------------------
1. 0.045s 0.045s 0.090s
2. 0.042s 0.042s 0.082s
if anyone doubts the veracity of my tests or simply wants to try it themselves i am more than happy to pass on my code alterations.
regards
|
|
|
|
|
can i have your source code for the one you have changed to do the speed test.
my e-mail address is s01200760@np.edu.sg
thanks!!
vistra
|
|
|
|
|
|
Thanks for all your advice , whether affirmative or negative,I like them!!!
|
|
|
|