Hi all,
I've been working on re-writing my media player
in PB. I am having trouble with my spectrum analyzer.
It seems when drawing on an image created with CreateImage
the imagegadget flickers wildly. the spectrum is displayed but it
flickers. I tried to use RedrawWindow_ api but it flickers as well
and i cannot find any combination of flags that will refresh without
flickering.
Please, someone help!!!
Thanks
Fast Refreshing of ImageGadget
Fast Refreshing of ImageGadget
Neptune Century Inc.
Eric Butler, CEO, Lead programmer
"The road to happiness never ends..."
Eric Butler, CEO, Lead programmer
"The road to happiness never ends..."
I tried doing something like:
The commented code is what I have tried. Some don't work and others
flicker.
EDIT: OK, I tried doing the sort of doublebuffer thing
but it didn't work either. Gosh, there has to be a way!!!!!
Code: Select all
UseImage(#SKIN_VISUAL)
StartDrawing(ImageOutput())
;Clear
Box(0,0,ImageWidth(),ImageHeight(),RGB(0,0,0))
For X = 0 To 511
lVal = 511 / ImageWidth() * X
;lVal = X / ImageWidth()
LineXY(lVal,ImageHeight(),lVal,ImageHeight() - fSpectrum(X) * ImageHeight(),RGB(255,0,0))
Next X
;SendMessage_(GadgetID(#IMG_VISUAL),#WM_PAINT,0,0)
RedrawWindow_(GadgetID(#IMG_VISUAL),0,0,#RDW_VALIDATE | #RDW_UPDATENOW)
;DrawImage(UseImage(#SKIN_VISUAL),0,0)
StopDrawing()
;SetGadgetState(#IMG_VISUAL,UseImage(#SKIN_VISUAL))
flicker.
EDIT: OK, I tried doing the sort of doublebuffer thing
but it didn't work either. Gosh, there has to be a way!!!!!
Neptune Century Inc.
Eric Butler, CEO, Lead programmer
"The road to happiness never ends..."
Eric Butler, CEO, Lead programmer
"The road to happiness never ends..."
if you continuously update the display, why not draw directly on screen? (ie. window) it's not the way to do it, but hey, it works 

( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )