News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Drawing Desktop

Started by Bieb, June 21, 2005, 11:18:08 PM

Previous topic - Next topic

Phil

#30
Actually I didn't use a gradient ... the melted background just turns out to be a function of whatever happened to be on your screen when the melt begins. Were you talking about uncovering a roadmap of the processors substrates and such as the image continues to melt? That would be neat to reveal the inner workings! When you said processor core it reminded me of all those tiny donuts that were stitched together back in the 60's to help our machines remember things!

I do have a rather strange sense of humor but I'm not sure I'd call it purverse ... many others I know probably would call it that though! I'd like to see the melt complete and reveal something like this puzzle at which point the mouse and keys would begin to function normally again!


Bieb

#31
Very interesting stuff.  I've found a program that does exactly the type of thing I'd like to do, so now I just have to remember enough C to understand how they did it...

http://sourceforge.net/projects/drempels/

Phil

#32
Robert,
  Thank you for opening this thread. It's been quite interesting. I've grabbed the Drempels source and setup and I'll give it a look. Sure is a lot of code there. I hope it's compatible with XP so I can give it a thorough test. Looks like they're beyond C by a plus plus! Same idea, different principals ... sort of like the difference between middle and high school! Edit: (I hope that came across okay ... Contrary to what Mant had to say about assembly, I think that's a lot like 2nd year college! You're learning important stuff that helps you understand how it all fits together so you can make the machine do your bidding!)

  Drempels is really neat! Seems to work fine with XP but I did notice that the config desktop icon only allowed me to configure things once. The second time I clicked on it to change the configuration I had set I was out of luck. Instead, I restored my default screen saver by setting the display properties directly and all was well.

  I'll have a look thru the source code and see if I can identify where it grinds all the display bits. If I can figure it out quickly I'll slip it into the melt template for you. Maybe I can figure out how to change from being the TOPMOST window to the UNDERMOST (or Desktop) window while I'm at it. If I succeed I'll edit this post again and attach a zip for you.

Later:
  Okay then, I've had a look and this is going to take some time! All of the algo's appear to be in main.cpp but they're not yet clear to me ... it doesn't look like this would be a great place to be learning C plus plus ... There's certainly a lot going on. I'll check back later and let you know if I can come up with anything that embodies the spirit of these algos!

hutch--

Phil,

I sent your MELT program to friends in the country and they loved it.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

chep

Hi,

I managed to "melt" only the desktop, and to keep icons properly displayed. However there's some flicker, and the algo doesn't seem to start until the desktop has to be repaint. :(


At the beginning of MeltThread, replace
MeltThread:
    invoke GetDC, 0
    mov    hDC, eax
    invoke CreateDC,ADDR szDisplay, NULL, NULL, NULL
    mov    hdcScreen, eax

with
MeltThread:
    invoke GetListViewHandle
    mov    hWndListView, eax
    invoke GetDesktopHandle

    invoke GetDC, eax;0
    mov    hDC, eax
    ;invoke CreateDC,ADDR szDisplay, NULL, NULL, NULL
    mov    hdcScreen, eax


(where both Get*Handle come from the "missing windows feature" thread)

to make the icons refresh:
@@:
    call   Melt
    invoke InvalidateRect, hWndListView, 0, 0 ; allow icons to be redrawn
    invoke Sleep, 10
    ...


plus ShowWindow SW_MINIMIZED to allow using the desktop normally, and DeleteDC(hdcScreen) commented (no longer needed)

Here is the source

[attachment deleted by admin]

doomsday

I haven't been paying careful attention to this thread but might I suggest that LockWindowUpdate might be handy (or course then maybe not).

regards,
-Brent

Rifleman

Chep's version also does not melt the active window, it runs behind it

Pretty kewl,
Paul

Faiseur

Hello Phil,

Thanks for your examples. I modified Melt for an effect "Trouble" (french language), which can be used to give the impression of heat (or a movement on water).


"Quake" and "Melt" are free sources?


[attachment deleted by admin]
French asm Forum: http://www.asmforum.net/   Website: http://www.faiseur.net/

Phil

Faiser: Pretty neat! Everything and an awesome picture all in one window! I'm not entirely certain that you need it but I noticed that you had changed the ExitThread call to something else in the Quake thread. Maybe your CloseHandle takes care of the cleanup. Anyway, I liked what you did! The source is all for public consumption here at the MasmForum and all points beyond!

Rifleman

Faiseur,
I am not sure what the TroubleEffect is supposed to doo because it does nothing much on my machine.  The picture appears to shake a little but that is it.

Paul

hutch--

I get the slight shaking effect and it looks something like an earthquake.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

Faiseur

Hello Phil,

thanks for all. I think that with CloseHandle to remove ExitThread does not pose problem (I had checked with Memproof) but I can be mistaken.


Hello Hutch and Rifleman,

yes, it is rather subjective.  The idea is to make an effect of heat or vapor, but one can also see it like an earthquake.  Here another example or I targeted a small part of the effect on an image (in top on the left), I think that it is more convincing.

Regards,

Faiseur


[attachment deleted by admin]
French asm Forum: http://www.asmforum.net/   Website: http://www.faiseur.net/

Rifleman

Faiseur,
The second one does absolutely nothing.  And, no offence meant, but any one who can claim the first one is an earthquake effect has obviously never experienced one first hand.  I would say yours is probably a 2 o 3 on the R Scale.

About all I can say in a positive way about the two versions is you certainly have some GREAT photos!!
Paul

Faiseur

Hello Rifleman,

no problem, thank for report.

French asm Forum: http://www.asmforum.net/   Website: http://www.faiseur.net/

Mark Jones

I know what you're trying to accomplish Marc, it's where the heat causes uneven expansion of the air and changes its density, resulting in a blurry, wavering image. Thermal Aberration  I think it's called. One way to make it more convincing would be to use say, three semi-transparent layers, each shimmering differently. And slow it down a little. And if possible, blur the moved areas. :)

Here's a good reference photo of the effect: http://homepage.mac.com/allegheny/guide/mi/lakeodessa.html

Here's another interesting photo: http://members.cox.net/foogoo/Baja_MemDay2003/RedSunrise.jpg
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08