Re: Add a logo to hard copy



"Jim Y" <j.s.yablonsky@xxxxxxxxxxxxxx> wrote in message
news:jq_0f.377481$5N3.115710@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

> . . . I have no clue as to what I should do to remove the
> previous image.

Since the code displays each picture at an appropriate "correct aspect ratio
size" inside a fixed size rectangle then all you need to do is to fill that
fixed size rectangle with a solid block of background colour just before you
draw each picture. Something like:

Me.ScaleMode = vbInches
Me.Line (blockX, blockY)-(blockX + blockwide, _
blockY + blockhigh), Me.BackColor, BF
Me.PaintPicture p1, blockX + dX, blockY + dY, outWide, outHigh

> What I am attempting to do is give the user the ability to view
> any Logo of his/her choosing and after reviewing several, make
> the selection.

Some versions of Windows do a fairly decent job of displaying image
thumbnails in standard Explorer window and other versions do not. There are
probably VB controls or APIs that enable you to replicate such
functionality. However, there is no doubt that the very best way to show the
user thumbnails of the images is to write your own standard VB code to do
so, because it gives you absolute control over what the user sees and also
because it will work exactly as you wish on all versions of Windows. In your
current code you are showing the user one thumbnail at a time, and making
him click the "button" again in order to select the next image from a file
list. A far better way would be to write code to allow the user to select a
directory (rather than a file) and to then automatically search that
directory for image files of the appropriate type and show a thumbnail of
each image in a scrollable window, so that the user could simply scroll up
and down the list and click on the image he wants to use. However, I think
that perhaps you might be wise to leave that until you have got the rest of
your program up and running (you can always add such functionality at a
later date).

> I plan having the screen display the Logo at the
> same (?) size as printed on paper.

That is very easy if you simply mean that you want the "logical size" of the
image to be the same on the screen as it is on paper. In fact, that is what
your code already does (the printer SaleMode and the Form ScaleMode are both
set to vbInches and in both cases the width is set by the value of the
"OutWide" variable and the height is set by the "OutHigh" variable. However,
I think that you might in fact mean something quite different, and if you do
then that is not so easy to do. All measurements used by your computer are
"logical" units of measurement. By that I mean all units that are supposed
to represent real world units of measurement (inches, centimeters, points,
twips) have exactly the same relationship one to the other as they do in the
real world (there are 2.54 logical centimeters in a logical inch just as
there are 2.54 real world centimeters in a real world inch. However, a
logical inch is not necessary the same *physical size* as a real world inch.
(I've just checked back over this paragraph to check for "typos" and I've
realised that I am automatically spelling "centimetres" as "centimeters"!
Bloody hell! I'm turning into an American! I'll be havin' syrup on my eggs
next!

Anyway, on a typical printer (virtually all printers, I think) a logical
inch *is* exactly the same size as a real world inch (that is how printers
were designed), but on the screen a logical inch is *not* the same size as a
real world inch. Is that what you mean? Do you want them to both be the same
size? If so then there are ways of writing code to approximate such a
result, but in order to do so you have got to ask the user what size monitor
he is using or alternatively get that information from examining the
hardware (which on the majority of systems is impossible to do). Even if you
do manage to get that information (from the hardware or from the user) then
it is still only "guesswork".

For example, suppose that a system is running on a typical 19 inch monitor.
(These measurements, as you probably already know, refer to the diagonal
size of the display). On such a monitor the width of the display will be
about 13.5 inches if it is a CRT monitor and about 14.5 inches if it is LCD
display (I'm only guessing these figures, but I expect they are pretty
close). You can then very easily write code to check the current resolution
and if it is (say) 1024 x 768 pixels then there are 1024/14.5 = 70 pixels
per real world inch. Now if that machine happens to be running at what used
to be called the "standard small fonts setting" (but is now called something
else in XP) then it will have 96 pixels per logical inch. So, as you can
see, on such a machine a "logical inch" (as displayed on the screen) is
quite a bit larger than a "real world inch" (as exists in the real world and
as would be output to your printer). There are of course many other possible
combinations of monitor size and screen pixel area and "Windows font size"
settings. Add to the that fact that you usually won't know the size of the
monitor (unless you ask the user) and also the fact that (especially with
CRT monitors) the "size" (17 inch, 19 inch or whatever) was printed on the
box by the manufacturer's Sales Manager instead if its Technical Manager and
you have an almost impossible job on your hands. (CRT monitors usually quote
the diagonal size of the actual TV tube, some of which is actually hidden
inside the plastic monitor case - for example a high quality "17 inch
monitor" made by a reputable company may have an actual "viewable diagonal
size" a whole inch larger (16 inches or so) than a poor quality "17 inch
monitor" from a less reputable company, which may have a viewable diagonal
size of about 15 inches. All in all, about the best you can do is ask the
user what size monitor he uses and then write code to examine the display
settings and make a rough guess as to the ratio between "logical inches" and
"real world inches", which will enable you to adjust your output accordingly
when drawing your pictures to the screen. Personally, I wouldn't bother and
I would just treat logical inches as though they were real world inches
(after all, that's what professionally produced applications do when you ask
for a "100 per cent" view of your page or whatever).

By the way, if you go to Windows Control Panel and double click the Display
applet and click the Setting Tab followed by the Advanced button you will
see display pixels per inch setting (its called "Font Size" in Win98). Click
the drop down list against Font Size and select "Other". A window should pop
up with a drawing of a "ruler" on it (okay, I should have said a "rule" - a
"ruler" is a King or a Queen, I know that already!). If you click the mouse
on this ruler you will be able to drag it so that it changes magnification.
Hold a "real world" ruler up against the screen and drag the diaplayed ruler
until the meaurements match exactly and then click OK (these settings
require a restart). When you restart your computer you will find that your
computer's displayed "logical inches" are now exactly the same size as real
world inches. Most people don't do that of course, because there is no real
need to, but it's a bit of fun to check it out. By the way, the above
instructions apply to Win98, but it is pretty much the same in WinXP.

Mike





.