Page 1 of 1

Handle = StartDrawing(OutputID)

Posted: Tue Nov 25, 2003 7:50 pm
by Codemonger
Quick question,

heres a quote from the docs for StartDrawing()
The return value 'Handle' can be used for WindowsAPI functions.



what is the handle to: is it a DC, Window, and Object ? I'm trying to figure out what it is returning and also what value is WindowOutput() returning ?

Don't know if this makes anysense, but if anyone can help it would be great.

Posted: Tue Nov 25, 2003 9:16 pm
by GPI
StartDrawing return a hDC/DC.

Posted: Tue Nov 25, 2003 10:14 pm
by freak
WindowOutput() returns a pointer to an internal DrawingInfoStruct Structure.
See the library descriptor.txt in the LibrarySDK, to see the members.

Timo

Posted: Tue Nov 25, 2003 10:31 pm
by Codemonger
Thanks guys, at work right now. But I'll look into it tonight. I think you pointed me in the right direction.

Re: Handle = StartDrawing(OutputID)

Posted: Wed Oct 14, 2009 3:30 pm
by dige
With PB 4.40 we have a lot of 2ddrawing changes.
@PB-Team: Is WindowOutput() still a pointer to an
internal DrawingInfoStruct Structure? And if so,
where can I find the new definition?

Or how can I draw on gadgets now like this with
PB 4.31:

Code: Select all

; http://www.purebasic.fr/english/viewtopic.php?t=22328
; User: S.M. Posted: Sat Jun 17, 2006 18:52
; Post subject: FastImageOutput
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) ;GetWindowDC_(hWnd)
  FastImgOutputID\ReleaseProcedure=@ReleaseGadgetOutput()
  ProcedureReturn FastImgOutputID
EndProcedure 
;Example:
StartDrawing ( GadgetOutput ( #ImageGadget ) )
..

Re: Handle = StartDrawing(OutputID)

Posted: Wed Oct 14, 2009 3:42 pm
by Fluid Byte
I guess you won't get an answer on that since it's exactly what freak predicted :twisted:

Sourcecode which is using internal hacks will sooner or later break in future versions of PB.
You are outta luck here unless unless Stefan Moebius comes back some day and tries to extract the internal structures again.

Re: Handle = StartDrawing(OutputID)

Posted: Wed Oct 14, 2009 4:38 pm
by freak
Sorry, we're not releasing information on internals anymore.

The new library is much more complex anyway, such manipulations as you did aren't easily possible anymore.