flat assembler
Message board for the users of flat assembler.

Index > Windows > Draw Rectangle directly on the screen without a window?

Goto page Previous  1, 2
Author
Thread Post new topic Reply to topic
upsurt



Joined: 14 Jan 2014
Posts: 51
upsurt 28 Jul 2014, 19:02
revolution wrote:
badc0de02 wrote:
or just simply get A new Screenshot to every drawing cycle and REPLACE IT SIMPLY?
A new screen shot would have the rectangle on it thus defeating the purpose.


I quess

A:
- inc x
- inc y
- take screenshot
- paint the rectangle to x,y
- restore the screen with help of the screenshot
jmp A

but still, highly dynamic content might suffer actuallity ... Sad


Last edited by upsurt on 28 Jul 2014, 20:35; edited 1 time in total
Post 28 Jul 2014, 19:02
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20299
Location: In your JS exploiting you and your system
revolution 28 Jul 2014, 19:09
upsurt wrote:
I quess

A:
- inc x
- inc y
- take screenshot
- paint the rectangle to x,y
- restore the screen with help of the screenshot
jmp A

but still, highly dinamic content might suffer actuallity ... Sad
And the flickering would be terrible.
Post 28 Jul 2014, 19:09
View user's profile Send private message Visit poster's website Reply with quote
upsurt



Joined: 14 Jan 2014
Posts: 51
upsurt 28 Jul 2014, 20:36
how about od drawing an transparent window (without border or anything) and just paint the rectangle on top of this window?

what do you think?
Post 28 Jul 2014, 20:36
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20299
Location: In your JS exploiting you and your system
revolution 28 Jul 2014, 21:05
Using transparency is the usual technique used for non-rectangular windows. There are tutorials about such things dating back from the days of the original Win95.

If your window is going to be rectangular then there is no advantage to using transparency. Just use a normal window.
Post 28 Jul 2014, 21:05
View user's profile Send private message Visit poster's website Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1618
Location: Toronto, Canada
AsmGuru62 28 Jul 2014, 21:49
So, the main question is: why not use a window?
Post 28 Jul 2014, 21:49
View user's profile Send private message Send e-mail Reply with quote
upsurt



Joined: 14 Jan 2014
Posts: 51
upsurt 28 Jul 2014, 22:14
actually, I wanted to paint directly on the screen. so a window is not directly the same.
it works for me so far with point, line and rectangle ... but I get it only in black and have some trouble toremove it properly.
Post 28 Jul 2014, 22:14
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20299
Location: In your JS exploiting you and your system
revolution 28 Jul 2014, 22:38
If you give your window the WS_EX_TOPMOST flag then you will be painting directly to the screen since it will obscure all windows behind it. The only difference between what you are doing and a WS_EX_TOPMOST window is that other windows with the WS_EX_TOPMOST flag (if you have any) could overlap it if they are higher in the Z-order.
Post 28 Jul 2014, 22:38
View user's profile Send private message Visit poster's website Reply with quote
AsmGuru62



Joined: 28 Jan 2004
Posts: 1618
Location: Toronto, Canada
AsmGuru62 29 Jul 2014, 14:45
Also, if you set the window style to exclude borders and title - then it will be the same rectangle you just painted.
Post 29 Jul 2014, 14:45
View user's profile Send private message Send e-mail Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2909
Location: 0x77760000
typedef 08 Aug 2014, 13:05
revolution wrote:
upsurt wrote:
<snip>

But they don't clean the whole rectangle, only a part. So they will be a black part left. Sad

WHY??
Because the OS uses a lot of optimisations to make things more efficient. But when you do thing manually without informing the OS about changes then things get out of sync.

BTW: If you used a formal window then you won't have this problem.


Or just create a message loop.
Post 08 Aug 2014, 13:05
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2

< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.