AutoHotkey Community

It is currently May 27th, 2012, 6:22 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 1000 posts ]  Go to page Previous  1 ... 36, 37, 38, 39, 40, 41, 42 ... 67  Next
Author Message
 Post subject:
PostPosted: December 9th, 2010, 5:31 pm 
I do not know the code you are talking about but you need a math operation to see the hex (see helpfile on setformat )

Code:
var:=255
setformat,integer,hex
msgbox %var%  still no hex!!

var +=0
msgbox %var%  but after adding zero.....


Report this post
Top
  
Reply with quote  
 Post subject: Throbber
PostPosted: December 9th, 2010, 5:53 pm 
mrr19121970,
That's pretty close to the one I linked, but its not as smooth, no shades and size is not the same, can you make it identical to the linked one?
Also it doesn't stick to one place, sometimes its too far away from the mouse.

Sorry if I'm asking too much
And thanks
And wish me good luck, I'm gonna need it
"Assange"


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 9th, 2010, 9:28 pm 
Offline

Joined: April 22nd, 2007, 6:33 pm
Posts: 1833
Very nice mrr19121970


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: Throbber
PostPosted: December 10th, 2010, 7:44 am 
Assange wrote:
mrr19121970,
That's pretty close to the one I linked, but its not as smooth, no shades and size is not the same, can you make it identical to the linked one?
Also it doesn't stick to one place, sometimes its too far away from the mouse.

Sorry if I'm asking too much
And thanks
And wish me good luck, I'm gonna need it
"Assange"


Yeah sure I can do it, but I'm not going to ;) You're going to have to play around with it yourself. You'll never learn otherwise.

Hint, for the shadow. create a brush with transparent attributes

Code:
pBrush1 := Gdip_BrushCreateSolid(0x10ff0000)


and paint the circles slightly offset:

Code:
Gdip_FillEllipse(G, pBrush1, Origin_X+OX[b]-(Circle_Size/2)[/b], Origin_Y+OY[b]-(Circle_Size/2)[/b], Circle_Size, Circle_Size)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 10th, 2010, 7:47 am 
Offline

Joined: April 30th, 2009, 12:35 pm
Posts: 29
Opps, I wasn't logged in when I posted the reply.

You can do other stuff by messing around with the radius and distance between the circles. Spiral in spiral out, make them catch up with each other and the likes. Samples here:

Code:
; gdi+ ahk tutorial 1 written by tic (Tariq Porter)
; Requires Gdip.ahk either in your Lib folder as standard library or using #Include
;
; Tutorial to draw a single ellipse and rectangle to the screen

#SingleInstance, Force
#NoEnv
SetBatchLines, -1

; Uncomment if Gdip.ahk is not in your standard library
;#Include, Gdip.ahk

; Start gdi+
If !pToken := Gdip_Startup()
{
   MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system
   ExitApp
}
OnExit, Exit

Origin_X:=100 ;Width//2
Origin_Y:=100 ;Height//2

Radius := 30
Radius_Max := 75
Radius_Min := 25
Direction := 1
Circle_Count := 9
Speed := 3.2 ; 0 = slooow, 100 = faaast
Gap := 32 ; 0 = overlapping, 100 = miles away
Circle_Step := 1.6 ; 0 = all same size, 5 = bigg difference

; Set the width and height we want as our drawing area, to draw everything in. This will be the dimensions of our bitmap
Width := Radius_Max+(Circle_Count*Circle_Step*2)+Origin_X, Height := Radius_Max+(Circle_Count*Circle_Step*2)+Origin_Y

; Create a layered window (+E0x80000 : must be used for UpdateLayeredWindow to work!) that is always on top (+AlwaysOnTop), has no taskbar entry or caption
Gui, 1: -Caption +E0x80000 +LastFound +AlwaysOnTop +ToolWindow +OwnDialogs

; Show the window
Gui, 1: Show, NA

; Get a handle to this window we have created in order to update it later
hwnd1 := WinExist()

SetTimer,My_Timer,100

Return

My_Timer:

; Create a gdi bitmap with width and height of what we are going to draw into it. This is the entire drawing area for everything
hbm := CreateDIBSection(Width, Height)

; Get a device context compatible with the screen
hdc := CreateCompatibleDC()

; Select the bitmap into the device context
obm := SelectObject(hdc, hbm)

; Get a pointer to the graphics of the bitmap, for use with drawing functions
G := Gdip_GraphicsFromHDC(hdc)

; Set the smoothing mode to antialias = 4 to make shapes appear smother (only used for vector drawing and filling)
Gdip_SetSmoothingMode(G, 4)

; Create a fully opaque red brush (ARGB = Transparency, red, green, blue) to draw a circle
pBrush := Gdip_BrushCreateSolid(0xffff0000)
pBrush1 := Gdip_BrushCreateSolid(0x20ff0000)

; Fill the graphics of the bitmap with an ellipse using the brush created
; Filling from coordinates (100,50) an ellipse of 200x300

Tx += 0.01745329252 * Speed ; degrees->radians
T := Tx

Radius := Radius + Direction

If ((Radius > Radius_Max) and (Direction > 0))
or ((Radius < Radius_Min) and (Direction < 0))
   Direction := Direction * -1

Loop,%Circle_Count%
{
   Circle_Size := Circle_Step * A_Index
;   T += Circle_Size * Gap * 0.01745329252
   T += Gap * 0.01745329252
   OX := Radius*Cos(T)
   OY := Radius*Sin(T)
   Gdip_SetInterpolationMode(G,0)
   Gdip_FillEllipse(G, pBrush, Origin_X+OX, Origin_Y+OY, Circle_Size, Circle_Size)
   Gdip_FillEllipse(G, pBrush1, Origin_X+OX-(Circle_Size/2), Origin_Y+OY-(Circle_Size/2), Circle_Size, Circle_Size)
}

; Delete the brush as it is no longer needed and wastes memory
Gdip_DeleteBrush(pBrush)
Gdip_DeleteBrush(pBrush1)

; Update the specified window we have created (hwnd1) with a handle to our bitmap (hdc), specifying the x,y,w,h we want it positioned on our screen
; So this will position our gui at (0,0) with the Width and Height specified earlier
UpdateLayeredWindow(hwnd1, hdc, 0, 0, Width, Height)

; Select the object back into the hdc
SelectObject(hdc, obm)

; Now the bitmap may be deleted
DeleteObject(hbm)

; Also the device context related to the bitmap may be deleted
DeleteDC(hdc)

; The graphics may now be deleted
Gdip_DeleteGraphics(G)
Return

;#######################################################################

Exit:
; gdi+ may now be shutdown on exiting the program
Gdip_Shutdown(pToken)
ExitApp
Return


Last edited by mrr19121970 on December 12th, 2010, 10:50 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 10th, 2010, 3:59 pm 
Offline

Joined: April 22nd, 2007, 6:33 pm
Posts: 1833
One note though....you shouldnt create the layered window at the same size as the screen...it should be as small as possible, so create it as the diameter of the circle. updating a layered window is the bottleneck in this library


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 10th, 2010, 4:13 pm 
Eh, I told you I can't deal with advanced scripting, and I asked if someone could and would do it, now you did half of it and then started preaching on me, it was a REQUEST dude.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 10th, 2010, 4:13 pm 
Eh, I told you I can't deal with advanced scripting, and I asked if someone could and would do it, now you did half of it and then started preaching on me, it was a REQUEST dude.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 10th, 2010, 4:14 pm 
Sorry for double post, please delete one and this


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 10th, 2010, 4:15 pm 
Just wondering: Performance wise - how does layering multiple bitmaps into one image on one GUI compare to multiple bitmap images on separate GUIs layered?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 12th, 2010, 10:51 am 
Offline

Joined: April 30th, 2009, 12:35 pm
Posts: 29
tic wrote:
One note though....you shouldnt create the layered window at the same size as the screen...it should be as small as possible, so create it as the diameter of the circle. updating a layered window is the bottleneck in this library


I updated the 2nd example taking this into consideration.

Code:
; Set the width and height we want as our drawing area, to draw everything in. This will be the dimensions of our bitmap
Width := Radius_Max+(Circle_Count*Circle_Step*2)+Origin_X, Height := Radius_Max+(Circle_Count*Circle_Step*2)+Origin_Y


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 12th, 2010, 2:49 pm 
I love you mrr19121970


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: December 17th, 2010, 1:16 pm 
Offline

Joined: August 30th, 2010, 9:05 pm
Posts: 21
It doesn't work on my Vista x64. Does anyone ran it on this system successfully?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 17th, 2010, 8:26 pm 
Offline
User avatar

Joined: November 2nd, 2008, 4:23 pm
Posts: 2906
Location: 127.0.0.1
Sinel1980 wrote:
It doesn't work on my Vista x64. Does anyone ran it on this system successfully?
Yes.

_________________
aboutscriptappsscripts
Any code ⇈ above ⇈ requires AutoHotkey_L to run


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 17th, 2010, 9:55 pm 
Offline

Joined: August 30th, 2010, 9:05 pm
Posts: 21
Frankie wrote:
Sinel1980 wrote:
It doesn't work on my Vista x64. Does anyone ran it on this system successfully?
Yes.

So the problem is still in 64 bit version of AHK (AHK_L) as i found in this topic
(in this post on previous page).


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1000 posts ]  Go to page Previous  1 ... 36, 37, 38, 39, 40, 41, 42 ... 67  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo, JamixZol, rbrtryn, Stigg and 20 guests


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

Search for:
Powered by phpBB® Forum Software © phpBB Group