Virtual screen
Re: Virtual screen
eXpress++ scaling doesn't work with graphic images.
This must be handled at the OS level.
This must be handled at the OS level.
The eXpress train is coming - and it has more cars.
Re: Virtual screen
Right ... so try to think "other" Wayunixkd wrote:You can never know the type of screen resolution that your would be client will have.
my Calendar Listview have "fix" Row for 24 Hour / Day.
now i let User choise Font/Size in Setup.
than i calculate, using GraQueryTextBox() / GetTextExtentPoint32A(), how much space i need for a Refence SLE -> Scale Factor
so User have to choise a Font which let him see hole Form.

as Roger say you have to begin with smallest Font/Size which can be scale up.
also all your GRA painting should recognize "real" native Screens Size.
greetings by OHR
Jimmy
Jimmy
Re: Virtual screen
if you have a Image on SDD/HDD than you just have to GraBitBlt() to resize it.Eugene Lutsenko wrote:But my question was different: if the program already creates an image with high resolution, is there a way to display it on the screen with the lower resolution scale it to a smaller resolution, and after that display?
but you are "painting" your own Image and if your DC ( Device Context ) is shorter it will not display.
same like a Printer if you "print" outside Paper, both give wrong Result.
---
User can also use Windows Build Scale so Xbase++
Code: Select all
AppDeskTop():CurrentSize()
remember that all "Windows" since Vista a "paint" from DWM so they a "virtuell". this is why
Code: Select all
nLogPixX := GetDeviceCaps(hDC,LOGPIXELSX)
you need new Constante to get "native" Monitor Size to calculate Scale
Code: Select all
#define HWND_DESKTOP 0
#define LOGPIXELSX 88
#define LOGPIXELSY 90
#define HORZRES 8
#define VERTRES 10
#define DESKTOPVERTRES 117
#define DESKTOPHORZRES 118
LOCAL aSize := AppDeskTop():CurrentSize()
// ot4xb Syntax
LOCAL hDC := @user32:GetDC( HWND_DESKTOP )
LOCAL nXLogPixel := @Gdi32:GetDeviceCaps( hDC, LOGPIXELSX )
LOCAL nYLogPixel := @Gdi32:GetDeviceCaps( hDC, LOGPIXELSY )
LOCAL nVERTRES := @Gdi32:GetDeviceCaps( hDC, VERTRES )
LOCAL nHORZRES := @Gdi32:GetDeviceCaps( hDC, HORZRES )
LOCAL nDHORZRES := @Gdi32:GetDeviceCaps( hDC, DESKTOPHORZRES ) // native Monitor Size !
LOCAL nDVERTRES := @Gdi32:GetDeviceCaps( hDC, DESKTOPVERTRES ) // native Monitor Size !
Code: Select all
DLLFUNCTION GetDC( nHWND ) USING STDCALL FROM USER32.DLL
DLLFUNCTION ReleaseDC( nHWND, nHDC ) USING STDCALL FROM USER32.DLL
DLLFUNCTION GetDeviceCaps( nHWND, nIndex ) USING STDCALL FROM GDI32.DLL
Code: Select all
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<dpiAware>true</dpiAware>
</windowsSettings>
</application>
greetings by OHR
Jimmy
Jimmy
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: Virtual screen
Jimmy!
And could you post a working example that you can compile and try. The big picture is formed, but is not displayed and scaled with fewer pixels and then displayed.
And could you post a working example that you can compile and try. The big picture is formed, but is not displayed and scaled with fewer pixels and then displayed.
Re: Virtual screen
do not understand what you want me to do ...Eugene Lutsenko wrote:And could you post a working example that you can compile and try.
i just try to explain what work have to be done to get a Scale able Xbase++ App
Eugene Lutsenko wrote:The big picture is formed, but is not displayed and scaled with fewer pixels and then displayed.



it sound like i say before : you can't use a bigger DC (Presspace) than Monitor native have !
greetings by OHR
Jimmy
Jimmy
Re: Virtual screen
Eugene wrote :
But my question was different: if the program already creates an image with high resolution, is there a way to display it on the screen with the lower resolution scale it to a smaller resolution, and after that display?
If you need display only graphics images, can you do something like this ?
generate image (for example 2000x2000 pixels)
resample image to lower resolution (for example 600x600 pixels to preserve x-y , and this lower resolution you set by max resolution monitor)
show resampled image
Because I send you JPEG Resampler link, which know resample JPEG files to several types, set resolution, set size x,y pixels, size file etc.
Exist many resampler application, then you must run it with runshell as external app.
Best will be resampling by command line, if some soft has this support, and user not need know about processing resample.
But my question was different: if the program already creates an image with high resolution, is there a way to display it on the screen with the lower resolution scale it to a smaller resolution, and after that display?
If you need display only graphics images, can you do something like this ?
generate image (for example 2000x2000 pixels)
resample image to lower resolution (for example 600x600 pixels to preserve x-y , and this lower resolution you set by max resolution monitor)
show resampled image
Because I send you JPEG Resampler link, which know resample JPEG files to several types, set resolution, set size x,y pixels, size file etc.
Exist many resampler application, then you must run it with runshell as external app.
Best will be resampling by command line, if some soft has this support, and user not need know about processing resample.
- Attachments
-
- jpegres.gif (31.83 KiB) Viewed 15416 times
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: Virtual screen
Unfortunately, this assumes that the high resolution image exists. But the whole point is not to create it by the program execution with displaying on the screen, just somewhere in memory. And then to scale with the reduction and only then display.
Re: Virtual screen
Hi Roger
You promised to write a sample on the above topic, any one available now ? This problem is still hanging
Joe
You promised to write a sample on the above topic, any one available now ? This problem is still hanging
Joe
Re: Virtual screen
hi Eugene,
have you try to run "virtual" System
you can change Resolution in "virtual" System but Maximum ist Host Resolution when used "Full Screen".
it is Window which will not display what is "outside" of Monitor Resolution
when connect a 2nd Monitor your Windows Desk expand and you got bigger Resolution.
there is also Software for "virtual" Desktop but you need real Monitor to get bigger Resolution "as one Screen"
---
Windows can Scale UP but not Down ...
when reduce from 1920 x 1080 to 1024 x 768 all must reduce and your Font go from e.g. 12 Point to 6 Point so hard to read
---
when use a Static which is bigger as Drawingarea than Dialog Window become Scrollbar.
so you can use a Static with 1920 x 1080 as Parent for your Control.
if Monitor is to small User have to use Scrollbar ...
have you try to run "virtual" System

you can change Resolution in "virtual" System but Maximum ist Host Resolution when used "Full Screen".
it is Window which will not display what is "outside" of Monitor Resolution
when connect a 2nd Monitor your Windows Desk expand and you got bigger Resolution.
there is also Software for "virtual" Desktop but you need real Monitor to get bigger Resolution "as one Screen"
---
Windows can Scale UP but not Down ...
when reduce from 1920 x 1080 to 1024 x 768 all must reduce and your Font go from e.g. 12 Point to 6 Point so hard to read

---
when use a Static which is bigger as Drawingarea than Dialog Window become Scrollbar.
so you can use a Static with 1920 x 1080 as Parent for your Control.
if Monitor is to small User have to use Scrollbar ...

greetings by OHR
Jimmy
Jimmy
Re: Virtual screen
Try this:You promised to write a sample on the above topic, any one available now ? This problem is still hanging
Code: Select all
aScreenArea := DC_GetWorkArea()
aWindowSize := oDlg:currentSize()
nScale1 := (aScreenArea[3]-aScreenArea[1]) / aWindowSize[1]
nScale2 := (aScreenArea[4]-aScreenArea[2]) / aWindowSize[2]
aScale := { nScale1, nScale2, nScale1, nScale2, .t. }
DCGETOPTIONS SCALEFACTOR aScale
The eXpress train is coming - and it has more cars.