16,020,840 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by kastriotlimani (Top 7 by date)
kastriotlimani
6-May-13 14:39pm
View
Deleted
Pen lapsi = new Pen(Color.Black, 3);
Rectangle katrori = new Rectangle(250, 200, 200, 200);
Rectangle katrori2 = new Rectangle(350, 200, 200, 200);
Rectangle katrori3 = new Rectangle(150, 200, 200, 200);
Rectangle katrori4 = new Rectangle(200, 110, 200, 200);
Rectangle katrori5 = new Rectangle(200, 285, 200, 200);
Rectangle katrori6 = new Rectangle(295, 110, 200, 200);
Rectangle katrori7 = new Rectangle(300, 282, 200, 200);
Graphics g = this.CreateGraphics();
g.DrawEllipse(lapsi, katrori); //kryesor
g.DrawEllipse(lapsi, katrori2); //djatht
g.DrawEllipse(lapsi, katrori3); //majt
g.DrawEllipse(lapsi, katrori4); //nalt-majt
g.DrawEllipse(lapsi, katrori5); //posht-majt
g.DrawEllipse(lapsi, katrori6); //nalt-djatht
g.DrawEllipse(lapsi, katrori7);//posht djatht
I have drawn 7 circles so far, but i only want to show the one in the middle containing rossete. How to get rid of those extra lines outside the main circle..
kastriotlimani
6-May-13 14:14pm
View
Deleted
Pen lapsi = new Pen(Color.Black, 3);
SolidBrush brusha = new SolidBrush(Color.Red);
SolidBrush brusha1 = new SolidBrush(Color.Orange);
SolidBrush brusha2 = new SolidBrush(Color.Blue);
SolidBrush brusha3 = new SolidBrush(Color.Gray);
SolidBrush brusha4 = new SolidBrush(Color.Green);
SolidBrush brusha5 = new SolidBrush(Color.Purple);
SolidBrush brusha6 = new SolidBrush(Color.DarkSeaGreen);
Rectangle katrori = new Rectangle(250, 200, 200, 200);
Rectangle katrori2 = new Rectangle(350, 200, 200, 200);
Rectangle katrori3 = new Rectangle(150, 200, 200, 200);
Rectangle katrori4 = new Rectangle(200, 110, 200, 200);
Rectangle katrori5 = new Rectangle(200, 285, 200, 200);
Rectangle katrori6 = new Rectangle(295, 110, 200, 200);
Rectangle katrori7 = new Rectangle(300, 282, 200, 200);
Graphics g = this.CreateGraphics();
g.DrawEllipse(lapsi, katrori); //kryesor
g.DrawEllipse(lapsi, katrori2); //djatht
g.DrawEllipse(lapsi, katrori3); //majt
g.DrawEllipse(lapsi, katrori4); //nalt-majt
g.DrawEllipse(lapsi, katrori5); //posht-majt
g.DrawEllipse(lapsi, katrori6); //nalt-djatht
g.DrawEllipse(lapsi, katrori7);//posht djatht
I have drawn 7 circles so far, but i only want to show the one in the middle containing rossete. How to get rid of those extra lines outside the main circle..
kastriotlimani
8-Apr-13 10:59am
View
Well, I realized that I need to know the coordinates of regular hexagon shape, then to join those points with same tension using Graphics.DrawCurve. But the problem is how to draw a regular hexagon first ...
kastriotlimani
28-Mar-13 11:36am
View
Thank You, it worked finally :)
Have a nice day !
kastriotlimani
28-Mar-13 10:51am
View
Deleted
I have a character (bitmap image) controlled with wasd keys, and collecting dots with that.
I want those dots to be (ex: coins).
here it is all the coding i made:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Media;
namespace LojaMePika
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Bitmap creature;
Bitmap background;
Graphics g;
Graphics scG;
Rectangle area;
Rectangle[] rects;
Timer t;
bool right;
bool left;
bool up;
bool down;
int collectedNumber = 0;
private void Form1_Load(object sender, EventArgs e)
{
creature = new Bitmap(@"C:\Users\kasske\Desktop\LojaTomi.png");
creature.MakeTransparent(Color.White);
background = new Bitmap(this.Width, this.Height);
area = new Rectangle(50, 50, 100, 100);
rects = new Rectangle[10];
makerect();
g = this.CreateGraphics();
scG = Graphics.FromImage(background);
t = new Timer();
t.Interval = 10;
t.Tick += new EventHandler(t_Tick);
t.Start();
}
void t_Tick(object sender, EventArgs e)
{
if (up) { area.Y -= 5; }
if (left) { area.X -= 5; }
if (down) { area.Y += 5; }
if (right) { area.X += 5; }
g.DrawImage(Draw(), new Point(0, 0));
for (int i = 0; i < rects.Length; i++)
{
if (area.IntersectsWith(rects[i]))
{
collectedNumber++;
rects[i] = new Rectangle(-100, -100, 1, 1);
SoundPlayer zeri = new SoundPlayer(@"C:\Users\kasske\Desktop\bell-ringing-05.wav");
zeri.Play();
if (collectedNumber == 10)
{
MessageBox.Show("Keni mbledhur te gjitha pikat");
this.Close();
}
}
}
}
public Rectangle[] makerect()
{
Random r = new Random();
for (int i = 0; i < rects.Length; i++)
{
rects[i] = new Rectangle(r.Next(0,this.Width),r.Next(0,this.Height),10,10);
}
return rects;
}
public Bitmap Draw()
{
scG.Clear(Color.FromArgb(255, Color.DarkBlue));
scG.FillRectangles(Brushes.Gold, rects);
scG.DrawImage(creature, area);
scG.DrawString(collectedNumber.ToString(), new Font("Arial", 15), Brushes.Gold, new PointF(10,10));
return background;
}
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.W) { up = true; }
if (e.KeyCode == Keys.A) { left = true; }
if (e.KeyCode == Keys.S) { down = true; }
if (e.KeyCode == Keys.D) { right = true; }
}
private void Form1_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.W) { up = false; }
if (e.KeyCode == Keys.A) { left = false; }
if (e.KeyCode == Keys.S) { down = false; }
if (e.KeyCode == Keys.D) { right = false; }
}
}
}
kastriotlimani
28-Mar-13 10:33am
View
i still cant make it work... can u show me the lines of code please
kastriotlimani
12-May-11 14:12pm
View
i am looking to create a database .. and i have some textboxes to execute queries and i also have one button search. All i want is to press enter instead of pressing that search button but i dont know how ... sory for my weak english
Show More