Pages

Se afișează postările cu eticheta graphic. Afișați toate postările
Se afișează postările cu eticheta graphic. Afișați toate postările

vineri, 10 aprilie 2026

FASM : mouse crosshair with lines on the window GDI.

For a year now, it keeps hacking me on Windows. And when I am in a bad mood, I turn to complex things. Today, I wanted to see if I could make a functional assembly code with Microsoft's Copilot artificial intelligence and my assembly knowledge with FASM. Here is what resulted.
The program is a Win32 GUI application written in FASM that draws a crosshair (vertical + horizontal line) following the mouse cursor inside a window classic GDI.
1. Window Setup
The app starts by registering a Win32 window class (WNDCLASSEX) and creating a standard overlapped window. Nothing unusual here — just the classic Win32 boilerplate.
2. Message Loop
The program enters the main loop:
  • GetMessage
  • TranslateMessage
  • DispatchMessage
This keeps the window responsive and forwards events to the window procedure.
3. Tracking the Mouse
Whenever the mouse moves inside the window, Windows sends a WM_MOUSEMOVE message. The program extracts the X and Y coordinates from lParam:
  • LOWORD(lParam) → X
  • HIWORD(lParam) → Y
These values are stored and the window is invalidated so it can be repainted.
4. Drawing the Crosshair (GDI)
All drawing happens inside WM_PAINT using classic GDI:
  • MoveToEx
  • LineTo
  • Ellipse
  • TextOut
  • FillRect
The steps are:
  • Clear the client area
  • Get the window’s current size (GetClientRect)
  • Draw a vertical line at the mouse’s X position
  • Draw a horizontal line at the mouse’s Y position
  • Draw a small circle at the intersection
  • Print the coordinates in the corner
Because the client size is read dynamically, the crosshair always stretches across the entire window — no matter how it’s resized.
See the source code
; mouse_crosshair.asm
format PE GUI 4.0
entry start
include "win32a.inc"

WM_MOUSEMOVE = 0x0200

section '.data' data readable writeable

    szClass db "MouseGraph",0
    szTitle db "Mouse Crosshair Demo",0

    mouseX dd 0
    mouseY dd 0

    fmt    db "X=%d  Y=%d",0
    buffer db 64 dup(0)

    rc  RECT
    ps  PAINTSTRUCT
    wc  WNDCLASSEX
    msg MSG

section '.code' code readable executable

start:
    invoke GetModuleHandle,0
    mov [wc.hInstance],eax

    mov [wc.cbSize],sizeof.WNDCLASSEX
    mov [wc.style],CS_HREDRAW or CS_VREDRAW
    mov [wc.lpfnWndProc],WndProc
    mov [wc.cbClsExtra],0
    mov [wc.cbWndExtra],0
    mov [wc.hIcon],0
    mov [wc.hIconSm],0
    mov [wc.lpszMenuName],0
    mov [wc.lpszClassName],szClass
    mov [wc.hbrBackground],COLOR_WINDOW+1

    invoke LoadCursor,0,IDC_ARROW
    mov [wc.hCursor],eax

    invoke RegisterClassEx,wc

    invoke CreateWindowEx,0,szClass,szTitle,\
           WS_VISIBLE+WS_OVERLAPPEDWINDOW,\
           200,200,800,600,0,0,[wc.hInstance],0

msg_loop:
    invoke GetMessage,msg,0,0,0
    test eax,eax
    jz exit
    invoke TranslateMessage,msg
    invoke DispatchMessage,msg
    jmp msg_loop

exit:
    invoke ExitProcess,0

; ---------------------------------------------------------
proc WndProc hWnd,uMsg,wParam,lParam

    cmp [uMsg],WM_MOUSEMOVE
    je .mouse

    cmp [uMsg],WM_PAINT
    je .paint

    cmp [uMsg],WM_DESTROY
    je .destroy

.def:
    invoke DefWindowProc,[hWnd],[uMsg],[wParam],[lParam]
    ret

; ---------------- WM_MOUSEMOVE ----------------
.mouse:
    mov eax,[lParam]
    and eax,0FFFFh
    mov [mouseX],eax

    mov eax,[lParam]
    shr eax,16
    and eax,0FFFFh
    mov [mouseY],eax

    invoke InvalidateRect,[hWnd],0,TRUE
    ret

; ---------------- WM_PAINT ----------------
.paint:
    invoke BeginPaint,[hWnd],ps
    mov esi,eax ; hdc

    ; clean client
    invoke GetClientRect,[hWnd],rc
    invoke FillRect,esi,rc,COLOR_WINDOW+1

    ; pen red
    invoke CreatePen,PS_SOLID,1,0x0000FF
    mov ebx,eax
    invoke SelectObject,esi,ebx

    ; ---------------- linie verticala (cruce) ----------------
    mov eax,[mouseX]        ; X constant
    mov edx,[rc.bottom]     ; Y max (jos)
    invoke MoveToEx,esi,eax,0,0
    invoke LineTo,esi,eax,edx

    ; ---------------- line  ----------------
    mov eax,[mouseY]        ; Y constant
    mov edx,[rc.right]      ; X max (dreapta)
    invoke MoveToEx,esi,0,eax,0
    invoke LineTo,esi,edx,eax

    ; punct în intersec?ie
    mov eax,[mouseX]
    mov edx,[mouseY]
    invoke Ellipse,esi,eax-4,edx-4,eax+4,edx+4

    ; text coordonate
    invoke wsprintf,buffer,fmt,[mouseX],[mouseY]
    invoke lstrlen,buffer
    invoke TextOut,esi,10,10,buffer,eax

    invoke EndPaint,[hWnd],ps
    ret

; ---------------- WM_DESTROY ----------------
.destroy:
    invoke PostQuitMessage,0
    ret

endp

section '.idata' import data readable
library kernel32,"KERNEL32.DLL",\
        user32,"USER32.DLL",\
        gdi32,"GDI32.DLL"

include "api/kernel32.inc"
include "api/user32.inc"
include "api/gdi32.inc"

marți, 31 martie 2026

News : example with cubes from omma.build website

3D scenes, websites, games, apps. Describe anything and Omma builds it for you in seconds.
I found this idea of html graphics design, see this exemple website.
The main website is the omma website.

joi, 26 februarie 2026

Tools : A series of advanced mathematical and computational algorithms ...

Below is the list of algorithms and mathematical concepts involved, from fundamental vector geometry to state-of-the-art neural networks in software development with vector mathematics:
  • Bezier Polynomials (Quadratic and Cubic): The mathematical foundation for generating smooth SVG paths using control points.
  • Casteljau Algorithm: A recursive method used for curve subdivision and robust geometric construction.
  • Affine Transformations: 3x3 matrix operations enabling translation, rotation, scaling, and skewing of objects.
  • Curve Tessellation: Adaptive subdivision algorithms converting smooth parametric curves into discrete pixel segments.
  • Spiro Splines: Used in Inkscape to create curves that minimize curvature variation through clothoid segments.
  • Boolean Operations (Union, Intersection, Difference, XOR): Based on computational geometry for combining complex shapes.
  • Bentley–Ottmann Algorithm: Used to detect line‑segment intersections during boolean path operations.
  • Winding Number Calculation: Determines whether a point lies inside or outside a path.
  • Arc‑Length Parameterization: Essential for placing text on a path and for uniform motion animations.
  • Potrace Algorithm: Converts bitmap images into vector paths through decomposition, polygon optimization, and least‑squares curve fitting.
  • Sobel Operator: Edge‑detection algorithm computing gradient magnitude and direction in raster images.
  • Ramer–Douglas–Peucker Algorithm: Simplifies paths by reducing intermediate points while preserving shape fidelity.
  • Schneider Algorithm: Optimizes Bézier curve fitting using Newton–Raphson iteration.
  • DeepSVG (Hierarchical Generative Networks): Enables vector graphics reconstruction and animation through latent‑space operations.
  • SVGformer (Transformer Architectures): Captures complex patterns and dependencies in large SVG datasets.
  • GANs (Generative Adversarial Networks): Produce professional vector outputs through adversarial training.
  • CVAEs (Convolutional Variational Autoencoders): Learn to encode and decode graphic data such as fonts or icons into latent spaces.
  • L‑Systems (Lindenmayer Systems): Use formal grammar rules and recursion to generate organic shapes.
  • Perlin Noise: Produces mathematically controlled random variations for organic patterns.
  • Verlet Integration: Used in force‑based simulations (Coulomb attraction, Hooke elasticity) for data visualization.
  • Convolution Mathematics: Implements SVG filters (such as Gaussian Blur) using discrete convolution matrices.

joi, 19 februarie 2026

News : my logo for game development .

Today I'm going to show you a logo design for my game development and it's under my own copyright.
Since I came here, I've been stuck with hacking from my provider, there's no point in complaining anymore unless I invest in additional security, and it's messing with my internet anyway, etc.
Even if I don't manage to sell anything, I will be satisfied with what I have achieved in these difficult conditions.

joi, 8 ianuarie 2026

vineri, 5 decembrie 2025

News : Pantone Color of the Year for 2026

The official Pantone Color of the Year for 2026 is PANTONE 11-4201 Cloud Dancer. This color is described as a billowy, balanced white that symbolizes serenity and reflection in a fast-paced society. It represents a desire for a fresh start and clarity, making it a versatile choice for various applications.
I'm not really a gambler, I prefer analyses and case studies. I like statistics and I believe that most people's decisions are well-grounded in complex realities and mental manipulations... I have to admit that my forecast for the color white was 95% in this case, I would present a range of factors that led to this ... That's why I believe that artificial intelligence is a good advisor and can improve our civilization ...

joi, 13 noiembrie 2025

News : Win $1,000 by lottiefiles !

Win $1,000 and get featured across our site, socials, and newsletter with a dedicated community article.
Join the Top 100 Logos Reanimated challenge!
Join our challenge and explore your creativity by giving iconic logos a fresh animation twist in your own style.
Submit your work before 11:59 PM PST, 28th November 2025.
Important dates
AMA session
19th November 2025
Winner announcement
3rd December 2025

marți, 11 noiembrie 2025

News : ShaderBoy with google access ... bad or not?

In the web area, all sorts of propagated coincidences and implementations have started to appear. Here is a website that allows you to work with shaders and offers Google access functionality.
Because there are ongoing discussions about global security solutions and some security software developers have newer business implementations... I maintain my opinion that accessing a website with Google access, without knowing what access you are granting, for example: your photos, blogs, documents, is not a very good idea. Managing a large flow of Google accesses on a single account is difficult, which is why, in the case of hacking, using a traditional password will compromise only a single account.
Customizing access through Google, any other quirky ideas, and all kinds of duplicated accounts lead to rejections and blocks in web consumer psychology.
If you press no, then you are sure is works good ? https://shaderboy.net/app/.

luni, 20 octombrie 2025

News : new Runway Aleph features for video

New changes on the Runway website :
Runway Aleph is a state-of-the-art in-context video model, setting a new frontier for multi-task visual generation, with the ability to perform a wide range of edits on an input video such as adding, removing, and transforming objects, generating any angle of a scene, and modifying style and lighting, among many other tasks.

News : Nasa - Carbon dioxide (CO2) animations.

You can find some graphics about Carbon dioxide (CO2) - old data, on NASA website.
Carbon dioxide (CO2) is the most prevalent greenhouse gas driving global climate change. However, its increase in the atmosphere would be even more rapid without land and ocean carbon sinks, which collectively absorb about half of human emissions every year. Advanced computer modeling techniques in NASA's Global Modeling and Assimilation Office allow us to disentangle the influences of sources and sinks and to better understand where carbon is coming from and going to.
NOTE: Due to the lapse in federal government funding, NASA is not updating this website. We sincerely regret this inconvenience.

duminică, 19 octombrie 2025

News : Maintenance release: Godot 4.5.1

This new released was on 15 octomber 2025.
We saw the release of Godot 4.5 less than a month ago, and have already been absolutely overwhelmed with the positive reception. Since then, our team has been hard at work on the development phase of Godot 4.6 (and subsequently its first snapshot), and ensuring that any new regressions/bugs reported after the release of 4.5 are dealt with swiftly. The community has done an absolutely fantastic job at helping our team find and squash all of those aforementioned issues, and paved the way for us to deliver 4.5.1-stable for you today!
See more on the official blog.

joi, 9 octombrie 2025

News : Blockbench 5 new changes .

The new Blockbench 5 is a major update including a new user interface design, improved animation tools, new modelling tools.
This can automatically create a UV map and template for your model so that you can start painting directly on the model in 3D .

News : SuperSplat - online tool.

SuperSplat is an advanced browser-based editor for manipulating and optimizing 3D Gaussian Splats.

duminică, 17 august 2025

News : KDE Gear is back ...

KDE Gear is back with a cool wave of apps for your summertime desktop!
Whether you need to brush up on your languages to visit exotic lands, plan your trips, keep up to date while on the move, meet up with friends and colleagues, create content from your holiday clips, or just chill as your quaint steam engine trundles up a picturesque peak, KDE Gear 🌞 25.08 has got you covered.
The news comes on 14 august 2025 from the official website.
KDE Gear - originally known as the KDE Applications Bundle, was first released on December 17, 2014
KDE Gear version 25.08 release include and provides powerful, user-friendly apps for everyday tasks:
  • Itinerary: Travel planner that helps with tickets, delays, maps, and even health certificates.
  • Dolphin: File manager with improved search and integration with Filelight for disk usage visualization.
  • KOrganizer: Calendar and task manager with better navigation and tooltips.
  • Kleopatra: Encryption and certificate manager with multi-window support.
  • Neochat: Matrix-based chat app with polls and thread controls.
  • Artikulate: Language pronunciation trainer, now compatible with Plasma 6.
  • Angelfish: Web browser with customizable shortcuts and adblock toggle.
I don't use KDE very often and haven't in the past either. I prefer simpler and faster desktop environment solutions for my older hardware.

News : mesa 25.2.0-rc1 - new release.

Hello everyone,
I'm happy to announce the start of a new release cycle with the first release candidate, 25.2.0-rc1.
As always, if you find any issues please report them here: https://gitlab.freedesktop.org/mesa/mesa/-/issues/new
Any issue that should block the release of 25.2.0 final, thus adding more 25.2.0-rc* release candidates, must be added to this milestone: https://gitlab.freedesktop.org/mesa/mesa/-/milestones/51
The next release candidate is expected in one week, on July 23rd.
Cheers, Eric

vineri, 15 august 2025