<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-15">
<META content="MSHTML 6.00.6000.16674" name=GENERATOR></HEAD>
<BODY style="MARGIN: 4px 4px 1px">
<DIV>Jay:</DIV>
<DIV> </DIV>
<DIV>I have been experimenting quite a bit and I've come up with some "new old" information.</DIV>
<DIV> </DIV>
<DIV>I say "new old" because, after spending the time to read some of the comments in the original code (before we modified it), I think I now have a better idea of what the designers intended and why I had/have a problem.</DIV>
<DIV> </DIV>
<DIV>If you read carefully, the xres/yres fields in Image.Raw are supposed to represent the resolution at which the pixmap was originally DEVELOPED, not the resolution of the current screen. It seems the designers went to great lengths to represent everything as screen-independent until it is actually rendered. </DIV>
<DIV> </DIV>
<DIV>The Image interface gives 3 ways of dealing with pixmaps: (1) unscaled, (2) scaled, and (3) scaled to "most appropriate". The change you and I conspired actually changes this behavior to make #2 (scaled) work as #1 (unscaled). (It probably also changes #3.) This is the behavior I want for my current program, but it changes the intent of the original interface, so I'm afraid we are going to have to revert all those changes.</DIV>
<DIV> </DIV>
<DIV>Digging deeper into Image.m3, I've discovered that it is smart-enough already to deduce the screen resolution. If you look into the ApplyScaled1 procedure, you see that it converts the current screen resolution in millimeters to pixels in order to scale the pixmap. The change we introduced, namely making Raw.xres/yres equal to the current screen resolution, effectively caused the Scaled procedure to do nothing since (ScreenDPI / ImageDPI) = 1.</DIV>
<DIV> </DIV>
<DIV>The problem that brought all this on in the first place is that my GUI was looking bad on the 1920x1200 screen. The reason I have discovered *now* is that FormsVBT apparently uses the #2 (scaled) version for pixmaps. In the old code, the interface defaulted the developed resolution of the pixmaps to be 75 dpi. At my 147+ dpi screen, the scaled implementation would effectively double the size of the pixmap when rendered on the screen in an effort to make the pixmap look the same size on the 147dpi screen that it appeared on a 75 dpi screen.</DIV>
<DIV> </DIV>
<DIV>All of this to say that the changes to Image.i3/m3 need to be undone in order to get back the original intent of the developers.</DIV>
<DIV> </DIV>
<DIV>Of course, once these changes are undone, my problem returns with the GUI looking bad on 1920x1200 at 147+ dpi. So, how to solve it properly now requires more thought.</DIV>
<DIV> </DIV>
<DIV>I need to do some more reading of the code I guess to see if there is a way already to cause FormsVBT to use unscaled for all pixmaps. Otherwise, a quick fix would be to add a new procedure to the interface that would force use of the unscaled implementation.</DIV>
<DIV> </DIV>
<DIV>Now, back to the problem of not being able to drag the subwindows, I'm still puzzled. To test my "understanding" as related above, I went back to the original Image.i3/m3, but this time changed the Scaled procedure to effectively do the same thing as Unscaled. The pixmaps render fine on the 1920x1200 monitor, but the subwindows still can't be dragged. If I back out my change to Scaled (effectively, revert to the original Image.m3), the subwindows drag with ease on the 1920x1200 monitor, but of course the pixmaps look bad. I can't explain this behavior yet. Any ideas?</DIV>
<DIV> </DIV>
<DIV>Regards,</DIV>
<DIV>Randy<BR><BR>>>> Jay <jay.krell@cornell.edu> 8/11/2008 2:41 PM >>><BR><BR>MemoryBarrier ensures that all the reads and writes before it finish before any reads and writes after it.<BR>Look at winnt.h or MSDN, as well the comment I put in explains it.<BR>It probably has no effect, since our compiler is not aggressive.<BR>What is confusing in these cases is the compiler and processor both need to be informed.<BR>There is a concurrency issue and the barrier should make extra certain to solve it.<BR><BR>Multiple monitors are not considered.<BR>Do you have them?<BR><BR>Randy, please experiment.<BR>Change the code to return hard coded numbers -- like the old 75.<BR> Either without the globals, or initialize the globals.<BR>And then add in the the various calls one at a time, ignoring their return values. <BR><BR>Furthermore, I guess you could just say:<BR><BR> IF xres = 0 THEN Init() END;<BR><BR>and<BR><BR> IF yres = 0 THEN Init() END;<BR><BR>and maybe change the globals to INTEGER.<BR>Though REAL should be 32 bits and be written atomatically.<BR><BR>The idea is, even if the code does run multiple times concurrently, it should always return the same information.<BR><BR>Anyway, like I said, try various or every combination between the two and find<BR>out which part triggers the difference, then we can think more about just that.<BR><BR>I might be able to get an expert friend to give me some help, later.<BR><BR>- Jay<BR><BR><BR>________________________________<BR><BR>Date: Mon, 11 Aug 2008 12:15:40 -0400<BR>From: rcoleburn@scires.com<BR>To: jay.krell@cornell.edu<BR>CC: wagner@elegosoft.com<BR>Subject: RE: strange problem w/new Image/ImageInit<BR><BR><BR><BR>Jay:<BR><BR><BR><BR>I tested your change, but it has no effect on the problem I am having. I also tried having the accessor functions just return a hardcoded number, but again, no effect on the problem. This is real strange to me, because if I remove ImageInit and revert Image.i3/m3 back to the way it was before, the problem disappears.<BR><BR><BR><BR>Questions,<BR><BR>1. What does the WinNT.MemoryBarrier() call do?<BR><BR>2. What would happen if this code was run by multiple threads? Are there any concurrency issues that need to be guarded?<BR><BR>3. What would happen in the case of multiple monitors at different resolutions?<BR><BR><BR><BR>Regards,<BR><BR>Randy<BR><BR>>>> Jay 8/11/2008 6:46 AM>>><BR><BR>Also try the change I just commited with ReleaseDC.<BR><BR>- Jay<BR><BR><BR>> From: jayk123@hotmail.com<BR>> To: rcoleburn@scires.com<BR>> CC: wagner@elegosoft.com<BR>> Subject: RE: strange problem w/new Image/ImageInit<BR>> Date: Mon, 11 Aug 2008 07:51:52 +0000<BR>><BR>><BR>> Randy, this makes no sense to me.<BR>> What happens if you just hardcode the numbers instead of computing them?<BR>><BR>><BR>> - Jay<BR>><BR>><BR>><BR>><BR>><BR>><BR>> ________________________________<BR>><BR>><BR>><BR>> Date: Mon, 11 Aug 2008 02:55:56 -0400<BR>> From: rcoleburn@scires.com<BR>> To: jayk123@hotmail.com<BR>> CC: Olaf Wagner<BR><BR><BR></DIV></BODY></HTML>