Author Topic: Transparenz  (Read 1779 times)

Offline Worebu

  • Mr. Polyvector
  • ***
  • Posts: 209
  • Seit gemoint liebe Gemeinde
    • View Profile
Transparenz
« on: 2020-Dec-23 »
Moin,
ich möchte eine Anwendung haben die über dem Desktop läuft, genauer gesagt ein Fadenkreuz um Positionen abzulesen. Funzt alles , ich bekomme bloß keine Transparenz hin, so das das Desktop sichtbar ist.
Jemand eine Idee?

Frohe Weihnachten, Gute Rutsch und schöne Osterfeiertage .
Intel I5 9600 - RTX 2080 Super, WaKü, 32GB RAM, 1x 512gb + 1x 1Gb NVRAM,  1x4TB + 1x1TB HD

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10859
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Transparenz
« Reply #1 on: 2020-Dec-30 »
Ich kenne das so, dass man den Desktop als bitmap "grabbed" und dann den Bereich wiederum zeichnet. Alternative wäre:
https://stackoverflow.com/questions/62252362/winapi-how-to-draw-opaque-text-on-a-transparent-window-background

Offline Worebu

  • Mr. Polyvector
  • ***
  • Posts: 209
  • Seit gemoint liebe Gemeinde
    • View Profile
Re: Transparenz
« Reply #2 on: 2020-Dec-30 »
Guter Tip, leider bekomme ich das mit dem Grabben nicht hin. Habe immer einen schwarzen Sprite.


Code: (glbasic) [Select]
// --------------------------------- //
// Project: Fadenkreuz
// Start: Wednesday, December 23, 2020
// IDE Version: 16.508


SETCURRENTDIR("Media") // go to media files

GLOBAL mx, my,b1,b2,dx,dy
GETDESKTOPSIZE dx,dy
SETSCREEN dx,dy,1
DRAWRECT 0,0,dx,dy,RGB(255, 0, 128)
GRABSPRITE 1,0,0,dx,dy
LOADFONT "smalfont.fnt",1
SETFONT 1,2


WHILE TRUE

DRAWSPRITE 1,0,0
MOUSESTATE mx,my,b1,b2
GOSUB fk
SHOWSCREEN
WEND
//
// ------------------------------------------------------------------
// ---  FADENKREUZ -
// ------------------------------------------------------------------
SUB fk:

DRAWLINE mx, 0 , mx  , dy, RGB(255,255,255)
DRAWLINE 0 , my, dx,   my, RGB(255,255,255)
PRINT mx + ":" + my, 20,20

ENDSUB // FADENKREUZ_ENDE

wo liegt da wohl der Fehler?

Hilfe würde helfen, Danke.
Intel I5 9600 - RTX 2080 Super, WaKü, 32GB RAM, 1x 512gb + 1x 1Gb NVRAM,  1x4TB + 1x1TB HD

Offline JohnnyB

  • Mc. Print
  • *
  • Posts: 41
    • View Profile
Re: Transparenz
« Reply #3 on: 2020-Dec-31 »
I think you are only grabbing from the GLBasic window.

Offline Schranz0r

  • Premium User :)
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 5117
  • O Rly?
    • View Profile
Re: Transparenz
« Reply #4 on: 2021-Jan-01 »
I <3 DGArray's :D

PC:
AMD Ryzen 7 3800X 16@4.5GHz, 16GB Corsair Vengeance LPX DDR4-3200 RAM, ASUS Dual GeForce RTX™ 3060 OC Edition 12GB GDDR6, Windows 11 Pro 64Bit, MSi Tomahawk B350 Mainboard