Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - SilentWorld

Pages: [1]
1
No problem :)

I haven't used DIB at all before so I will need to reference either Petzold or Feng Yuan's book. Correct me if I'm wrong, but the main advantage of using them is that one has direct access to pixels in a DC? In the Freebasic code, this appears to be taken care of. My initial idea, was to load a normal bitmap and make it into a "tilesheet" in memory and iterate over each image in it. This would no doubt be too slow, even if the effect is only going to be used once.

2
Could you add an compiled version (exe) please? ;)

Sure! I've attached all the executables for each variation, along with their source code. Again this would not have been possible without help, but  I have learned a few things. Of course, the real challenge will be to make this work in pure GDI. Feel free to suggest improvements to this code :)

3
Hi guys. Thanks for your suggestions! I have been working on some variations of the effect using some FreeBasic source and a with a little help. The math is a clearer to me now too :)  Here is the code loosely modified from the original written by Dr_Davenstein. I might be wrong, but the win32 equivalents of PSET, PUT and GET would be SrcCopy, BitBlt, and SelectObject. Sorry for the late reply, I was getting a 403 error for a long time which prevented me.

Code: [Select]
#Include "fbgfx.bi"
Screenres 340,120,32,,

Dim As Integer x, y
Dim As Ubyte Ptr buf  = imagecreate(239,44)
Dim As Ubyte Ptr buf2  = imagecreate(239,44)
Bload "blogo.bmp", buf
Color &HFFFFFF, &HFF00FF
Dim As double Ang
Dim As double Ang_x
Dim As double Amplitude
Dim As Integer period
Dim As double frequency
Dim As double delta

Amplitude = 5.0
period = 60
frequency = 1.0
delta = 0.01

Do
    screensync
    ScreenLock
    cls
   
    Ang+= 6.282 * frequency * delta
    Ang_x = Ang
   
    For x = 0 To 238
        Ang_x+=(6.282/period)
        Get buf, (x,0)-(x,43), buf2
         
        Put(x+10,(Amplitude*sin(Ang_x))+30), Buf2, pset
    Next                           
   
    ScreenUnlock
    sleep delta * 1000
   
Loop Until Multikey(FB.SC_ESCAPE)

imageDestroy(buf)
imageDestroy(buf2)

4
The wobble effect is one of my all-time favourites. It is simple but always nice and hypnotic to look at. I am using C and plain GDI for my projects and want to learn how to apply this effect to a bitmap. From my basic understanding, each column or row of pixels moves using sine modulation. I've heard that this probably isn't the best way to do it, but I'm admittedly terrible at math. My programming ability is that of a beginner, however I've been hacking around with the GDI and managed to learn a thing or two. Any help is appreciated!

5
General chat / Re: The Welcoming Committee
« on: September 28, 2020 »
Hi all. I've finally decided to join up here! I've been interested in demos/ intros for a long time and even dabbled in Windows programming a little. I love all the oldschool stuff for the Amiga, Atari ST and MS DOS. While my skills are rudimentary at best, I certainly hope I will be able to learn a lot more as time goes on, and eventually share something worthwhile.

Pages: [1]