Private Sub Form1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Click
Dim myBitmap As New Bitmap("lake.jpg")
' Draw myBitmap to the screen.
e.Graphics.DrawImage(myBitmap, 0, 0, myBitmap.Width, _
myBitmap.Height)
' Set each pixel in myBitmap to black.
Dim Xcount As Integer
For Xcount = 0 To myBitmap.Width - 1
Dim Ycount As Integer
For Ycount = 0 To myBitmap.Height - 1
myBitmap.SetPixel(Xcount, Ycount, Color.Black)
Next Ycount
Next Xcount
' Draw myBitmap to the screen again.
e.Graphics.DrawImage(myBitmap, myBitmap.Width, 0, myBitmap.Width, _
myBitmap.Height)
End Sub
Hi, e is empty... how to initialize the e object?
Thanks
Jack 5 1016
Jacky,
Something as this
\\\
Dim bm As New Bitmap(120, 20)
Dim g As Graphics = Graphics.FromImage(bm)
////
I hope this helps
Cor
g is same as e... hmmm ok thanks :)
Jack
"Cor Ligthert" <no************@planet.nl> ¼¶¼g©ó¶l¥ó·s»D
:##**************@tk2msftngp13.phx.gbl... Jacky,
Something as this \\\ Dim bm As New Bitmap(120, 20) Dim g As Graphics = Graphics.FromImage(bm) ////
I hope this helps
Cor
but the e is an argument :)
Jacky
"Cor Ligthert" <no************@planet.nl> ¼¶¼g©ó¶l¥ó·s»D
:##**************@tk2msftngp13.phx.gbl... Jacky,
Something as this \\\ Dim bm As New Bitmap(120, 20) Dim g As Graphics = Graphics.FromImage(bm) ////
I hope this helps
Cor
Jacky,
You cannot use e because it is already used in the parameters.
You can change that e for g in your parameters and than it would work in
your procedure with e.
However, because the fact that for everybody (not by rule however it is done
very conequently )the e is the eventargument, is that very confusing (even
for you after a while) and will I very much advice you not to do that.
I hope this gives the idea why?
Cor
"Jacky Luk" <jl@knight.com> schrieb: Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Click Dim myBitmap As New Bitmap("lake.jpg") ' Draw myBitmap to the screen. e.Graphics.DrawImage(myBitmap, 0, 0, myBitmap.Width, _ myBitmap.Height) [...] Hi, e is empty... how to initialize the e object?
Add the code to the form's 'Paint' event handler or to an overridden
'OnPaint' method instead of adding it to a 'Click' event handler.
--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Erik Lechak |
last post by:
Hello All,
I am creating a visual programming environment for python (similar to
Matlab's simulink, but for python). For several reasons I have
decided not to go with OGL. I am writing a wxOGL...
|
by: Rolf Wester |
last post by:
Hi,
I have a Python console application that is intended to be used
interactively and I have to add plotting capabilities (multiple XY plots
and if possible 2D-surface plots). I'm loocking for a...
|
by: John |
last post by:
How can I draw single 1x1 pixel "dot" in window? Not a
line, I really mean "dot".
|
by: Jacky Luk |
last post by:
Hi,
I used to stick with VB6 and now changing to vb.net What about pixel
plotting? there is no function like pset. So how to do simple pixels on
screen?
Thanks a lot
Jack
|
by: Chaos |
last post by:
As my first attempt to loop through every pixel of an image, I used
for thisY in range(0, thisHeight):
for thisX in range(0, thisWidth):
#Actions here for Pixel thisX, thisY
But it takes...
|
by: T. Crane |
last post by:
Hi,
I am looking for a good plotting library. I intend to do 3D surface
plots, 2D contour, 3D waterfall, etc. Right now I have access to
National Instruments' Measurement Studio, and it's...
|
by: ofiras |
last post by:
In bitmap, how can I find the nearest pixel (pixel
1) to a specific pixel (pixel 2) that has different color from pixel
2? Or how can I find a pixel in a specific distance from pixel 2 (like
a...
|
by: Helmut Michels |
last post by:
Dear C/C++ programmers,
I am pleased to announce version 9.4 of the data plotting software
DISLIN.
DISLIN is a high-level and easy to use plotting library for
displaying data as curves, bar...
|
by: archonmagnus |
last post by:
Hello all,
I've been experimenting with developing an orbital analysis program. Being a visually oriented person, I'd like to translate my (x, y) coordinate pairs to an pixel image array so I can...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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: 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...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |