Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

GDI+ standard library 1.45 by tic


  • Please log in to reply
1385 replies to this topic
Weg
  • Members
  • 7 posts
  • Last active: Feb 04 2012 11:48 AM
  • Joined: 23 Feb 2011

I used GDIP to make a rotating 3D cube

Nice! But instead of doing this
Loop
{
   CreateGdipStuff()
   Draw()
   DeleteGdipStuff()
}
I think you should try to do this
CreateGdipStuff()
Loop
{
   Draw()
}
DeleteGdipStuff()
And you should delete those pens somewhere. It's a memory leak as far as I know. But nice work regardless!

gamax92
  • Members
  • 411 posts
  • Last active: Aug 06 2013 05:00 AM
  • Joined: 05 Dec 2010
I asked Uberi about the best way of doing FRAME stuff and he told me i had to delete everything and recreate it to update the window from a clean slate.

Though i will try what you said.

EDIT: Yeah i have to destroy-create everything. Else it doesnt clear the graphics on the screen.

gamax92
  • Members
  • 411 posts
  • Last active: Aug 06 2013 05:00 AM
  • Joined: 05 Dec 2010
Heres another version except it rotates a sprite on screen.

Its a bit larger so ill paste a pastebin.com version.

AHK_Basic = <!-- m -->http://pastebin.com/ssBenKd6<!-- m -->

AHK_L = <!-- m -->http://pastebin.com/Bx6H1jEZ<!-- m -->

Heres a list of urls you can try:
Green Leaf
Red Apple
Parrot?
Rat Eating Cheese
Half-Eaten Apple - 16 colors and looks like crap.
Grapes
Burger
CAAAAKE
Pizza
EDIT: Thanks to yui i dont have to destroy the screen all the time.

noname
  • Members
  • 650 posts
  • Last active:
  • Joined: 12 Nov 2011

delete everything and recreate it to update the window from a clean slate.




Instead you can only clear the graphics "Gdip_GraphicsClear(G)" and not recreate the whole thing.You can leave that outside the loop.

I still have cpu 100% when running the code but it is an old celeron PC

part of the code to show the changes:

Gui, 1: -Caption +E0x80000 +LastFound +OwnDialogs +Owner +AlwaysOnTop
Gui, 1: Show, NA
hwnd1 := WinExist()


TickCount := A_TickCount
hbm := CreateDIBSection(Width, Height)
hdc := CreateCompatibleDC()
obm := SelectObject(hdc, hbm)
G := Gdip_GraphicsFromHDC(hdc)
Gdip_SetSmoothingMode(G, 4)

loop
{

Loop, % NumLines
{
    theta += 1
    phi += 1
	lRx_%a_index%_1 := (lOx_%a_index%_1 * -1) * s_%theta% + lOy_%a_index%_1 * c_%theta%
	lRy_%a_index%_1 := (lOx_%a_index%_1 * -1) * c_%theta% * s_%phi% - lOy_%a_index%_1 * s_%theta% * s_%phi% - lOz_%a_index%_1 * c_%phi% + 1
	lRz_%a_index%_1 := (lOx_%a_index%_1 * -1) * c_%theta% * c_%phi% - lOy_%a_index%_1 * s_%theta% * c_%phi% + lOz_%a_index%_1 * s_%phi%

	lRx_%a_index%_2 := (lOx_%a_index%_2 * -1) * s_%theta% + lOy_%a_index%_2 * c_%theta%
	lRy_%a_index%_2 := (lOx_%a_index%_2 * -1) * c_%theta% * s_%phi% - lOy_%a_index%_2 * s_%theta% * s_%phi% - lOz_%a_index%_2 * c_%phi% + 1
	lRz_%a_index%_2 := (lOx_%a_index%_2 * -1) * c_%theta% * c_%phi% - lOy_%a_index%_2 * s_%theta% * c_%phi% + lOz_%a_index%_2 * s_%phi%

	IF ((lRz_%a_index%_1 + zCenter) != 0)
	{
		scrX_%a_index%_1 := Scale * (lRx_%a_index%_1 / (lRz_%a_index%_1 + zCenter)) + xCenter
		scrY_%a_index%_1 := Scale * -(lRy_%a_index%_1 / (lRz_%a_index%_1 + zCenter)) + yCenter
	}

	IF ((lRz_%a_index%_2 + zCenter) != 0)
	{
		scrX_%a_index%_2 := Scale * (lRx_%a_index%_2 / (lRz_%a_index%_2 + zCenter)) + xCenter
		scrY_%a_index%_2 := Scale * -(lRy_%a_index%_2 / (lRz_%a_index%_2 + zCenter)) + yCenter
	}
    theta -= 1
    phi -= 1
}
Loop, % NumLines
{
    Values := "0xFF" SubStr(lOc_%a_index%, 1, 6)
    pPen := Gdip_CreatePen(Values, 48)
	If (Values != "0xFFFFFFFF")
        Gdip_DrawLine(G, pPen, scrX_%a_index%_1, scrY_%a_index%_1, scrX_%a_index%_2, scrY_%a_index%_2)
    Gdip_DeletePen(pPen)
}
 
theta := Mod(theta + thetaRot,360)
phi := Mod(phi + phiRot,360)
Clock += .1

UpdateLayeredWindow(hwnd1, hdc, (A_ScreenWidth/2)-(Width/2), (A_ScreenHeight/2)-(Height/2), Width, Height)

Gdip_GraphicsClear(G)
Sleep, % 33 - (A_TickCount - TickCount)
}
Return

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

Exit:
; gdi+ may now be shutdown on exiting the program
SelectObject(hdc, obm)
DeleteObject(hbm)
DeleteDC(hdc)
Gdip_DeleteGraphics(G)
Gdip_Shutdown(pToken)
ExitApp
Return


gamax92
  • Members
  • 411 posts
  • Last active: Aug 06 2013 05:00 AM
  • Joined: 05 Dec 2010
Thanks for that, i updated the two files to include that.

I also implemented a way to replace the image.
It can download a file from the Internet, load one from your HDD, or use the FailSafe apple. Currently its set on FailSafe apple.

And i reduced the height of the file, i say height because i compacted the 12000 some lines into 6 chunks of lines.

Uberi
  • Moderators
  • 1119 posts
  • Last active: May 02 2015 06:05 PM
  • Joined: 23 Aug 2010

I asked Uberi about the best way of doing FRAME stuff and he told me i had to delete everything and recreate it to update the window from a clean slate.

Though i will try what you said.

EDIT: Yeah i have to destroy-create everything. Else it doesnt clear the graphics on the screen.


Actually there is another way if some parts of your output remain static: use multiple bitmaps as "layers" and then either DrawImage() or BitBlt() them together.

nimda
  • Members
  • 4368 posts
  • Last active: Aug 09 2015 02:36 AM
  • Joined: 26 Dec 2010
Very cool! You should post it in the GDI+ examples thread :)

tic
  • Members
  • 1934 posts
  • Last active: Dec 21 2015 01:05 PM
  • Joined: 22 Apr 2007
Very awesome gamax92!

kenn
  • Members
  • 407 posts
  • Last active: Jan 14 2015 08:16 PM
  • Joined: 11 Oct 2010
Is it possible to detect range of patterns in images? I want to get coordinates of squares in a chessboard and split them by their ranges.

kenn
  • Members
  • 407 posts
  • Last active: Jan 14 2015 08:16 PM
  • Joined: 11 Oct 2010
This code posted in this thread do somewhat what I want but how can I get cropped square's coordinates?
SetBatchLines, -1
If !FileExist("Chess_Board.gif")
UrlDownloadToFile, http://www.autohotkey.net/~kenn/Chess_Board.gif, Chess_Board.gif
If !pToken := Gdip_Startup()
{
   MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system
   ExitApp
}
OnExit, Exit

Variation := 3

Gui, 1: -Caption +E0x80000 +LastFound +OwnDialogs +Owner +AlwaysOnTop
Gui, 1: Show, NA
hwnd1 := WinExist()

if !pBitmap := Gdip_CreateBitmapFromFile("Chess_Board.gif")
{
   MsgBox, 48, File loading error!, Could not load the image specified
   ExitApp
}

Gdip_GetDimensions(pBitmap, Width, Height)
pBitmapOut := Gdip_CreateBitmap(Width, Height)

hbm := CreateDIBSection(Width, Height), hdc := CreateCompatibleDC(), obm := SelectObject(hdc, hbm)
G := Gdip_GraphicsFromHDC(hdc)
Gdip_DrawImage(G, pBitmap, 0, 0, Width, Height, 0, 0, Width, Height)

UpdateLayeredWindow(hwnd1, hdc, (A_ScreenWidth-Width)//2, (A_ScreenHeight-Height)//2, Width, Height)
OnMessage(0x201, "WM_LBUTTONDOWN")
return

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

WM_LBUTTONDOWN(wparam, lparam)
{
   global G, pBitmap, pBitmapOut, Width, Height, Variation, hwnd1, hdc
   x := lparam & 0xffff, y := lParam >> 16
   E := Gdip_BitmapReplaceColor(pBitmap, pBitmapOut, Gdip_GetPixel(pBitmap, x, y), 0x00000000, Variation)
   Gdip_GraphicsClear(G)
   Gdip_DrawImage(G, pBitmapOut)
    UpdateLayeredWindow(hwnd1, hdc)
   SetTimer, Revert, -2000
}

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

Revert:
Gdip_GraphicsClear(G)
Gdip_DrawImage(G, pBitmap)
UpdateLayeredWindow(hwnd1, hdc)
return

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

Gdip_BitmapReplaceColor(pBitmap, ByRef pBitmapOut, Color, ReplaceColor, Variation)
{
   static BitmapReplaceColor
   if !BitmapReplaceColor
   {
      MCode_BitmapReplaceColor := "83EC248B4424388B4C243C995683E2038BF103C28B542438C1FE10C1F90881E6FF00000081E1FF000000C1F8028"
      . "9742408894C244085D20F8E0A010000538B5C2430558B6C245033C903C0578B7C243C03C0894C241C89442430897C241889542420837C2440000F8"
      . "EB90000008D43018BD32BD083C202895424282BF5894C244403C88BD32BD08B442440897424248954242C89442410EB0B8DA424000000008B74242"
      . "48B5424280FB6140A0FB6013BD67E0A8B74241403F53BD67C268B74244C2BF53BC67E248B5C244C03DD3BC38B5C24387C0E3BC67E128B74244C03F"
      . "53BC67D088B4424508907EB228B7424440FB6741E03C1E6080BF28B54242CC1E6080BF00FB6040AC1E6080BF08937834424440483C10483C704FF4"
      . "C241075828B4C241C8B7424148B7C2418037C2430034C2448FF4C2420897C2418894C241C0F851EFFFFFF5F5D5BB8010000005E83C424C3"

      VarSetCapacity(BitmapReplaceColor, StrLen(MCode_BitmapReplaceColor)//2)
      Loop % StrLen(MCode_BitmapReplaceColor)//2      ;%
         NumPut("0x" SubStr(MCode_BitmapReplaceColor, (2*A_Index)-1, 2), BitmapReplaceColor, A_Index-1, "char")
   }

   Width := Gdip_GetImageWidth(pBitmap), Height := Gdip_GetImageHeight(pBitmap)
   if (Width != Gdip_GetImageWidth(pBitmapOut) || Height != Gdip_GetImageHeight(pBitmapOut))
      return -1

   if (Variation > 255 || Variation < 0)
      return -2

   E1 := Gdip_LockBits(pBitmap, 0, 0, Width, Height, Stride1, Scan01, BitmapData1)
   E2 := Gdip_LockBits(pBitmapOut, 0, 0, Width, Height, Stride2, Scan02, BitmapData2)
   if (E1 || E2)
      return -3

   E := DllCall(&BitmapReplaceColor, "uint", Scan01, "uint", Scan02, "int", Width, "int", Height, "int", Stride1, "int", Color, "int", ReplaceColor, "int", Variation)
   Gdip_UnlockBits(pBitmap, BitmapData1), Gdip_UnlockBits(pBitmapOut, BitmapData2)
   return 0
}


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

Esc::
Exit:
Gdip_DisposeImage(pBitmapOut), Gdip_DisposeImage(pBitmap)
SelectObject(hdc, obm), DeleteObject(hbm), DeleteDC(hdc)
Gdip_DeleteGraphics(G)
Gdip_Shutdown(pToken)
ExitApp
return


jleslie48
  • Members
  • 145 posts
  • Last active: Nov 28 2016 06:41 PM
  • Joined: 29 Jun 2010
newbie here and I'm completely amazed by what I see in this library. I'm going through the examples and I've read up to PAGE 22 of this entry, and I've gone through the search and documentation, but some understanding is escaping me.

I can't find any explanation for the gui options and how they work:

(from example 10 the picture rotator);
; Create a layered window (+E0x80000 : must be used for UpdateLayeredWindow to work!) that is always on top (+AlwaysOnTop), has no taskbar entry or caption
; This will be used as the 2nd gui so that we can show our image on it

Gui, 2: -Caption +E0x80000 +LastFound +OwnDialogs +Owner +AlwaysOnTop

I know something here has turned off windows frame, but I've been deleting and adding these options for an hour now and I can't make sense of them. For example if I remove the "-Caption" option I can no longer drag my photograph around the screen. Well that doesn't make sense to me. What's going on?

I'll reserve my questions about my specific application for after I've RTFM, but I have not been able to get past the above code. I can't find a decent explanation to the parameters:

+E0x80000
-Caption
+LastFound
+OwnDialogs
+Owner

I mean within context. For example:

(from tutorial 9, the progress bar)
; Note we have set the 0xE style for it to accept an hBitmap later and also set a variable in order to reference it (could also use hwnd)
Gui, 1: Add, Picture, x10 y+30 w400 h50 0xE vProgressBar

I can't find any documentation for style "0xE"

I went to the Gui documentation, and the big list of styles, but 0xe is not on the list. I guess what I'm looking for is a good explanation of the "GUI" options with respect to option cause and effect.

FWIW, my goal really started out with trying to put png's and gif's with transparent backgrounds on a gui window, Gif's that were clickable. I"m trying to make a virtual control panel:
<!-- m -->http://i306.photobuc... ... Mpanel.jpg<!-- m -->

or this:

<!-- m -->http://masterlenskee... ... nel-05.jpg<!-- m -->



For the switches, I wanted to be able to swap two gif's, the "off" gif, withteh "on" gif. From what I've read of this utility I might just want rotate my "switch" gif 180 degrees :) I will also want to make sliders, and volume meters, and I can see that this tool is invaluable for this type of display.

Tia,

jleslie48

tic
  • Members
  • 1934 posts
  • Last active: Dec 21 2015 01:05 PM
  • Joined: 22 Apr 2007

+E0x80000
-Caption
+LastFound
+OwnDialogs
+Owner


+E0x80000 - Layered window style from msdn
<!-- m -->http://msdn.microsof...y/ms997507.aspx<!-- m -->
You need to find the enumeration for WS_EX_LAYERED

-Caption
+LastFound 
+OwnDialogs 
+Owner

These are all in the ahk helpfile

0xE is SS_BITMAP
<!-- m -->http://msdn.microsof...y/9h0ay857.aspx<!-- m -->
Also have to find the enumeration for that

ps. Would you be able to reduce the size of your image please to help loading of the pages. Thanks

jleslie48
  • Members
  • 145 posts
  • Last active: Nov 28 2016 06:41 PM
  • Joined: 29 Jun 2010
Ok, I"ve read through the 60 pages of this thread, and there are bits and
pieces of what I'm trying to accomplish, but I can't see how to put them
together.

I'm working with the tutorial 10, the one that combines a "regular" gui
with a gdi one. Here is my code:

;
; AutoHotkey Version: 1.x
; Language:       English
; Platform:       Win9x/NT
; Author:         A.N.Other <myemail@nowhere.com>
;
; Script Function:
;	Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
;

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

;---------------------------------
; gdi+ ahk tutorial 10 written by tic (Tariq Porter)
; Requires Gdip.ahk either in your Lib folder as standard library or using #Include
;
; Tutorial to rotate, flip or mirror an image

#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

; Create a gui where we can select the file we want to rotate, the angle to rotate it by and whether we want to flip it
Gui, 1: +ToolWindow ; +AlwaysOnTop
Gui, 1: Add, Edit, x10 y10 w300 vFile, 
Gui, 1: Add, Button, x+10 yp+0 w75 gFileSelect Default, &File...
Gui, 1: Add, Button, x+10 yp+0 w75 gGo, Go

; Here is the slider allowing rotation between 0 and 360 degrees
Gui, 1: Add, Slider, x10 y+10 w300 Tooltip vAngle Range0-360, 0

; Create 2 checkboxes, to select whether we want to flip it horizontally or vertically
Gui, 1: Add, CheckBox, x+10 yp+0 vHorizontal, Flip horizontally
Gui, 1: Add, CheckBox, x+10 yp+0 vVertical, Flip vertically
Gui, 1: Add, Picture, x100 y100 , speedometer-0.png

Gui, 1: Show, x500 y50 w600 h600 ;AutoSize

; Create a layered window (+E0x80000 : must be used for UpdateLayeredWindow to work!) that is always on top (+AlwaysOnTop), has no taskbar entry or caption
; This will be used as the 2nd gui so that we can show our image on it
;Gui, 2: -Caption +E0x80000 +LastFound +OwnDialogs +Owner +AlwaysOnTop
Gui, 2:  +E0x80000 +LastFound +OwnDialogs +Owner +AlwaysOnTop

; Show the window
Gui, 2: Show, NA

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

; By placing this OnMessage here. The function WM_LBUTTONDOWN will be called every time the user left clicks on the gui. This can be used for dragging the image
OnMessage(0x201, "WM_LBUTTONDOWN")
Return

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

Go:

; Submit the variables to see the degress to rotate by and whether to flip the image
Gui, 1: +OwnDialogs
Gui, 1: Submit, NoHide

; If the file in the edit field is not a valid image then return
If !pBitmap := Gdip_CreateBitmapFromFile(File)
Return

; We should get the width and height of the image, in case it is too big for the screen then we can resize it to fit nicely
OriginalWidth := Gdip_GetImageWidth(pBitmap), OriginalHeight := Gdip_GetImageHeight(pBitmap)
Ratio := OriginalWidth/OriginalHeight

; If the image has a width larger than 1/2 of the width of the screen or height larger than 1/2 the screen, then we will resize it to be half of the screen
If (OriginalWidth >= A_ScreenWidth//2) || (OriginalHeight >= A_ScreenHeight//2)
{
	If (OriginalWidth >= OriginalHeight)
	Width := A_ScreenWidth//2, Height := Width*(1/Ratio)
	Else
	Height := A_ScreenHeight//2, Width := Height*Ratio
}
Else
Width := OriginalWidth, Height := OriginalHeight

; Width and Height now contain the new dimensions the image on screen will be

; When rotating a square image, then the bitmap or canvas will need to be bigger as you can imagine that once rotated then a triangle will be wider than a square
; We need to know the new dimensions of the image
; With Gdip_GetRotatedDimensions we can plug in the width and height of the image, and the angle it is to be rotated by
; The last 2 parameters are the variables in which tio store the new width and height of the rotated image
; RWidth and RHeight now contain the dimensions of the rotated image
Gdip_GetRotatedDimensions(Width, Height, Angle, RWidth, RHeight)

; We rotate an image about the top left corner of the image, however this will result in the image moving off the canvas
; We can use Gdip_GetRotatedTranslation to find how much the image should be 'shifted' by in the x and y coordinates in order for it to be back on the canvas
; As with the above function, we plug in the width, height and angle to rotate by
; The function will then make the last 2 parameters the x and y translation (this is the distance in pixels the image must be shifted by)
; xTranslation and yTranslation now contain the distance to shift the image by
Gdip_GetRotatedTranslation(Width, Height, Angle, xTranslation, yTranslation)

; We will now create a gdi bitmap to display the rotated image on the screen (as mentioned previously we must use a gdi bitmap to display things on the screen)
hbm := CreateDIBSection(RWidth, RHeight)

; 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,
; and set the InterpolationMode to HighQualityBicubic = 7 so that when resizing the image still looks good
G := Gdip_GraphicsFromHDC(hdc), Gdip_SetInterpolationMode(G, 7)

; We can now shift our graphics or 'canvas' using the values found with Gdip_GetRotatedTranslation so that the image will be drawn on the canvas
Gdip_TranslateWorldTransform(G, xTranslation, yTranslation)

; We can also rotate the graphics by the angle we desire
Gdip_RotateWorldTransform(G, Angle)

; If we wish to flip the image horizontally, then we supply Gdip_ScaleWorldTransform(G, x, y) with a negative x transform
; We multiply the image by the x and y transform. So multiplying a direction by -1 will flip it in that direction and 1 will do nothing
; We must then shift the graphics again to ensure the image will be within the 'canvas'
; You can see that if we wish to flip vertically we supply a negative y transform
If Horizontal
Gdip_ScaleWorldTransform(G, -1, 1), Gdip_TranslateWorldTransform(G, -Width, 0)
If Vertical
Gdip_ScaleWorldTransform(G, 1, -1), Gdip_TranslateWorldTransform(G, 0, -Height)


; As you will already know....we must draw the image onto the graphics. We want to draw from the top left coordinates of the image (0, 0) to the top left of the graphics (0, 0)
; We are drawing from the orginal image size to the new size (this may not be different if the image was not larger than half the screen)
Gdip_DrawImage(G, pBitmap, 0, 0, Width, Height, 0, 0, OriginalWidth, OriginalHeight)

; Even though this is not necessary in this scenario, you should always reset the transforms set on the graphics. This will remove any of the rotations
Gdip_ResetWorldTransform(G)

; We will update the hwnd  with the hdc of our gdi bitmap. We are drawing it at the new width and height and in the centre of the screen
UpdateLayeredWindow(hwnd2, hdc, (A_ScreenWidth-RWidth)//2, (A_ScreenHeight-RHeight)//2, RWidth, RHeight)

; As always we will dispose of everything we created
; So we select the object back into the hdc, the delete the bitmap and hdc
SelectObject(hdc, obm), DeleteObject(hbm), DeleteDC(hdc)
; We will then dispose of the graphics and bitmap we created
Gdip_DeleteGraphics(G), Gdip_DisposeImage(pBitmap)
Return

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

; This is a simple subroutine to select images and change the editbox with the image teh user selects
FileSelect:
Gui, 1: +OwnDialogs
Gui, 1: Submit, NoHide

FileSelectFile, File,,, Select image
If Errorlevel
Return
GuiControl,, File, %File%
Return

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

; This is the function to allow the user to drag the image drawn on the screen (this being gui 2)
WM_LBUTTONDOWN()
{
	If (A_Gui = 2)
	PostMessage, 0xA1, 2
}

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

; If the user closes the gui or closes the program then we want to shut down gdi+ and exit the application
;Esc::
GuiClose:
Exit:
Gdip_Shutdown(pToken)
ExitApp
Return


and I've set up a directory with all my pngs. there is even a zip file of it
all together here:

http://jleslie48.com...es/speedometer/

I've updated the tutorial 3 to have a size of 600x600, and have the
background image of a speedometer. I'm using the gdi library for the
speed indicator. My issue is I want the speed indicator needle to follow
the location of the gui box:

Posted Image

as I move (and/or) resize the gui box. What is the preferred way to do
this?


Posted Image

kenn
  • Members
  • 407 posts
  • Last active: Jan 14 2015 08:16 PM
  • Joined: 11 Oct 2010
@jleslie48, I'm interested in your project, it looks nice. I wonder the working state of it, I hope you publish the codes in the end. Algorithm that is used drawing parabolic lines in this topic may help you <!-- m -->http://www.autohotke...topic80092.html<!-- m -->
Regards

jleslie48
  • Members
  • 145 posts
  • Last active: Nov 28 2016 06:41 PM
  • Joined: 29 Jun 2010

@jleslie48, I'm interested in your project, it looks nice. I wonder the working state of it, I hope you publish the codes in the
end. Algorithm that is used drawing parabolic lines in this topic may help you <!-- m -->http://www.autohotke...topic80092.html<!-- m -->
Regards


I have already published; if you click on the link I supplied the entire project to date is in a zip file for your review.

Its a great project. I will be looking at your link shortly. It's actually a lot
bigger project. I have to convert an entire analog control box to virtual
control. I will be attaching the "speedometer" input values to an A/D
converter and picking up the decibel levels of a microphone sensor so that
the operator knows the background noise level. Here is the start of the
project:

Posted Image

this I is already programmed using "standard" autohotkey implemenation.
It's shortcomings include the ability to handle transparent backgrounds,
and the rotation aspect. To get those elements into the project, searching
this forum brought me here.

This gdi package seems to be capable of doing everything and then some,
but the entire package is overwhelming and I'm hoping for some help.
The examples I've seen so far make the gdi displays independent and
not attached to other elements or the example are too complex to divide
and extract the elements I need.
I think that a good discussion on integrating the gdi suite into a traditional
gui application would be of good use to many. A discussion that starts
off simply enough, and then builds the elements one at a time. I not so
altrulistically submit my "speedometer" project as a starting point. I think
getting that to work, and then combining it with my toggle switches, then
adding volume knobs, sliders, etc. would go a long way to de-mystifying
this wonderful suite of commands.



- Jon