How can I draw any thing within "for" loop? I tried the
below but it doesn't draw anything. What should I do?
****
Code
****
Graphics g = this.CreateGraphics();
Bitmap bm=new Bitmap(1,1);
bm.SetPixel(0,0,Color.Black);
for (i=1;i==2;i++)
{
g.DrawImageUnscaled(bm,500,500);
} 3 1461
What is it that you're trying to achieve here? Maybe your form is smaller
than 500x500?
vJ
"John" <an*******@discussions.microsoft.com> wrote in message
news:88****************************@phx.gbl... How can I draw any thing within "for" loop? I tried the below but it doesn't draw anything. What should I do?
**** Code ****
Graphics g = this.CreateGraphics(); Bitmap bm=new Bitmap(1,1); bm.SetPixel(0,0,Color.Black); for (i=1;i==2;i++) { g.DrawImageUnscaled(bm,500,500); }
John <an*******@discussions.microsoft.com> wrote: How can I draw any thing within "for" loop? I tried the below but it doesn't draw anything. What should I do?
**** Code ****
Graphics g = this.CreateGraphics(); Bitmap bm=new Bitmap(1,1); bm.SetPixel(0,0,Color.Black); for (i=1;i==2;i++) { g.DrawImageUnscaled(bm,500,500); }
This has nothing to do with drawing - your for loop is misconstructed.
It sets i to 1, then only continues while i is 2. As it clearly isn't 2
to start with, the body never gets executed.
--
Jon Skeet - <sk***@pobox.com> http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
John <an*******@discussions.microsoft.com> wrote in message
news:88****************************@phx.gbl... How can I draw any thing within "for" loop? I tried the below but it doesn't draw anything. What should I do?
**** Code ****
Graphics g = this.CreateGraphics(); Bitmap bm=new Bitmap(1,1); bm.SetPixel(0,0,Color.Black); for (i=1;i==2;i++) { g.DrawImageUnscaled(bm,500,500); }
g.DrawImageUnscaled(bm,500,500) never gets executed. I assume you were
trying to draw a pixel... This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Invalid User |
last post by:
While trying to print a none empty list, I accidentaly put an "else"
statement with a "for" instead of "if". Here is what I had:
if ( len(mylist)> 0) :
for x,y in mylist:
print x,y
else:...
|
by: lancevictor |
last post by:
I'm learning javascript, and toward that end, I am recreating a page
"my way". The original page: http://stenbergcollege.com and the one
that I'm creating:...
|
by: Neil Zanella |
last post by:
Hello,
I have a bunch of HTML input controls which I need to generate from
within a for loop. I would like them to have id attributes set to
values foo1, foo2, foo3, foo4, etc...
...
|
by: Frederick Gotham |
last post by:
Is the domestic usage of the C "for" loop inefficient when it comes to
simple incrementation? Here's a very simple program that prints out the
bit-numbers in a byte.
#include <stdio.h>
#include...
|
by: cvalarmathi |
last post by:
Hi ! How to write foreach loop within for loop in php.Plz anybody know the answer reply me.Is it possible? Thanks.
|
by: takayuki |
last post by:
Hi everyone,
I'm studying python via the excellent "how to think like a python
programmer" book by Allen Downey. Noob question follows...
I have a txt file (animals.txt) which contains the...
|
by: takayuki |
last post by:
Hi,
I'm studying python via the exellent book "How to think like a python
programmer" by Allen Downey.
Noob question follows...
animals.txt is a list of animals, each on a separate line:...
|
by: Steve |
last post by:
I am having problems getting values out of an array. The array is set
as a global array and values are pushed into it as they are read from
a JSON file using a "for loop". When the "for loop" is...
|
by: vanithapraveen |
last post by:
I gave update command inside for loop.. and the query values are perfectly correct..but when i give con.execute(updateqry) i end up with an error....
Please help me...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
| |