Jump to content
Software FX Community

DDB bitmap and DIB sections


User (Legacy)
 Share

Recommended Posts

Hello!

I uses ChartFX client/server and I found out that some time the method

export returned me empty picture when I try to export picture from chart.

Same behaviour you could look when you want simply show chart but it repeat

only when there are a few application are runed in the system and these

applications intensivly use CreateCompatibleBitmap. I learned this problem

and knew that in the export method you use API function

CreateCompatibleBitmap which creates bitmap in the system paged pool but it

is limited by system and it is one per whole system. You should use

CreateDIBSection to create bitmap in the user memory.

Thanks and goodluck!

Link to comment
Share on other sites

You are incorrect when saying "CreateCompatibleBitmap which creates bitmap

in the system paged pool but it

is limited by system and it is one per whole system". This is not true and

can be easily proved by a little program. Simply write a program that calls

this API many times, you can have a LOT of these created at the same time.

You mentioned you are calling the Export method. What parameters are you

passing to it ?

You also failed to mention what version of Chart FX you are using

(Client/Server, Internet ?, Version number ?).

--

FP

Software FX, Inc.

Link to comment
Share on other sites

Hello!

#include "stdafx.h"

#include "windows.h"

int main(int argc, char* argv[])

{//printf("Hello World!\n");

HDC hdc = ::GetDC(0);

HBITMAP hBmp;// = 1;

long nCount = 0;

do

{

hBmp = ::CreateCompatibleBitmap( hdc, 400,400 );

if(hBmp)

nCount++;

}

while( hBmp );

printf( "Count of DDB bitmaps = %d", nCount );

getchar();

return 0;

}

You could run this test and know how many bitmap can be created on your

system. On some computer in my company nCount was only 28 and if you create

a few of this test you will know that the count of this bitmap one for whole

system. The count of bitmap depend on a system and configuration. But a lot

of application in a system uses this API function and creates bitmap.

Best regards Kirill

"SoftwareFX Support" <support@softwarefx.com> wrote in message

news:ucDtEjfqDHA.1900@WEBSERVER1...

> You are incorrect when saying "CreateCompatibleBitmap which creates bitmap

> in the system paged pool but it

> is limited by system and it is one per whole system". This is not true and

> can be easily proved by a little program. Simply write a program that

calls

> this API many times, you can have a LOT of these created at the same time.

>

> You mentioned you are calling the Export method. What parameters are you

> passing to it ?

>

> You also failed to mention what version of Chart FX you are using

> (Client/Server, Internet ?, Version number ?).

>

> --

> FP

> Software FX, Inc.

>

>

Link to comment
Share on other sites

What OS where these computers running ?

Let me clarify that Chart FX RELEASES the bitmap as soon as the export

operation finishes, so this mean that even in this case where only 28 can be

created (this is probably windows 9x systems) you can have 28 Threads

SIMULTANEOUSLY creating a chart. You can however export as many charts as

you want sequentially.

If this is not the case, please let me know. If the case is that after

calling export SEQUENTIALLY you get a failure this might be a bug that we

need to look into. Are you running Chart FX in a "server" type of

application where many threads are created ?

Can you elaborate a little bit about your architecture ?

--

FP

Software FX, Inc.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...