forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


"Actual Size" Graphics?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Fri Nov 21, 2003 7:22 pm    Post subject: "Actual Size" Graphics? Reply with quote

Hi All,

This may be a dumb question... But....

What is the best way to display an "actual size" graphic to users having different screen resolutions?

For example, let's say I have a graphic file of an object that is actual size (this is, the graphic displays at the same size as the item in real life). The graphic is displayed actual size on a screen at 800x600. However, how can I allow the graphic to display at actual size on a user's screen that is set at 1024x768?

I know I can detect a user's resolution, then create separate versions of the dialog for different resolutions, but is there a way to display the graphic "actual size" without having to create separate dialogs or dialog elements?

Also, is it possible to temporarily reset a user's screen resolution when a VDS program is run, then return the screen resolution to the previously set state upon exit of the VDS program?

Thanks guys,

Keith L.
Back to top
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Fri Nov 21, 2003 7:56 pm    Post subject: Reply with quote

You can do this by using the "stretch" style with bitmap elements... Smile

Example:

Code:
%%Bitmap =

DIALOG CREATE,Nieuw Dialoog,0,0,@sysinfo(SCREENWIDTH),@sysinfo(SCREENHEIGHT),NOTITLE
  DIALOG ADD,BITMAP,BITMAP1,0,0,@sysinfo(SCREENWIDTH),@sysinfo(SCREENHEIGHT),%%Bitmap,,STRETCH
  DIALOG SHOW

wait 1

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Fri Nov 21, 2003 8:28 pm    Post subject: Reply with quote

Thanks. However, I want the dialog, as well as the "actual size" graphic, to display the same at all resolutions... Any ideas?

Thanks,

Keith L.
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sat Nov 22, 2003 5:20 pm    Post subject: Reply with quote

Perhaps using OPTION SCALE would help? Smile
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Sat Nov 22, 2003 11:47 pm    Post subject: Option scale... Reply with quote

Thanks FreezingFire, but I already tried that. The problem is that my application needs to display an "actual size" graphic of an object.

I have played with option scale, but unfortunately, different screen resolutions result in different graphic sizes on screen.

I'll keep playing with it. Hey, is there any way to temporarily change a user's screen resolution temporarily and then reset it upon closing of the program? (That is, by using API calls and/or by accessing the registry?)

Thanks,

Keith L.
Back to top
View user's profile Send private message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Sun Nov 23, 2003 12:56 am    Post subject: Reply with quote

I think CodeScript might have posted an example to do this however I'm not sure. Smile
_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Sun Nov 23, 2003 6:41 am    Post subject: Reply with quote

I think U can resize your bitmap using strech style as Skit suggested Smile
Only problem is if your bitmap is non-photograhic and contains sharp edges
like text etc. The code below should display a bitmap in real size
whatever the screen resolution. (you can extend the same to your dialog)

Code:
%%Bitmap =
REM specify here below the values form your
REM bitmap file properties
%%Bitmapwidth =
%%Bitmapheight =
REM I used 800x600 resolution as standard.
%%deltaX = @FDIV(@sysinfo(SCREENWIDTH),800)
%%deltaY = @FDIV(@sysinfo(SCREENHEIGHT),600)

%%width = @FINT(@FMUL(%%Bitmapwidth,%%deltaX))
%%height = @FINT(@FMUL(%%Bitmapheight,%%deltaY))

DIALOG CREATE,New Dialog,139,223,370,262
DIALOG ADD,BITMAP,BITMAP1,41,33,%%width,%%height,%%Bitmap,,STRETCH
DIALOG SHOW

INFO %%width|%%height


Changing the screen resolution is possible but I haven't put up any examples.
One problem is that the process may not be seamless with all display adaptors
Some of them (older ones) change the refresh rate and refuse to reset back with API
causing irritation to the end user.

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Sun Nov 23, 2003 11:48 am    Post subject: Reply with quote

If you don't put OPTION SCALE then the size of all the dialog elements stays the same, but the font sizes still change, hence the result can look odd and text might get truncated. If there's little or no text on the dialog, you can get away with it.
_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Sun Nov 23, 2003 11:58 am    Post subject: Reply with quote

I doubt that - just checked it on 800x600 and 1024x768 actual size of bitmap is quite different (much smaller with higher resolution) - whether OPTION SCALE is specified or not.
_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Sun Nov 23, 2003 3:56 pm    Post subject: Reply with quote

Hi All,
Jules is saying that when you develop your App you will want to use Option Scale so that people that use the large Font Size 120dpi as apposed to the Small Font Size 96dpi scale will be able to read fonts on your dialog too. This has nothing to do with the Bitmap element.

I am not really sure what you all are trying to do with the bitmaps Question Do you want your dialog to change with the resolution of the bitmap reguardless of the resolution of the users screen?

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Sun Nov 23, 2003 5:02 pm    Post subject: Reply with quote

mindpower wrote:
I am not really sure what you all are trying to do with the bitmaps Question

Even I am not sure why such a thing should be done -- I guess some printing etc from screen Question

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Sun Nov 23, 2003 7:25 pm    Post subject: Reply with quote

Hi Guys,

Thanks for all of your input. Cool

The solution from CodeScript is similar to a workaround I came up with and should suffice. (Thanks CodeScript!)

Actually, my dialog can vary somewhat here and there, but the important thing is to have a consistently sized graphic regardles of the enduser's display resolution.

What I need to do is for the enduser to see, on her/his screen, is the actual size of a particular object. For example, if I place a graphic of a quarter on the screen, I need the enduser to be able to see the quarter "actual size."

Thanks again,

Keith L.
Back to top
View user's profile Send private message
LiquidCode
Moderator Team


Joined: 05 Dec 2000
Posts: 1753
Location: Space and Time

PostPosted: Mon Nov 24, 2003 12:18 pm    Post subject: Reply with quote

Here is a script that you can use to detect the actual size of a bitmap without using a DLL. I have used it many times and it works great. I hope this helps. This needs VDS 4 or higher.

Code:

   rem - A script to find the size of a bitmap
   rem - create a dummy dialog without the Dialog Show
   rem - because Child dlgs are easire to distroy

   dialog create,dummy,0,0,0,0

  DIALOG CREATE,Find Bitmap Size,-1,0,221,46
   dialog ADD,STYLE,STYLE1,,,B,,004080
  DIALOG ADD,TEXT,TEXT1,16,6,76,13,Select Bitmap:
  DIALOG ADD,BUTTON,BUTTON1,14,100,64,24,Select,,HAND
   dialog SHOW

:evloop
   wait event
   goto @event()

:button1button
   %%file = @filedlg(*.bmp)
   if @ok()
      if %%file
         gosub getsize
      end
   end
   info Width@tab()%%iwidth@cr()Height@tab()%%iheight
   goto evloop

:getsize
   dialog create,temp,0,0,0,0
   dialog add,bitmap,temp,0,0,0,0,%%file
   %%iwidth = @dlgpos(temp,W)
   %%iheight = @dlgpos(temp,H)
   dialog select,2
   dialog close
   %e = @event()
   dialog select,1
   exit

:close
stop

_________________
Chris
Http://theblindhouse.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
jules
Professional Member
Professional Member


Joined: 14 Sep 2001
Posts: 1043
Location: Cumbria, UK

PostPosted: Tue Nov 25, 2003 8:48 am    Post subject: Reply with quote

CodeScript wrote:
I doubt that - just checked it on 800x600 and 1024x768 actual size of bitmap is quite different (much smaller with higher resolution) - whether OPTION SCALE is specified or not.


It's physically smaller because the number of pixels stays the same. OPTION SCALE will cause the dialog to be scaled up, but only if you use a large fonts setting which is the only way to make dialogs etc appear larger on a higher resolution desktop.

_________________
The Tech Pro
www.tech-pro.net
Back to top
View user's profile Send private message Visit poster's website
Boo
Valued Contributor
Valued Contributor


Joined: 31 Oct 2003
Posts: 599
Location: Gulf Breeze, Florida USA

PostPosted: Tue Nov 25, 2003 5:34 pm    Post subject: Reply with quote

Thanks LiquidCode! This will be useful in various apps.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group