FastImageOutput
- Joakim Christiansen
- Addict
- Posts: 2452
- Joined: Wed Dec 22, 2004 4:12 pm
- Location: Norway
- Contact:
Illegal memory access...
I testet it with remi_meier's "The beauty of z^2 + c" trick...
http://www.purebasic.fr/english/viewtopic.php?t=22446
I testet it with remi_meier's "The beauty of z^2 + c" trick...
http://www.purebasic.fr/english/viewtopic.php?t=22446
I like logic, hence I dislike humans but love computers.
ThanksIllegal memory access...
I testet it with remi_meier's "The beauty of z^2 + c" trick...
http://www.purebasic.fr/english/viewtopic.php?t=22446

Now FastImageOutput() returns zero if a device dependent bitmap (bitmap created with #PB_Image_DisplayFormat) is used.
To get the code working, just replace:
Code: Select all
img = CreateImage(#PB_Any, #S, #S)
Code: Select all
img = CreateImage(#PB_Any, #S, #S,32)
@all
Thanks for the nice feedback!
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
It will say 0 ms if you aren't using a high-enough-res method of timing. ElapsedMilliseconds() is only good to a resolution of 15 ms or so, and if the operation you're timing finishes faster than that the ElapsedMilliseconds() value will not have changed. Hence the 0 ms. You can get 1ms accuracy easily with:
or look to QueryPerformanceFrequency_() for microsecond accuracy (you shouldn't need this much)
IIRC, when I tested this FastImageOutput() I had to drop to a lower-res method as well to avoid getting 0 ms for a result. I think I posted the method if you look a few posts back in this thread.
Code: Select all
timeBeginPeriod_(1)
start = timeGetTime_()
; timed operation
ending = timeGetTime_()
IIRC, when I tested this FastImageOutput() I had to drop to a lower-res method as well to avoid getting 0 ms for a result. I think I posted the method if you look a few posts back in this thread.
BERESHEIT
Re: FastImageOutput
This code no longer works with v4.10 B3, and I don't know how to fix it.
Changing to "img = CreateImage(#PB_Any, #S, #S,32)" doesn't help as
it doesn't exist in the original code snippet.
Changing to "img = CreateImage(#PB_Any, #S, #S,32)" doesn't help as
it doesn't exist in the original code snippet.
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
@Fred,Fred wrote:I think it's a good approach to have a flexible fast image manipulation. It could be added natively to PB in a future version.
Maybe together with the 'DirectX9' Version of PB?
Belive! C++ version of Puzzle of Mystralia
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
<Wrapper>4PB, PB<game>, =QONK=, PetriDish, Movie2Image, PictureManager,...
- Psychophanta
- Always Here
- Posts: 5153
- Joined: Wed Jun 11, 2003 9:33 pm
- Location: Anare
- Contact:
Re: FastImageOutput
Since PB4.40 drawing on Gadgets with StartDrawing(GadgetOutput(GadgetID.i))
does not work anymore.
May be the Structure has changed?
does not work anymore.
May be the Structure has changed?
Code: Select all
Structure DrawingInfoStruct
Type.l
Window.l
DC.l
ReleaseProcedure.l
PixelBuffer.l
Pitch.l
Width.l
Height.l
Depth.l
PixelFormat.l
StopDirectAccess.l
StartDirectAccess.l
EndStructure
Global FastImgOutputID.DrawingInfoStruct
Procedure ReleaseGadgetOutput()
ReleaseDC_(FastImgOutputID\Window, FastImgOutputID\DC)
EndProcedure
Procedure GadgetOutput(GadgetID) ; returns the outputID for the declared window handle
hwnd = GadgetID(GadgetID)
FastImgOutputID\Type=2
FastImgOutputID\Window=hwnd
FastImgOutputID\DC=GetDC_(hwnd)
FastImgOutputID\ReleaseProcedure=@ReleaseGadgetOutput()
ProcedureReturn FastImgOutputID
EndProcedure
- Michael Vogel
- Addict
- Posts: 2797
- Joined: Thu Feb 09, 2006 11:27 pm
- Contact:
Re: FastImageOutput
Any news about FastImageOutput for PB4.50?
Re: FastImageOutput
It shouldn't have much difference since 4.40.