Handle = StartDrawing(OutputID)

Everything else that doesn't fall into one of the other PB categories.
Codemonger
Enthusiast
Enthusiast
Posts: 384
Joined: Sat May 24, 2003 8:02 pm
Location: Canada
Contact:

Handle = StartDrawing(OutputID)

Post 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.
<br>"I deliver Justice, not Mercy"

    - Codemonger, 2004 A.D.
GPI
PureBasic Expert
PureBasic Expert
Posts: 1394
Joined: Fri Apr 25, 2003 6:41 pm

Post by GPI »

StartDrawing return a hDC/DC.
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Post by freak »

WindowOutput() returns a pointer to an internal DrawingInfoStruct Structure.
See the library descriptor.txt in the LibrarySDK, to see the members.

Timo
quidquid Latine dictum sit altum videtur
Codemonger
Enthusiast
Enthusiast
Posts: 384
Joined: Sat May 24, 2003 8:02 pm
Location: Canada
Contact:

Post by Codemonger »

Thanks guys, at work right now. But I'll look into it tonight. I think you pointed me in the right direction.
<br>"I deliver Justice, not Mercy"

    - Codemonger, 2004 A.D.
dige
Addict
Addict
Posts: 1391
Joined: Wed Apr 30, 2003 8:15 am
Location: Germany
Contact:

Re: Handle = StartDrawing(OutputID)

Post 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 ) )
..
User avatar
Fluid Byte
Addict
Addict
Posts: 2336
Joined: Fri Jul 21, 2006 4:41 am
Location: Berlin, Germany

Re: Handle = StartDrawing(OutputID)

Post 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.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
freak
PureBasic Team
PureBasic Team
Posts: 5940
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: Handle = StartDrawing(OutputID)

Post 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.
quidquid Latine dictum sit altum videtur
Post Reply