Hi, everybody,
    While programming with MASM using GDI functions ,a very strange matter hit me down:

       During WM_PAINT Message ,I draw a rectangle in a memory bitmap ,using MASM32 lib function "Frame3D",and bitblt this bitmap to
the current Device context.Well,it's very strange that only the top,left,and right frame of this rectangle are displayed;the bottom line got disappeared!(See attachement file)
     
        Does Anyone know why it happen like that?
       Any comments or suggestion will be appreciated.
      Thanks in advance.


Posted on 2005-11-08 08:24:01 by Luckrock
Could be a simple mathematical error (i.e. length/width +1)???
Posted on 2005-11-08 08:58:29 by SpooK
Yes,it's a simple question.
  I add  to painting height in bitblt ,have solved the problem. But the question is why bitblt not transfer ,the whole bitmap to device context,while it "cut" one line of pixels down?
  Anyway ,thanks for your help.
  Best regards.
Posted on 2005-11-08 10:25:15 by Luckrock

Yes,it's a simple question.
  I add  to painting height in bitblt ,have solved the problem. But the question is why bitblt not transfer ,the whole bitmap to device context,while it "cut" one line of pixels down?
  Anyway ,thanks for your help.
  Best regards.


I am not too keen on Windows API, but I think it has something to do with the size of the source and destination DCs. If you define the area to be copied as height,width of the source DC (rcSource.bottom - rcSource.top, rcSource.right - rcSource.left), then you lose out on the fact that the top and bottom are absolute numbers, so essentially it doesn't calculate the fact that the bottom line is also to be included as an entity. It lies under the same concept on why 0xF is 15 in decimal but is the 16th number in concession from 0 to 15 (0 counts as an entity).

Posted on 2005-11-08 12:56:59 by SpooK
Hi,Spook
        Thanks for your kind and detailed explaint for this,it make me to remember those days in Collelege ,learning the "C" array.
          Yes,it could only be explainted as the same concept as "C"  Array, An array  consisting of  " n" compoments start it index [0],while end with .
        I got this now.
        Thank you very much.
          With my best regards.
                                                                                 
          T
Posted on 2005-11-08 18:34:57 by Luckrock