LCF-AT Posted October 9, 2016 Posted October 9, 2016 Hi guys, could anybody explain how to build any kind of dynamic graphic illustrations?So how to do this and what do I need to do this? Example: Windows 7 has a little nice analog clock graphic you get to see if you press on the time in the taskbar and now I wanna have / build any similar clock like this but I dont know how I should do this.The first mind I had was to paint a clock picture in any paint app to have the analog clock background (not sure whether this is right) and to show this later in any dialog.As next step I need to build some diffrent clock pointers to show them on this clock anyhow etc.All in all I have no idea how the right way is and thats the reason why I do ask now so maybe you could tell me something about this and how to handle such graphical representations starting just with a clock. Thank you
atom0s Posted October 9, 2016 Posted October 9, 2016 You could make use of Gdi/Gdiplus to generate the graphics on the fly and render them onto the screen / into a window. There are a lot of open source examples of making an analog clock already on the internet. Just Google for your language of choice with analog clock in the search such as: analog clock C++
LCF-AT Posted October 9, 2016 Author Posted October 9, 2016 Hi, cant find something in ASM to download what I could check. greetz
atom0s Posted October 10, 2016 Posted October 10, 2016 There are a lot of examples in C/C++ that you could look into and port to the ASM flavor of your choice. 1
akkaldama Posted October 10, 2016 Posted October 10, 2016 @LCF-AT, what about http://www.codeproject.com/Tips/1039519/Clock-Frame-Design-Using-Assembly http://www.pcorner.com/list/ASSEMBLY/CLOK3.ZIP/INFO/ and https://nabeelsplace.wordpress.com/2014/02/24/assembly-clock/ BTW, i haven't checked. Regards, akkaldama 2
LCF-AT Posted October 10, 2016 Author Posted October 10, 2016 Hi, thanks for the links but this isnt that what I am looking for.Dont wanna make any Dos style clock etc.I would like to create almost same clock like this of Win 7 (see picture).So the clock background should be any good looking picture but I dont know how to make the time pointers and showing them. greetz
Loki Posted October 10, 2016 Posted October 10, 2016 Personally I would do it either with GDI or OpenGL, depending on the use case. Create a back ground then render the hands and lines on top - algorithm should be fairly simple (6 degrees movement per minute for the big hand and 30 degrees per hour for the hour hand) 1
akkaldama Posted June 5, 2017 Posted June 5, 2017 Hi @LCF-AT any progress on this? may be u already have this https://beginners.re/RE4B-EN.pdf(hacking windows clock, page no:826). Regards, Br. akkaldama 1
LCF-AT Posted June 5, 2017 Author Posted June 5, 2017 Hi akkaldama, no progress yet to build any GDI lines.So somehow I should use this.. https://msdn.microsoft.com/de-de/library/windows/desktop/ms536026.aspx ...anyhow.Loading any clock image as same in TIMEDATE.CPL plus creating and draw the lines on it.Maybe its simple to do but maybe I do thing again in a wrong direction. greetz
Kurapica Posted June 6, 2017 Posted June 6, 2017 @LCF-AT I once did this using C# and I don't think assembly is the language suitable for this task. 1
Teddy Rogers Posted June 6, 2017 Posted June 6, 2017 If you aren't too worried about scaling you could create a background clock image then three separate images for the second, minute and hour hands. You then only need to plot the angles for the time and paint them on to the background image in memory before displaying to screen. Possibly even add a little dithering to smooth out jagged edges. 21 hours ago, LCF-AT said: no progress yet to build any GDI lines.So somehow I should use this.. Maybe using the Polyline function? Procedure.i DrawClockHands(second_x, second_y, minute_x, minute_y, hour_x, hour_y, hdc) Structure POSITION second.POINT minute.POINT hour.POINT EndStructure Protected pointer.POSITION pointer\second\x = second_x pointer\second\y = second_y pointer\minute\x = minute_x pointer\minute\y = minute_y pointer\hour\x = hour_x pointer\hour\y = hour_y Polyline_(hdc, @pointer, 3) EndProcedure Ted. 1
LCF-AT Posted June 6, 2017 Author Posted June 6, 2017 Hi Ted, so do you mean I have to create images for the clock hands too and then turning them to show them correctly? So my main goal was it just to reproduce the Win 7 clock anyhow also with same hands.So the clock picture I can copy / use and just need to draw / show the hands on it etc.Also then I think I need to calc anyhow a lot to show all hands correctly for time x.No idea,so as I said I think I still do think wrong anyhow. PS: Yes maybe other languages are much better and more simple to use but I cant switch now so there I would start almost from zero again. greetz
Downpour Posted June 7, 2017 Posted June 7, 2017 Have you seen this? https://inventwithpython.com/blog/2012/07/18/using-trigonometry-to-animate-bounces-draw-clocks-and-point-cannons-at-a-target/ You could translate the clock example to MASM and drawing a line from the center of the clock to the outer circle.
h4sh3m Posted June 7, 2017 Posted June 7, 2017 (edited) Hi You're trying to do something like this : https://www.codeproject.com/tips/1039519/clock-frame-design-using-assembly ?! It's just static sample and you should redraw frame every second !!! BR, h4sh3m Edited June 7, 2017 by h4sh3m
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now