Forming an image without displaying it on the screen
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Forming an image without displaying it on the screen
Is it possible to create a 1920 x 1080 image in memory without displaying the process of image formation on the screen, and then scale it to the desired size and only then display it?
Re: Forming an image without displaying it on the screen
YES ...Eugene Lutsenko wrote:Is it possible to create a 1920 x 1080 image in memory without displaying the process of image formation on the screen, and then scale it to the desired size and only then display it?
---
it depend on your Device/Presspace.
if you use
Code: Select all
oPresSpace := oXbPart:lockPS()
the normal Way (pure Xbase++) to create a Bitmap is to use a "real" Presspace
Code: Select all
oPS := XBPPRESSPACE():new():Create()
oBMP := XBPBITMAP():New():Create()
oBMP:Make( aSize[ 1 ], aSize[ 2 ], nPlanes, nBits )
oBMP:presSpace( oPS )
//
GRAxxx(oPS ... )
//
oBMP:SaveFile("\\Server\Picture\MyPic.BMP")
RETURN BMP2BMP(oBMP,aNewSize)
---
if you want to use API Function like SetPixel() ... have a look into Source of "Delone Triangulation"
Code: Select all
FUNCTION CreateMemoryDC( hDC, nXSize, nYSize )
LOCAL hMemoryDC, hBMP
hMemoryDC := CreateCompatibleDC(hDC) // create compatible memory DC
hBMP := CreateCompatibleBitmap(hDC,nXSize,nYSize) // create DDB
SelectObject(hMemoryDC,hBMP) // put hBMP into memory DC
BitBlt( hMemoryDC,0,0,nXSize,nYSize,hDC,0,0,SRCCOPY ) // copy desktop DC into memory DC
RETURN hMemoryDC
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: Forming an image without displaying it on the screen
Hey, Jimmy!
And could you give a working example of a program with source code that draws in high-resolution memory, writes a full file to disk, and displays scaled (reduced) to the real screen size?
Привет, Джимми! А не мог бы ты привести работающий пример программы с исходным текстом, которая рисует в памяти с высоким разрешением, записывает на диск полный файл, а отображает масштабированный (уменьшенный) до реального размера экрана?
And could you give a working example of a program with source code that draws in high-resolution memory, writes a full file to disk, and displays scaled (reduced) to the real screen size?
Привет, Джимми! А не мог бы ты привести работающий пример программы с исходным текстом, которая рисует в памяти с высоким разрешением, записывает на диск полный файл, а отображает масштабированный (уменьшенный) до реального размера экрана?
Re: Forming an image without displaying it on the screen
i have no Example ... it is your GameEugene Lutsenko wrote:And could you give a working example of a program with source code that draws in high-resolution memory, writes a full file to disk, and displays scaled (reduced) to the real screen size?
when using API Function CreateMemoryDC() you need GDI32 Function, like SetPixel(), to "paint".
also you need a "Brush" to "paint" and you can't use any Xbase++ GRA* Function.
so you first have to write all API DLL Call Function before you can work with it.
here are some GDI32 API Function Name you may need
Code: Select all
GDI32.DLL ABORTPATH
GDI32.DLL ADDFONTRESOURCEA
GDI32.DLL ARC
GDI32.DLL ARCTO
GDI32.DLL BEGINPATH
GDI32.DLL BITBLT
GDI32.DLL CHORD
GDI32.DLL CLOSEFIGURE
GDI32.DLL COMBINERGN
GDI32.DLL CREATEBITMAP
GDI32.DLL CREATEBRUSHINDIRECT
GDI32.DLL CREATECOMPATIBLEBITMAP
GDI32.DLL CREATECOMPATIBLEDC
GDI32.DLL CREATEDIBPATTERNBRUSHPT
GDI32.DLL CREATEDIBSECTION
GDI32.DLL CREATEELLIPTICRGNINDIRECT
GDI32.DLL CREATEFONTA
GDI32.DLL CREATEHATCHBRUSH
GDI32.DLL CREATEPATTERNBRUSH
GDI32.DLL CREATEPOLYGONRGN
GDI32.DLL CREATEPOLYPOLYGONRGN
GDI32.DLL CREATERECTRGNINDIRECT
GDI32.DLL CREATEROUNDRECTRGN
GDI32.DLL CREATESCALABLEFONTRESOURCEA
GDI32.DLL CREATESOLIDBRUSH
GDI32.DLL DELETEDC
GDI32.DLL DELETEOBJECT
GDI32.DLL ELLIPSE
GDI32.DLL ENDPATH
GDI32.DLL EQUALRGN
GDI32.DLL EXTCREATEPEN
GDI32.DLL EXTFLOODFILL
GDI32.DLL EXTSELECTCLIPRGN
GDI32.DLL EXTTEXTOUT
GDI32.DLL FILLPATH
GDI32.DLL FILLRGN
GDI32.DLL FLATTENPATH
GDI32.DLL FRAMERGN
GDI32.DLL GETARCDIRECTION
GDI32.DLL GETASPECTRATIOFILTEREX
GDI32.DLL GETBITMAPDIMENSIONEX
GDI32.DLL GETBKCOLOR
GDI32.DLL GETBKMODE
GDI32.DLL GETBRUSHORGEX
GDI32.DLL GETCHARWIDTH32
GDI32.DLL GETCLIPBOX
GDI32.DLL GETCURRENTPOSITIONEX
GDI32.DLL GETPATH
GDI32.DLL GETPIXEL
GDI32.DLL GETPOLYFILLMODE
GDI32.DLL GETREGIONDATA
GDI32.DLL GETRGNBOX
GDI32.DLL GETROP2
GDI32.DLL GETSTOCKOBJECT
GDI32.DLL GETSTRETCHBLTMODE
GDI32.DLL GETTEXTALIGN
GDI32.DLL GETTEXTCHARACTEREXTRA
GDI32.DLL GETTEXTCOLOR
GDI32.DLL GETTEXTEXTENTPOINT32
GDI32.DLL GETTEXTFACEA
GDI32.DLL INTERSECTCLIPRECT
GDI32.DLL INVERTRGN
GDI32.DLL LINETO
GDI32.DLL MASKBLT
GDI32.DLL MOVETOEX
GDI32.DLL OFFSETCLIPRGN
GDI32.DLL OFFSETRGN
GDI32.DLL PAINTRGN
GDI32.DLL PATHTOREGION
GDI32.DLL PIE
GDI32.DLL PLGBLT
GDI32.DLL POLYBEZIER
GDI32.DLL POLYBEZIERTO
GDI32.DLL POLYDRAW
GDI32.DLL POLYGON
GDI32.DLL POLYLINE
GDI32.DLL POLYLINETO
GDI32.DLL POLYPOLYGON
GDI32.DLL POLYPOLYLINE
GDI32.DLL PTINREGION
GDI32.DLL PTVISIBLE
GDI32.DLL RECTANGLE
GDI32.DLL RECTINREGION
GDI32.DLL RECTVISIBLE
GDI32.DLL REMOVEFONTRESOURCEA
GDI32.DLL ROUNDRECT
GDI32.DLL SELECTCLIPPATH
GDI32.DLL SELECTOBJECT
GDI32.DLL SETARCDIRECTION
GDI32.DLL SETBITMAPDIMENSIONEX
GDI32.DLL SETBKCOLOR
GDI32.DLL SETBKMODE
GDI32.DLL SETBRUSHORGEX
GDI32.DLL SETDCBRUSHCOLOR
GDI32.DLL SETDCPENCOLOR
GDI32.DLL SETMAPPERFLAGS
GDI32.DLL SETPIXELV
GDI32.DLL SETPOLYFILLMODE
GDI32.DLL SETROP2
GDI32.DLL SETSTRETCHBLTMODE
GDI32.DLL SETTEXTALIGN
GDI32.DLL SETTEXTCHARACTEREXTRA
GDI32.DLL SETTEXTCOLOR
GDI32.DLL SETTEXTJUSTIFICATION
GDI32.DLL STRETCHBLT
GDI32.DLL STROKEANDFILLPATH
GDI32.DLL STROKEPATH
GDI32.DLL WIDENPATH
https://docs.microsoft.com/en-us/window ... indows-gdi
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: Forming an image without displaying it on the screen
It is a pity that there is no such example. I realized it was possible. But I also realized I couldn't do it.
Re: Forming an image without displaying it on the screen
hi,
you have a API Example with SetPixel() in Source of "Delone Triangulation" from Roger. it is up to you to enhance it.
but as i say using XbpBitmap() and XbpPresspace() you can create a "hidden" Bitmap.
you have a API Example with SetPixel() in Source of "Delone Triangulation" from Roger. it is up to you to enhance it.
but as i say using XbpBitmap() and XbpPresspace() you can create a "hidden" Bitmap.
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: Forming an image without displaying it on the screen
I will try, because it is really necessary. So in General always and to do. I will try as soon as possible
Re: Forming an image without displaying it on the screen
Eugene,
How type of image You use ?
If You know format of image file, you can generalize it from 1920/1280 to lower resolution, and only then show on monitor.
So easy to say, harder to do
Now I do not know how to do it. I know only, that software for work with digital maps used it, generalize objects smaller than some pixels, and show only when zoom detail, for example small texts show only for zoom detail.
Maybe this system need more time, than other solution (processing many pixels).
How type of image You use ?
If You know format of image file, you can generalize it from 1920/1280 to lower resolution, and only then show on monitor.
So easy to say, harder to do

Maybe this system need more time, than other solution (processing many pixels).
- Eugene Lutsenko
- Posts: 1649
- Joined: Sat Feb 04, 2012 2:23 am
- Location: Russia, Southern federal district, city of Krasnodar
- Contact:
Re: Forming an image without displaying it on the screen
I processed bmp and jpg images in my system:
http://lc.kubagro.ru/aidos/aidos18_LLS/ ... LS-max.jpg
http://lc.kubagro.ru/aidos/aidos18_LLS/aidos18_LLS.pdf
http://ej.kubagro.ru/2017/04/pdf/01.pdf.
Came to require them to scale before processing on my system. And according to the images in my system is another problem: they are created in the process of drawing. If the screen is smaller than the image, then I just give a message that the image can not be formed and displayed on this screen. But users really want to display large images on low-resolution screens. And I when these modes did about it somehow didn't think. Now redo these modes will be very time-consuming.
http://lc.kubagro.ru/aidos/aidos18_LLS/ ... LS-max.jpg
http://lc.kubagro.ru/aidos/aidos18_LLS/aidos18_LLS.pdf
http://ej.kubagro.ru/2017/04/pdf/01.pdf.
Came to require them to scale before processing on my system. And according to the images in my system is another problem: they are created in the process of drawing. If the screen is smaller than the image, then I just give a message that the image can not be formed and displayed on this screen. But users really want to display large images on low-resolution screens. And I when these modes did about it somehow didn't think. Now redo these modes will be very time-consuming.
Last edited by Eugene Lutsenko on Fri Oct 19, 2018 11:12 pm, edited 1 time in total.
Re: Forming an image without displaying it on the screen
Can't you apply a scaling factor at the time that you are drawing the image?
The eXpress train is coming - and it has more cars.