nanogui: Thread: Re: Possible cause of portrait mode stray line bug - part2


[<<] [<] Page 1 of 1 [>] [>>]
Subject: Re: Possible cause of portrait mode stray line bug - part2
From: "Greg Haerr" ####@####.####
Date: 15 Dec 1999 03:29:11 -0000
Message-Id: <007201bf469a$d4c2b020$15320cd0@gregh>

: I think the problem is in a much more devious place.  I looked
: at the modification to SelectObject, where you reverse the xres
: and yres if psd->flags&PSF_PORTRAIT is set.  This causes
: the draw code to use the bitmap y/x reversed.  HOWEVER,
: when creating the bitmap using CreateBitmap further on down
: in wingdi.c, you'll see that we determine the amount of memory
: based on some calculations of width and height that are NOT
: reversed.  I think the bug is that the bitmap memory isn't the
: right size, after y/x are reversed.  A simple solution might
: be to try reversing width and height in that procedure,
: but I didn't try that yet....  What do you think?

Martin - 
    I tried reversi width and height and, whaddya know,
the bug disappears, but the 3d image is clipped on the right
side of the image.  I've been messing with it, but don't
quite have it.  Perhaps you could take a look at it.
It appears the bug is definitely associated with offscreen
memory, but manifests itself when other windows draw into
that memory??

Greg

Subject: Re: Possible cause of portrait mode stray line bug - part2
From: Martin Jolicoeur ####@####.####
Date: 15 Dec 1999 21:27:43 -0000
Message-Id: <3858063D.B181E169@visuaide.com>

Greg,

I found the bug !

It is very MicroWindows-specific ! Thanks for pointing me out that the
CreateCompatibleBitmap function. The problem is that this function
modify linelen and it should not ! In portrait mode, keep in mind that
even offscreen memory is in portrait mode and that linelen is not the
width of the bitmap but the height ...  For example, for 8bpp, change
the line #797 to bytelen = linelen = nHeight; and line #808 to size =
bytelen * nWidth;

Since its microwindows specific, that'sprobably why I didn't see this
when testing with blitting over nanox. :-)

Do you think you could take care of this for me ? I'm not very familiar
with microwindows stuff ... That could imply a couple of #ifdef
PORTRAIT_MODE (or check with PSF_PORTRAIT bit ) in this function and
everything would be fine...

Regards,

Martin Jolicoeur
GVT Project
####@####.####

Greg Haerr wrote:

> : I think the problem is in a much more devious place.  I looked
> : at the modification to SelectObject, where you reverse the xres
> : and yres if psd->flags&PSF_PORTRAIT is set.  This causes
> : the draw code to use the bitmap y/x reversed.  HOWEVER,
> : when creating the bitmap using CreateBitmap further on down
> : in wingdi.c, you'll see that we determine the amount of memory
> : based on some calculations of width and height that are NOT
> : reversed.  I think the bug is that the bitmap memory isn't the
> : right size, after y/x are reversed.  A simple solution might
> : be to try reversing width and height in that procedure,
> : but I didn't try that yet....  What do you think?
>
> Martin -
>     I tried reversi width and height and, whaddya know,
> the bug disappears, but the 3d image is clipped on the right
> side of the image.  I've been messing with it, but don't
> quite have it.  Perhaps you could take a look at it.
> It appears the bug is definitely associated with offscreen
> memory, but manifests itself when other windows draw into
> that memory??
>
> Greg
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail: ####@####.####

Subject: RE: Possible cause of portrait mode stray line bug - part2
From: Greg Haerr ####@####.####
Date: 15 Dec 1999 21:44:06 -0000
Message-Id: <796896539E6CD311B0E70060083DFEFB077896@NBA-SLAM.CenSoft.COM>

: Do you think you could take care of this for me ? I'm not very familiar
: with microwindows stuff ... That could imply a couple of #ifdef
: PORTRAIT_MODE (or check with PSF_PORTRAIT bit ) in this function and
: everything would be fine...


Great.  I'll fix it tonight ;-)
[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.