my code :
unsingned bufsize =0;
void * buffer;
bufsize=image->createWindowsDIB(buffer,bufsize,1,8,1)
BITMAPINFO* pDIBInfo = (BITMAPINFO*)buffer;
but the content of pDIBInfo->bmiHeader->biSize ect. are zeros,so i can't display a dicom image.
A question about createWindowsDIB and BITMAPINFO
Moderator: Moderator Team
-
- Posts: 6
- Joined: Tue, 2006-07-04, 09:22
you haven't malloc memory!
unsingned bufsize =0;
void * buffer;
bufsize=image->createWindowsDIB(buffer,bufsize,1,8,1)
To use the CreateWindowsDIB function , the buffer must to malloc memory first , like this :
const int gap = (4 - image->getWidth() & 0x3) & 0x3 ;
const unsigned long bufsize = OFstatic_cast(unsigned long, image->getWidth() + gap) * OFstatic_cast(unsigned long, image->getHeight());
void * buffer=malloc(bufsize );
bufsize=image->createWindowsDIB(buffer,bufsize,1,8,1)
It will work!
void * buffer;
bufsize=image->createWindowsDIB(buffer,bufsize,1,8,1)
To use the CreateWindowsDIB function , the buffer must to malloc memory first , like this :
const int gap = (4 - image->getWidth() & 0x3) & 0x3 ;
const unsigned long bufsize = OFstatic_cast(unsigned long, image->getWidth() + gap) * OFstatic_cast(unsigned long, image->getHeight());
void * buffer=malloc(bufsize );
bufsize=image->createWindowsDIB(buffer,bufsize,1,8,1)
It will work!
Love programming!
My Blog is:
http://pacs.coocn.org
My Blog is:
http://pacs.coocn.org
-
- Posts: 99
- Joined: Tue, 2005-07-12, 13:50
- Location: Erlangen, Germany
-
- Posts: 6
- Joined: Tue, 2006-07-04, 09:22
Who is online
Users browsing this forum: Baidu [Spider] and 1 guest