Hi all,
My first post to MSDN... I've recently started to get into VB.NET, having
been a casual VB user for a few years. So far, it's going OK. I've managed
to figure out
how to draw lines on a PictureBox, using code like this:
g = PictureBox1.CreateGraphics()
p = New Pen(char_color, pen_width)
p.LineJoin = Drawing2D.LineJoin.Round
g.DrawLine(p, path.s.X, path.s.Y, path.e.X, path.e.Y)
and that's just peachy. What I'd like to do now is erase the lines and have
the
PictureBox revert back to the jpeg it started with.
At first it seemed like
g.Clear()
was going to do it, but I don't want to fill the box with a color- I want it
to show the
original picture.
Any hints would be greatly appreciated. Thank you.
Pat Ferrick 1 1613
You'll have to reload the graphics from where ever you loaded it from. By
drawing on the picture you've actually modified the bitmap that you
originally loaded.
--
Browse http://connect.microsoft.com/VisualStudio/feedback/ and vote. http://www.peterRitchie.com/blog/
Microsoft MVP, Visual Developer - Visual C#
"PK Ferrick" wrote:
Hi all,
My first post to MSDN... I've recently started to get into VB.NET, having
been a casual VB user for a few years. So far, it's going OK. I've managed
to figure out
how to draw lines on a PictureBox, using code like this:
g = PictureBox1.CreateGraphics()
p = New Pen(char_color, pen_width)
p.LineJoin = Drawing2D.LineJoin.Round
g.DrawLine(p, path.s.X, path.s.Y, path.e.X, path.e.Y)
and that's just peachy. What I'd like to do now is erase the lines and have
the
PictureBox revert back to the jpeg it started with.
At first it seemed like
g.Clear()
was going to do it, but I don't want to fill the box with a color- I want it
to show the
original picture.
Any hints would be greatly appreciated. Thank you.
Pat Ferrick This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Brandon J. Van Every |
last post by:
What's better about Ruby than Python? I'm sure there's something. What is
it?
This is not a troll. I'm language shopping and I want people's answers. I
don't know beans about Ruby or have...
|
by: Peter |
last post by:
I want to draw some lines on a widget.
This works ok, but when I want to redraw, the old lines are still there.
How do I clear or refresh the widget, so I can draw a new set of lines?
Code...
|
by: Reed L. O'Brien |
last post by:
I see rotor was removed for 2.4 and the docs say use an AES module
provided separately... Is there a standard module that works alike or
an AES module that works alike but with better encryption?...
|
by: Hermawih |
last post by:
Hello ,
I want your opinion about this .
In order to say it clearly , I think I have to describe it in long sentences .
I could consider myself as Intermediate/Advance Access Developer ;...
|
by: Uwe Porsch |
last post by:
Maybe a stupid question, but I don't know how to do.
I have an application where I read information from a database and show it
on a form. It also includes a picture stored as BLOB. On the form I...
|
by: Jason Huang |
last post by:
Hi,
Would someone explain the following coding more detail for me? What's the
( ) for?
CurrentText = (TextBox)e.Item.Cells.Controls;
Thanks.
Jason
|
by: Ben Bush |
last post by:
I had the following code and when I clicked the left mouse button one
time. I got green line and the second click got a purple line and the
green disappeared.
I was confused by two questions:...
|
by: Xah Lee |
last post by:
in March, i posted a essay “What is Expressiveness in a Computer
Language”, archived at:
http://xahlee.org/perl-python/what_is_expresiveness.html
I was informed then that there is a academic...
|
by: Carl Johansson |
last post by:
Except for the syntax, what is the difference, if any, between this...
/* ---------------------------------------------------------------------- */
private void Form1_Paint(object sender,...
|
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: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
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: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |