Loading ...
Sorry, an error occurred while loading the content.

Re: [cc2-dev-l] Drawing on a bitmap

Expand Messages
  • Peter Olsson
    ... I just looked at the documentation and you are right. Thanks! ... Correct. I have added my own glue routine for this call. You can include the code below
    Message 1 of 3 , Aug 16, 2000
    • 0 Attachment
      >> hDC = CreateIC("DISPLAY", NULL, NULL, NULL);
      >> 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.

      I just looked at the documentation and you are right. Thanks!

      >> SetBMView(&Extents.p1, &Extents.p2, &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.

      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.

      void _stdcall SetBMView(void);

      void XPCALL _SetBMView(GPOINT2 *Low, GPOINT2 *High, RECT *Rect)
      {
      float fTmp;

      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;

      SetBMView();
      }

      #define SetBMView _SetBMView

      > What I really need to do, as it turns out, is to get the extents
      >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?

      You 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.

      To get the extents of a drawing list:

      GLINE3 Extents;

      BgnPExtents();
      DLScan(hMyDList, CheckExtents, DLS_Std | DLS_NOWDC, NULL, NULL);
      EndPExtents(&Extents);

      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@....

      Peter
    Your message has been successfully submitted and would be delivered to recipients shortly.