Re: [cc2-dev-l] Drawing on a bitmap
>> hDC = CreateIC("DISPLAY", NULL, NULL, NULL);I just looked at the documentation and you are right. Thanks!
>> hdcBM = CreateCompatibleDC(hDC);
> Just to make sure... Wouldn't CreateCompatibleDC(NULL) do the
>same thing as these two lines (get a DC compatible with the
>program's display)? Not terribly relevant, just curious.
>> SetBMView(&Extents.p1, &Extents.p2, &Rect);Correct. I have added my own glue routine for this call. You can include the code below or just use some ASM lines to load the coordinates and the address to the Rect.
> I'm not sure what this call does and I can't find the prototype
>for it in the header files in the V6 XP toolkit.
void _stdcall SetBMView(void);
void XPCALL _SetBMView(GPOINT2 *Low, GPOINT2 *High, RECT *Rect)
fTmp=Low->x; __asm fld fTmp;
fTmp=Low->y; __asm fld fTmp;
fTmp=High->x; __asm fld fTmp;
fTmp=High->y; __asm fld fTmp;
__asm mov esi, Rect;
#define SetBMView _SetBMView
> What I really need to do, as it turns out, is to get the extentsYou have to scan the drawing list for this, unless you have added all infoblocks to your drawing list and have kept the extents in the header updated.
>of the picked entities and set the view to that for the duration
>of the draw. Is there a single call to get the extents on a display
>list or I need to scan through the display list on my own?
To get the extents of a drawing list:
DLScan(hMyDList, CheckExtents, DLS_Std | DLS_NOWDC, NULL, NULL);
There CheckExtents just calls EXCheck for all entities that you will draw later. You will need DLS_NOWDC if scan a temporary drawing list that doesn't contain all info blocks. Otherwise CC2 can't figure out the extents for entities like texts.
I have a file with extra glue routines that I use. If anyone likes a copy send me a private e-mail to peter@....