PDA

View Full Version : girder osd



bujar
March 8th, 2006, 04:31 AM
Hello

Is there any method, I can tell the osd class what the current screen resolution is?

The problem i'm dealing with is:
I have my desktop resolution set to 1024x768 and I have some jpg files in 1024x768 resolution too.So they should match 1:1.
But the picture is clearly extended and the right and bottom sides of the picture are out of monitor. It looks just as if my desktop resolution was smaller, like 800x600. This happens when I try to display the picture using the example code:
ImageOSD = osd.Classes.Image:New({Fade=true})
ImageOSD:Show()
ImageOSD:Update([[C:\my_picture.jpg]])

Also StatusMessage suffers from the same problem. The code I use is:
"
JBStatuscfg = table.copy (osd.Styles.StatusGreen)
JBStatuscfg.BGColor1 = 0
JBStatuscfg.BGColor2 = 0
JBStatuscfg.BorderColor = osd.MakeARGB(255, 255, 255, 255)
JBStatuscfg.BorderSize = 0
JBStatuscfg.FontAlternateColor = osd.MakeARGB(255, 255, 123, 255)
JBStatuscfg.FontColor = osd.MakeARGB(255, 255, 0, 255)
JBStatuscfg.Color = 1
JBStatuscfg.Font = "Arial"
JBStatuscfg.FontSize = 24 --size of the font
--JBStatuscfg.Position = TOPRIGHT --overwrite this by setting X and Y directly
JBStatuscfg.TimeOut = 4000
JBStatuscfg.Transparency = 255
JBStatuscfg.TransparencyColorKey = 0
JBStatuscfg.X = 64 --X position on the screen
JBStatuscfg.Y = 800-60 --Y position on the screen

osd.StatusMessage("inited...", JBStatuscfg)
"

If you set the desktop resolution to 1024x768 then you'll see the status message pops up right at the bottom of the screen, while it should not (Y=740)

My best guess is that the osd Class somehow thinks that the screen resolution is 800x600, regardless of what is really is.

The question is how/if can I change it ?

Regards,
Jarek Burczynski

birty
March 8th, 2006, 04:53 AM
if you set Y to be 740 on a 1024*768 screen then the top of the osd will be 28 pixels from the bottom of the screen wich is almost at the bottom (and probably under the start bar) try setting it to a value closer to 650

bujar
March 8th, 2006, 05:03 AM
if you set Y to be 740 on a 1024*768 screen then the top of the osd will be 28 pixels from the bottom of the screen wich is almost at the bottom (and probably under the start bar) try setting it to a value closer to 650

D'OH!
Scratch my comment about StatusMessage - It's OK. I confused X and Y obviously, I guess I was too tired. Sorry for false report!


Jarek

bujar
March 9th, 2006, 09:19 AM
Regarding ImageOSD...

Actually, the problem was that the picture I tried to use had 72x72 DPI parameter set in it. It seems that the DPI is taken into account while displaying the picture on the screen when using ImageOSD class (or more precisely, when using DrawImage() )

I've cleared the DPI parameter in the .jpg file (used irfanview to do that) and now it is displayed the way it should.

It'd save me some hair if the DPI was ever mentioned in the girder osd documentation.

Subject closed.

Jarek