Recent Posts

Pages: 1 ... 3 4 [5] 6 7 ... 10
41
The concept / Tutor_15 (C++ VS2022 GDImage64 tutorial)
« Last post by Patrice Terrier on August 18, 2023, 02:11:09 pm »
Fifteenth post of a series, translated from the "WinDev and PowerBASIC",
to explain the use of GDImage64 in procedural* programming mode with Visual Studio 2022.

About Tutor_15
This is a C++ transcription of a PowerBASIC demo written in 2009 with the official release of GDImage 5.00.
It was the first version able to mix 2D and 3D OpenGL into the same graphic control.
The application itself is skinned with WinLIFT, and share the same background wallpaper with all child controls.

Wallpaper
You can change them on the fly, by cliking on the top-left icon with either the left or right mouse button.
The wallpaper images are stored in the "Resource\Background" sub-folder.

3D OpenGL animation
The compass is using a spherical texture named "graduation.jpg" from the "Resource" folder.
You can change its orientation with the "Rotation" trackbar slider.
The "DrawObject3D" is the procedure where we render the OpenGL object.
It is converted on the fly in a sprite bitmap (IDS_3DOBJECT) inside of "RenderAnimation".

Custom controls
They are skinned on the fly using the WinLIFT skSkinChildCtrl() API.
All labels are created with the skSetLabelFont() API using a private font, this ensures the GUI looks always the same on every computer.

Linked sprite objects
All the sprites are linked together with the ZD_SetObjectLinked() API, to create a single entity that can be moved around holding down the left mouse button inside of the GDImage graphic control.

Settings
The user interface allows you to change on the fly many of the ZOBJECT sprite properties.

GDImage 7.16
Is an experimental version converted to VS2022, with a new API named "ZD_GLtoBitmap" to dynamically turn the OpenGL context into a ZOBJECT sprite bitmap (see the RenderAnimation() procedure).


Last but not least,
the size of the standalone binary EXE is only 22 Kb.


   
* procedural programming mode, is based on direct use of the FLAT API (Windows SDK) that is the core meat of the OS.
42
The concept / Tutor_14 (C++ VS2022 GDImage64 tutorial)
« Last post by Patrice Terrier on August 15, 2023, 05:52:24 pm »
Fourteenth post of a series, translated from the "WinDev and PowerBASIC",
to explain the use of GDImage64 in procedural* programming mode with Visual Studio 2022.

About Tutor_14
It is based on a real application written in 2007 for a french administration (Prefecture du Vaucluse).
It uses markers to spot a specific location on a map or a plan.
It is able to manage several distinct projects, each one using a main background image, that is the surface used to display the markers and the annotations, the coordinates and properties of the objects are saved inside the application's "Map" subfolder. The file name used to save a project, is build on the name of the background image, followed with the extension ".gns".

Zoom Control
The ZI_SetProperty(gP.hCtrl, ZI_ZoomWindow, TRUE); enabled it.
It means that everything put inside of the graphic control could be resized on the fly.

Vertical selector
This is the same concept as the vertical sprite selector used in Tutor_13, except that this one is a tool window that can be moved around by dragging its caption.

Drag & drop
Uses the CreateDropImage procedure to create a WS_EX_LAYERED window to drag the selected sprite to its destination.

RTF help file
Please make sure to read the provided HELP_us.rtf by cliking the user icon shown aside the close button (bottom right side).

User interface
1. Contact sheet:
Located above the main working area, it allows the selection of a specific project.
The active project is shown in opaque mode, while the others are using half transparency.
2. Working area:
Located below the contact sheet and above the command pannel, it takes most of the main window area. The aspect of the working area relies on the zooming factor being used, and the view port section can be adjusted with the scrollbars. It is also possible to scroll the image using the left mouse button to drag directly the background.
3. Markers:
They are shown inside of the floating tool window located on the right side of the working area.
To add new markers on the working area, just use drag and drop from this window.
4. Command pannel:
It is at the bottom of the main window, under the working area. It is used to display the mouse coordinates and all the command buttons, as well as the "Close" button (on the right side). You can use the command panel, as you would do for a standard window caption, to move the whole window to another location (using drag and drop).
5. Moving and zooming:
This small floating toold window is located on the top left corner, it is used to display a thumbnail of the whole background image, altogether with a rectangular shape, using a red perimeter to delimit the part of the image currently shown in the working area. The size of the rectangle, is based on the current zoom level, that could be adjusted from the horizontal slider below the thumbnail. You can drag the inside of the rectangle, to adjust the viewport, just like what you would do with the scrollbars aside the working area.

GDImage 7.15
Is an experimental version converted to VS2022, and designed specifically to run all the Tutor applications.


   
* procedural programming mode, is based on direct use of the FLAT API (Windows SDK) that is the core meat of the OS.
43
The concept / Tutor_13 (C++ VS2022 GDImage64 tutorial)
« Last post by Patrice Terrier on August 10, 2023, 03:14:09 pm »
Thirteenth post of a series, translated from the "WinDev and PowerBASIC",
to explain the use of GDImage64 in procedural* programming mode with Visual Studio 2022.

About Tutor_13
This tutor introduces the use of a vertical sprite selector to perform drag & drop onto the main graphic control.
It is using two distinct GDImage controls, the main that is transparent (DWM composited), and a vertical sprite selector.

Vertical selector
This is the same concept as the horizontal contact sheet used in Tutor_10, except that you have to use drag & drop to drop the selected sprite at a specific location onto the main graphic control.

Drag & drop
This one is using the CreateDropImage procedure to create a WS_EX_LAYERED window to drag the selected sprite to its destination.

Contextual popup menu
It is fired when you right click the mouse on a specific sprite to set up its properties.
The commands are:
Display next frame, in case of sprite multi-frame, switch to next one in loop mode.
Note: you can also double click on the sprite to achieve the same result.
Flip horizontally, as the name implies.
Flip vertically, as the name implies.
Rotate counter clock, as the name implies.
Rotate clockwise, as the name implies.
Move up, increase the z-order.
On top, on top of the z-order.
Move down, decrease the z-order.
On bottom, on bottom of the z-order.
Clone, duplicate the sprite.
Lock, lock/unlock the sprite (the menu icon shows the current state).
Delete, remove this sprite from the graphic control.

GDImage logo
The Resource(L"logo.png") is a fixed sprite that couldn't be moved around using the ZD_SetObjectLocked API.
It also use the ZD_SetObjectHidden state, that means it couldn't be detected, and in case of zoom control it is unaffected by the zoom factor.
It is transparent to mouse events, sent to the underlaying sprite(s) in order of appearance (z-order).

Extra goodies
// Remove the CS_DROPSHADOW effect from the popup menu
HHOOK HookMenu = SetWindowsHookEx(WH_CALLWNDPROC, (HOOKPROC) HookMenuProc, 0, GetCurrentThreadId());

This procedure allows you to customize the tooltip color.
void CreateToolTip(IN HWND hWnd) {
    if (IsWindow(hWnd)) {
        // Add tooltip support to the hWnd GDImage control.
        HWND hTooltip = ZI_CreateToolTip(hWnd, L"");
        if (hTooltip) {
            SetWindowTheme(hTooltip, L"", L""); // Theme must be disabled to use custom colors.
            SendMessage(hTooltip, TTM_SETTIPTEXTCOLOR, RGB(0,0,0), 0);
            SendMessage(hTooltip, TTM_SETTIPBKCOLOR, RGB(177,197,255), 0);

        }
    }
}


GDImage 7.15
Is an experimental version converted to VS2022, and designed specifically to run all the Tutor applications.


   
* procedural programming mode, is based on direct use of the FLAT API (Windows SDK) that is the core meat of the OS.
44
The concept / Tutor_12 (C++ VS2022 GDImage64 tutorial)
« Last post by Patrice Terrier on August 01, 2023, 09:07:22 am »
twelfth post of a series, translated from the "WinDev and PowerBASIC",
to explain the use of GDImage64 in procedural* programming mode with Visual Studio 2022.

About Tutor_12
This tutor introduces the use of EXIF Tags to read/write image annotations.

EXIF stands for "Exchangeable Image File Format".
The annotations are formatted according to the TIFF specification, and may be found also in JPG, PNG, and many TIFF-based RAW images.

This project is a console application.

ZI_GetImageInfoList
This API uses a zTrace window to list the tags found in the Annecy.jpg file.

zCloneImage
This low level API duplicates the image before writing a new title tag to it: "This is the title of the new clone image".

Extracting Thumbnail
If the EXIF tag contains thumbnail data, then we create a file named "thumbnail.jpg".

GDImage 7.14
Is an experimental version converted to VS2022, and designed specifically to run all the Tutor applications.


   
* procedural programming mode, is based on direct use of the FLAT API (Windows SDK) that is the core meat of the OS.
45
Get ObjReader & Documentation / Full version 3.02
« Last post by Patrice Terrier on July 26, 2023, 02:49:40 pm »
Full version 3.02

The new compressed .7z archive is attached to the first post of this thread.

Mouse input was unexpectedly disabled while using the transparent Help window (F1).
This feature has been restored, to "keep working while reading".
46
The concept / Tutor_11 (C++ VS2022 GDImage64 tutorial)
« Last post by Patrice Terrier on July 18, 2023, 04:12:19 pm »
Eleventh post of a series, translated from the "WinDev and PowerBASIC",
to explain the use of GDImage64 in procedural* programming mode with Visual Studio 2022.

About Tutor_11
This tutor introduces the use of a TOAST window to notify the user about a specific event.
It pops up from the bottom right edge of a parent window, and auto-hides itself after 15 secondes.

This project uses 2 GDImage controls:
The first, is a child window working in DWM transparent mode, using the whole client area to display a helper message.
The second, is a popup child window (the Toast window).

ZI_DwmEnable
This API enable the DWM transparent mode for a specific window (Main and Toast).

ZI_CreateImageComposited
This API is used to create on the fly a composited image from multiple object layers,
they are defined first in a ZOBJECT array using any GDImage object type.
The z-order composition will match the array order, the lower indice at the bottom, the higher on top.
All layers are composited in memory, then saved to file into the temporary folder.

ZI_CreateWindowFromImage
This API creates the Toast window. It uses the magenta color, or the alpha channel to build a region on the fly.
In the example we use the previously saved composited image from the temporary folder.

The width/height of a Toast window is computed to fit the size of the text message.

Last but not least,
the size of the standalone binary EXE is only 15 Kb.


   
* procedural programming mode, is based on direct use of the FLAT API (Windows SDK) that is the core meat of the OS.
47
The concept / Version 7.13
« Last post by Patrice Terrier on July 13, 2023, 10:09:03 am »
The internal size of the CHARTFONT structure has changed,  the private font path has been enlarged from 64 to MAX_PATH.
To avoid error when using larger path.

The new version is attached to the first post of this thread.
48
The concept / Tutor_10 (C++ VS2022 GDImage64 tutorial)
« Last post by Patrice Terrier on July 08, 2023, 09:12:32 pm »
Tenth post of a series, translated from the "WinDev and PowerBASIC",
to explain the use of GDImage64 in procedural* programming mode with Visual Studio 2022.

About Tutor_10
This tutor introduces the use of an image ruban to create a contact sheet.
It is used to browse images from a gallery folder

Contact sheet
You have to move the mouse cursor to the top of the client area to see it (auto-hide).
Once visible, you can scroll the contact sheet to the left or to the right, by moving the cursor hover the auto-hide arrows.
Click on an icon to display the related image.

Watermak
It is shown on the right corner bottom, when selecting a new image.

Last but not least,
the size of the standalone binary EXE is only 17 Kb.


   
* procedural programming mode, is based on direct use of the FLAT API (Windows SDK) that is the core meat of the OS.
49
The concept / Tutor_09 (C++ VS2022 GDImage64 tutorial)
« Last post by Patrice Terrier on July 06, 2023, 02:47:13 pm »
Ninth post of a series, translated from the "WinDev and PowerBASIC",
to explain the use of GDImage64 in procedural* programming mode with Visual Studio 2022.

About Tutor_09
This tutor introduces the use of built-in 3D charting features.
It does use the GDImage WGL_CreateWindow() API to create the 3D container,
using OpenGL WGL extensions and antialiasing.

Billboarding is used to always keep some of the legends in front of the camera,
and also with the bubble point meshes, to produce pseudo spheres.

TTF private font is used to build some of the text meshes on the fly,
this ensures that they always looks the same, whatever the computer being used.

Image reflection is used to create realistic transparent glass materials.

Last but not least,
the size of the standalone binary EXE is only 24 Kb.


   
* procedural programming mode, is based on direct use of the FLAT API (Windows SDK) that is the core meat of the OS.
50
The concept / ObjReader Viewer 3.00.07 (C++ VS2022)
« Last post by Patrice Terrier on July 04, 2023, 07:21:11 pm »
This version has been converted to VS2022, using TCLIB.dll to produce a small 39 Kb ORV64.exe binary.

It uses GDImage64.dll, WinLIFT64.dll, Bass.dll, and ORDLL64.dll that is a small subset of the ObjReader OpenGL 3D engine.

About:
ORDLL64 can be used with any 64-bit language to render wavefront .obj 3D models, using the specific ObjReader materials.
You can select a project from the combobox,
or using drag and drop to play any model downloaded from the 3D collection
(Explorer drag and drop can also be used to play audio files)

The ORDLL64.dll API is using this limited set of functions
Code: [Select]
OR_CreateWindow(IN DWORD dwExStyle, IN HWND hParent, IN DWORD dwStyle, IN long x, IN long y, IN long w, IN long h, IN HMENU CtrlID);
OR_DetectGPU();
OR_GPUinfo();
OR_About();
OR_ViewReset();
OR_GetAudioVolume();
OR_SetAudioVolume(IN long nVolume);
OR_ProcessCommandLine(IN WCHAR* lpCmdLine);
OR_Vertices();
OR_Triangles();
OR_Indices();
OR_Meshes();
OR_Materials();
OR_ObjSize();
OR_LoadTime();
OR_Version();
OR_TimerEnable(IN BOOL enable);
OR_SetSwapInterval(IN BOOL bUseInterval);
OR_ObjFileName();
OR_GPU();
OR_CPU();
OR_GetAniTick();
Pages: 1 ... 3 4 [5] 6 7 ... 10