Click here to Skip to main content
15,885,896 members
Everything / 2d

2d

2D

Great Reads

by Espen Harlinn
Harlinn.Windows is a collection of libraries that I have put together that serves as a big part of the runtime we use at work.
by Miguel Diaz Kusztrich
An infinite set of biological shape fractals in the complex plain
by Petrov Vladimir
Weiler-Atherton algorithm in MFC codes demo implementation
by The Zakies
we would create Hand_tool to pan through the drawing form, and we would use a custom cursor of open and closed hands

Latest Articles

by Perić Željko
Sorting Multi-Dimensional Arrays in C# with QuickSort Sort Extensions
by Espen Harlinn
Harlinn.Windows is a collection of libraries that I have put together that serves as a big part of the runtime we use at work.
by sebjameswml
Walks you through the steps needed to draw high quality 2D graphs in your C++ programs using the header-only library morphologica
by André Marcos (Advisor), José Cláudio Silva, Victor Lopes
Unity Engine support for Electronic 2D game development

All Articles

Sort by Score

2d 

15 Jan 2024 by Espen Harlinn
Harlinn.Windows is a collection of libraries that I have put together that serves as a big part of the runtime we use at work.
27 Nov 2017 by Miguel Diaz Kusztrich
An infinite set of biological shape fractals in the complex plain
25 Feb 2018 by Petrov Vladimir
Weiler-Atherton algorithm in MFC codes demo implementation
29 Jun 2016 by The Zakies
we would create Hand_tool to pan through the drawing form, and we would use a custom cursor of open and closed hands
2 Mar 2021 by Tomaž Štih
Sometimes you need to draw a simple glyph.
3 Jun 2021 by honey the codewitch
Explore techniques for drawing using GFX
29 Jul 2017 by Debashis 10433656
How to create an ASP.NET control for image resizer and cropper keeping aspect ratio
4 May 2021 by honey the codewitch
Use an ILI9341 display efficiently from an ESP32 without the Arduino framework. Load JPEGs.
24 May 2020 by User 5250478
Application to show how to zigzag order a matrix
2 Nov 2015 by Farhad Reza
We will design two interesting characters in this tip. The first one is Code Project Bob sticker and the second one is Magpie bird which is the national bird of Bangladesh.
14 Mar 2023 by sebjameswml
Walks you through the steps needed to draw high quality 2D graphs in your C++ programs using the header-only library morphologica
24 Nov 2015 by Asad Bukhari
Step by Step guide for getting started with MicroStation Application Development
1 May 2016 by Majdi Sobain
2D games programming simplicity using RingAllegro Library
1 Jul 2016 by Tomaž Štih
Size the child rectangle so that it fits into given parent rectangle, without distorting it
29 Jan 2018 by Arav Singhal
Representing shapes, worlds, and integrating forces and velocities in a 2D physics engine
18 Jun 2021 by honey the codewitch
Use GFX effectively with e-paper/e-ink displays
12 Mar 2024 by Perić Željko
Sorting Multi-Dimensional Arrays in C# with QuickSort Sort Extensions
4 Nov 2015 by bling
Your paint handler looks strange to me. private void Form1_Paint(object sender, PaintEventArgs e) { gDisplay.DrawImage(bitmap, new Point(0, 0)); }Try this:private void Form1_Paint(object sender, PaintEventArgs e){ ...
10 Jul 2017 by Voevudko A. E., Ph.D.
Demonstrating ability of the L-system in R, and offering helper functions able to plot all main categories of figures typical for the 2D L-system.
18 Jul 2017 by Ralf Meier
An example for this could be : using System; using System.Collections; using System.Collections.Generic; using System.Data; using System.Diagnostics; public class myPanel : Panel { public List ClickPoints { get { return myClickPoints; } set { myClickPoints = value; } } private...
12 Nov 2018 by Arav Singhal
Calculating the mass and inertia of a body and applying forces to it
15 Apr 2018 by Patrice T
Quote: but using function 'myellipse' makes the animation very slow You want to improve speed, that process is named 'optimization', the tool that help you to spot bottle necks is the profiler. Profiling (computer programming) - Wikipedia[^] Optimization is about being critical about your...
17 Apr 2021 by honey the codewitch
GFX IoT graphics library part 2 - device independent bitmaps
25 Apr 2021 by honey the codewitch
Explore the basic drawing functionality provided by the GFX IoT library
6 May 2021 by honey the codewitch
Explore the inner workings of a highly capable IoT display driver for the ESP32
17 Nov 2022 by André Marcos (Advisor), José Cláudio Silva, Victor Lopes
This work proposes the development of a Raycast engine in JavaScript to facilitate the 3D game development.
17 Nov 2022 by André Marcos (Advisor), José Cláudio Silva, Victor Lopes
Unity Engine support for Electronic 2D game development
17 Apr 2015 by Wendell D H
I looked for ways to do it with Array.ConvertAll, but was having trouble.But this should work.This assumes you don't know the sizes of the array dimentions//Your original objectobject saMatrix = new object[3, 3] {{ 11.0, 12.0, 13.0 }, { 21.0,...
22 Dec 2015 by Dave Kreskowiak
You don't. You have to use two indexes. In C, you can get away with it, but VB is a lot more strict.The solution if you want to use one index is to make it a one dimensional array. You'll have to do some additional mathematical coding to access the array using two indexes and generate a...
22 Jan 2020 by F-ES Sitecore
Ensure your account has access to the D;\ drive. If you are creating a project directly in the root of the D drive, or have anything that creates files in the root of the D drive then make sure it doesn't, always work in sub-folders and sometimes access to the root can be blocked. If you don't...
22 Jan 2020 by phil.o
Trying to write anything at the root of a drive will be problematic on any recent Windows version; better create a directory on the D: drive and write your files in it instead.
9 Jun 2020 by Richard MacCutchan
print(accounts.read()) # this reads all the lines from your file, but you don't save the result print(Username, "1") for row in accounts: # there is nothing to read now, since it has all been read above Remove the line print(accounts.read())...
29 Dec 2020 by IgorRadionyuk
An iterator over parametric function, which is a well known mathematical abstraction: Parametric Function. It maps interval of real numbers[start, stop] to some values in the range of function.
5 Apr 2021 by Dave Kreskowiak
Write it out on paper, with row and column 1 in the top left corner. Write your values out for each row and each column. It should become obvious what the formula for calculating each value at each row and column should be. 10 rows and 10...
11 Apr 2021 by honey the codewitch
A device independent graphics library for IoT devices. Part 1 of a series.
25 Apr 2021 by Richard MacCutchan
Quote: nothing because i know nothing. Then I am afraid you will need to start learning. See C Tutorial - Tutorialspoint[^].
25 Apr 2021 by Patrice T
Quote: I did not take an introductory course or anything like that so please help. If your claim is true, the only answer is a fail, any other answer is a cheat. More or less, you are requested to win a formula 1 GP before learning to drive a...
25 Apr 2021 by OriginalGriff
That's not a "first program" in C at all - it's miles from the traditional "Hello World!" app we all started with. And while we are more than willing to help those that are stuck: that doesn't mean that we are here to do it all for you! We...
28 May 2021 by k5054
The simple thing to do is to add a width specifier to your format string e.g scanf("%32s\n", name[i] However, if you enter a name with spaces in it e.g. "James Earl Jones", then using the %s format, scanf will read this as 3 separate words, not...
3 Jul 2016 by The Zakies
we will continue the functionality of the hand tool with having a navigator panel which works as a map, we will also have a red rectangle which tells the user where he is actually viewing inside the whole form, also it can be moved to pan the form
10 May 2015 by Peter Leow
You need the right tool to do the jobs right. It is time to start learning new tools. Check this out http://blog.lessmilk.com/unity-spaceshooter-1/[^] and see if that suits you, then go further to http://unity3d.com/learn/tutorials/modules/beginner/2d[^]
5 Oct 2015 by Stefan_Lang
You might want to check out text user interface libraries such as curses[^]. They allow much more control than system("cls").P.S.: Even though mainly used in UNIX like systems, there are Windows implementations. We still have a curses-based app here that runs on modern Windows systems.
5 Oct 2015 by Patrice T
For information: DOS permit GUI.What you are doing is a console application, or said otherwise char mode application.By using a library like in Solution 2, you will be able to control the position of cursor and color of what goes on screen.What you have been doing until now is called...
4 Nov 2015 by ryanba29
I have a large number of dynamically created rectangles to display on screen. Through trial and error I now draw only the rectangles that have changed to a bitmap and the bitmap in a OnPaint event, but i still get flickering. Any suggestions on where I might be going wrong.I'm using VS 2015...
17 Dec 2015 by Member 11380736
c#Is it possible to convert a ArrayList to a 2D int[1,13] array ?The ArrayList is all numbers like "1111100000000", "0111110000000".And I want them to look like this:int[,] a = { { 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 }, { 0, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0 }, { 0, 0, 1, 1, 1,...
17 Dec 2015 by BillWoodruff
You could use Linq to create an int[],[] Array:// requiredusing System.Linq;int[],[] jaggedArray = aList.ToArray().Select(elem => elem.ToString().Select(ch => (int)Char.GetNumericValue(ch)).ToArray()).ToArray()// orint[],[] jaggedArray = aList.ToArray().Select(elem =>...
22 Dec 2015 by Member 11153736
Hello.An error occurs in the place to initialize the array.How Can I Use that array ?It must be a two-dimensional array of character...Thank you. _ Public Structure ST_TEST ...
22 Dec 2015 by Tomas Takac
You never initialize the array, that's why redim will throw and exception. And i guess you don't need the jagged array. try this:Public Structure ST_TEST Public _2D_CHAR_ARR(,) As Char '2D arrayEnd StructureDim stTest As ST_TESTstTest._2D_CHAR_ARR = New Char(60, 60) {} ' here...
3 Apr 2016 by leon de boer
There is nothing wrong with the code are you sure that is the exact code you have?If this is in monodevelop then I suggest you restart unity because that code is fine.The only possibility I can think of is your script file isn't called TyroneController.cs . I remember unity is very...
15 Jun 2016 by deXo-fan
Hi,My friend is sitting next to me playing a game called Terraria, and while it is 2D the graphics are quite advanced.So my question is this: If I wanted to make a similar game, 2D with complicated graphics that involve shadows and light sources and translucency and so forth, would GDI...
15 Jun 2016 by roks nicolas
well gdi will be slower than opengl, because it s only software rendering.In my opinion... you should use SDL if you want to make your own 2d engine... but you can find actualy 2d engine already made and "just" code the game..... making a 2d engine is already a pretty dawn task...
20 Sep 2016 by Patrice T
We do not do your HomeWork.HomeWork is not set to test your skills at begging other people to do your work, it is set to help your teacher to check your understanding of the courses you have taken and also the problems you have at applying them. Any failure of you will help your teacher spot...
21 Feb 2017 by Cuber01
I am working on a 2D Platformer and I am tring to add mobile controlsI am trying to make it so when you touch on the joystick the player will start shooting.What I have tried:I tried to change all of the input.getAxsis with CrossPlatformInputManger.getAxsis but all it did was make me...
4 Jun 2017 by Member 10610621
Guys below is my Code for My PlaycontrollerScript and PlatformMover script what i am trying to achieve here is i want when my player jump on the platform that particular group of platform to go down ,basically like doodle jump ,but as i am doing something wrong here platform groups are spawning...
18 Jul 2017 by Santhosh1217
I drawn a path(using coordinates of selecting area) in the panel.In this I want to display the values while hovering on the panel path.How will I do this? Please Help Me ! What I have tried: points1.Add(new Point(Convert.ToInt16(x), Convert.ToInt16(y))); Pen p = new Pen(Color.Blue, 2);...
25 Jul 2017 by Dave Kreskowiak
No, this site is not a code-for-hire service. You're looking for Freelancer.com. Get out your credit card.
25 Jul 2017 by Richard MacCutchan
See The Java Tutorials[^]
25 Jul 2017 by CPallini
What's wrong with Google? Have a look, for instance, at this page: Java 2D games tutorial - programming Java games[^].
14 Dec 2017 by Member 13576973
String[][] table = new String[][] { {"Spade","Diamond","Heart","Club"}, {"Ace", "2","3","4","5","6","7","8","9","Jack","Queen","King",} }; String LuckyCard; for (int r = 0; r
14 Dec 2017 by Patrice T
Learn to indent properly your code, it show its structure and it helps reading and understanding. It also helps spoting structures mistakes. String[][] table = new String[][] { {"Spade","Diamond","Heart","Club"}, {"Ace", "2","3","4","5","6","7","8","9","Jack","Queen","King",} }; String...
10 Jan 2018 by Member 11278731
i have to ZOOM-IN & ZOOM-OUT 2D-graphics like (line, Rectangle, circle) which i have draw on winform. I am not used any picture box, panel. I crated simple program to draw circle & on button click try to zoom but it showing error "parameter is not valid" in method Drawing() @ Line-...
15 Apr 2018 by Member 13151067
Iam trying to draw an ellipse that don't move in my project and i use animation in this project but using function 'myellipse' makes the animation very slow this is the code to draw ellipse What I have tried: This is the code to draw an ellipse void myEllipse(int x,int y,float StAngle,float...
2 May 2018 by john ztech
//initialization int validtracks[17][2] = {{1,1}, {1,3}, {1,6},{2,3},{2,6},{3,4},{3,6},{3,8}, {4,2},{4,3},{4,7},{5,3},{5,5},{6,1}, {6,3},{7,1},{7,3}}; //main code while (matchtrack == 0) { rndint = rand() % 7 + 1; for (int r = 1; r
2 May 2018 by Patrice T
Quote: Why is the conditional (highlighted in the code below) detecting a match for values that are NOT defined in the initialized 2d array ....? Because in C/C++, 'NOT defined' does not exist. Because C/C++ is unchecked, you are responsible of ensuring that you always access valid positions in...
22 Aug 2018 by Member 13958396
This is my first time doing matlab and I've never coded before. This was a compulsory Uni paper that I have had to take. Prior to this task I've managed to complete various other tasks but this is challenging me beyond what I've learned in the last three weeks. This is what ive got down so far...
22 Aug 2018 by Patrice T
Quote: SOMEONE PLEASE HELP ME SOLVE THIS?!?!?!?! The help you want is us doing your homeWork. You show no attempt to solve the problem yourself, you have no question, you just want us to do your HomeWork. HomeWork problems are simplified versions of the kind of problems you will have to solve...
22 Aug 2018 by Patrice T
So, you show no attempt to solve the problem yourself, you have no question, you just want us to do your HomeWork. HomeWork problems are simplified versions of the kind of problems you will have to solve in real life, their purpose is learning and practicing. We do not do your HomeWork....
22 Aug 2018 by Vincent Maverick Durano
READ: Programming Problems and Finding Solutions[^] PS: Adding those exclamation marks on the subject line suggests you are late with your homework, it's rude and no one is interested in that. If you want us to help you, then start doing something by yourself. Show us what you've tried and...
23 Sep 2019 by Terence Wallace
A continuing series demonstration of Finite State Machines (FSM) where agents inhabit a small town called WestWorld.
22 Jan 2020 by OriginalGriff
We can't help you. We don't have access to your code, or your data, or your system: so we have no idea what kind of access you are trying to get to the root of drive D:, or even that D: exists on your computer. Probably it does exist: the error message is telling you that your application (or...
30 Jan 2020 by Richard MacCutchan
java.lang.RuntimeException: Duplicate class com.unity3d.ads.BuildConfig found in modules classes.jar (:UnityAds:) and classes.jar (:unity-ads:) Duplicate class com.unity3d.ads.IUnityAdsListener found in modules classes.jar (:UnityAds:) and classes.jar (:unity-ads:) Duplicate class...
21 Feb 2020 by Richard MacCutchan
Then you need to do some more research. In the meantime I suggest you also take a look at Code Project Quick Answers FAQ[^] to see how to post a question.
17 May 2020 by Christian Graus
A 3D scene has more data so you can't take a 2D scene and automatically make it 3D. You could GUESS the depth of objects but you can't be sure. You can GUESS their thickness in different points, but you can't be sure.
9 Jun 2020 by DarkJoker666
I am doing a project for a university course to create a banking app using python. This requires a login and the data to be stored in a CSV. The issue I have is to iterate through the 2D array that has data from the csv. Through my debugging the...
25 Nov 2020 by Richard MacCutchan
Sorry, this site is not here to do your homework. If you really cannot do this the you need to discuss your problem with your teacher.
4 Jan 2021 by Richard MacCutchan
Most likely you are just copying references from the temp array into the main one, so as soon as you clear the temp array, the row in the main array gets cleared. You need to do deep copying of the actual data from the temp array into the main...
10 Apr 2021 by Richard MacCutchan
Trail: 2D Graphics (The Java™ Tutorials)[^]
30 May 2021 by Rahul Dicholkar
the code is written to sort names using dynamic allocation.i need to set limit for numbers of charaters entered by the columns and need to set limit to 32.the code is working but i dont know how to set limit for columns. columns need to set...
30 May 2021 by Rahul Dicholkar
sir the above code throws an error: error: too many arguments to function ‘getchar’ 50 | getchar(c); | ^~~~~~~ In file included from class.c:1: /usr/include/stdio.h:492:12: note: declared here 492 | extern int getchar (void); also...
9 Sep 2021 by Nils Leonhardt
Hello, I'm trying to create a short 2D game where you can wait x amount of time to get for example 50 "troops". This for now works fine, but now I need a script that detects the number of troops I have (at the startpoint) and send them out, just...
15 Nov 2022 by Richard MacCutchan
It is impossible to tell you which package is better, as that depends on too many unknowns. You need to try them for yourself to see which one best fits your requirements.
14 Dec 2017 by User 7407470
In this case you should not use a 2d array, but just two arrays: String[] suits = {"Spades","Diamonds","Hearts","Clubs"}; String[] cards = {"Ace", "2","3","4","5","6","7","8","9","Jack","Queen","King"}; int cardLucky = (int)(Math.random() * 13); int suitLucky = (int)(Math.random() * 4); ...
17 May 2020 by User 14475602
I have made a puzzle in 2d scene and now I want to put it in complete 3d scene. Is that even possible? How can I do that? In 3d scene, I want to put it where is visible and the player can access it with key on keyboard or somehow like that. Put...
14 Apr 2021 by Angelo Cresta
An extension of "A control to display pie charts with highly customizable formatting" from mattsj1984 that also renders doughnut.
20 Jun 2016 by The Zakies
Learn how to implement a tecnique of a parent form that createes and controls other forms , through the tecnique of using the tab control, also learn how to implement a menu for the tools, and how to add cutom cursor for each tool
3 Oct 2017 by BouncyTarget
This is an article about making 2D sprites in Windows Forms.
9 Jan 2017 by Jack Xu, USA
This article demonstrates how to convert the WinForm version of the Microsoft chart control into a WPF and MVVM compatible chart control and how to use it to create various charts in a WPF application.
6 Jul 2020 by Marijan Nikic
An animated random string selection wheel class written in Java AWT
10 Nov 2016 by Miguel Diaz Kusztrich
An application to draw Recurrence Plots and calculate recurrence quantification measures
17 Sep 2016 by Rajesh Londhe
Face alignment rotation to improve face recognization
7 Feb 2021 by g96b10
Win2D provides a neat API interface, but how do you render complex sprites for your game? I provide a library and editor to make this a streamlined process.
22 Oct 2022 by Jean-Claude Lanz
2D Drawing component with Scaling, Zooming, Scrolling, Centering and Resizing capabilities
7 Jun 2016 by The Zakies
[tut4] how to draw lines & to draw different types on end shapes like rectangle and circle using C#
20 Jun 2016 by The Zakies
we will build an outline line around the drawn lines so we would test the mouse click on this outline to know which line is selected. and we would in the coming update build a select function inside the move tool
24 Jun 2016 by The Zakies
in this tut we will create a technique to enable the user to control points within a drawn line, by drawing circles around points of the line , when the user clicks a circle he would control the corresponding point.
18 Jul 2018 by Michael Moroz
This articles describes how to open SVG files in C++ application, work with Bezier curves and export to PDF.
29 Jan 2018 by Arav Singhal
The basics of spaces, transformations and bodies used in a 2D physics engine.
23 Aug 2016 by HitsRathod, Sneha Palve
Easily export chart.js charts in image formats
25 Aug 2016 by Mr. xieguigang 谢桂纲
Manhattan plot in VisualBasic, application of the cross platform VisualBasic in the data science
5 Jan 2017 by Andre van Dun
Graphviz graphs from dot specification