It is currently Thu Jul 18, 2019 6:22 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: capture gadget; 64bit;
PostPosted: Fri Feb 08, 2019 7:09 pm 
Offline
PureBasic Expert
PureBasic Expert

Joined: Sun Apr 12, 2009 6:27 am
Posts: 3351
Quote:
a solution to correctly draw SpinGadget with WM_PRINT


Code:
Procedure capturespin(gadget,output)
  CreateImage(0, GadgetWidth(gadget),GadgetHeight(gadget), 24)
  hdc = StartDrawing(ImageOutput(0))
    hSpin = FindWindowEx_(GetParent_(GadgetID(0)), GadgetID(0), 0, 0)
    SendMessage_(hSpin,#WM_PRINT,hDC, #PRF_CHILDREN|#PRF_CLIENT|#PRF_NONCLIENT| #PRF_ERASEBKGND)
    GrabDrawingImage(10, 0,0,15,25)
    SendMessage_(GadgetID(0),#WM_PRINT,hDC, #PRF_CHILDREN|#PRF_CLIENT|#PRF_NONCLIENT| #PRF_ERASEBKGND)
    DrawImage(ImageID(10),44,0)
  StopDrawing()
  FreeImage(10)
  SetGadgetState(output,ImageID(0))
EndProcedure

OpenWindow(0, 0, 0, 200, 100, "SpinGadget", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
SpinGadget (0, 20, 15, 60, 20, 1, 100, #PB_Spin_Numeric)
SetGadgetState(0,50)

ImageGadget(100, 20, 60, 60,20,0)
capturespin(0,100)

Repeat
    EventID.l = WaitWindowEvent()
    If EventID = #PB_Event_CloseWindow
        Quit = 1
    EndIf
Until Quit = 1
End

_________________
Egypt my love


Top
 Profile  
Reply with quote  
 Post subject: Re: capture gadget; 64bit;
PostPosted: Fri Feb 08, 2019 7:17 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Dec 10, 2010 6:31 pm
Posts: 115
Excellent, thanks RASHAD :D

_________________
Sorry for my bad English.


Top
 Profile  
Reply with quote  
 Post subject: Re: capture gadget; 64bit;
PostPosted: Mon Feb 11, 2019 1:51 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Jul 23, 2011 1:13 am
Posts: 201
Location: Germany
HanPBF wrote:

Ok, of course I would prefer:
Code:
protected ;(or local or var)
  x
  y
  w
  h
endProtected ;(or endLocal or endVar)



Code:
Define x,
       y,
       z


This works.

The first var needs to be in the same line as "Define" (or Protected), though.
If you don't like it, you can still Define a dummy variable and use a macro.

Code:
Macro var
    Define mydummvar
EndMacro

var,
x,
y,
z


Okay, now you need a comma after the "var keyword" and you need to add indentation yourself in the settings (any yet another dummy macro to end indentation)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye