VS 2010 Save Drawing From PictureBox?

Jun 4, 2011

I'm trying to save the lines I drew in a PictureBox as a bitmap, but it just returns blank images...This is the code I have now:

vb
'Draw a grid on PictureBox named draw
For x As Integer = 0 To bWidth

[code]....

View 3 Replies


ADVERTISEMENT

How To Save Drawing In Picturebox

Sep 25, 2011

I have here a code to draw on a picturebox and when I am trying to save the drawing, it seems that it cant detect whats inside the picturebox.

Here is my
Public Class Signature
Inherits System.Windows.Forms.Form
Dim mousePath As New System.Drawing.Drawing2D.GraphicsPath()
Dim myAlpha As Integer = 100 ' declare a Alpha variable
Dim myUserColor As New Color()
Friend WithEvents btnSave As System.Windows.Forms.Button
[Code] .....

View 11 Replies

Save The Drawing That Is In A Picturebox To File ?

Feb 22, 2009

How can I save the drawing that is in a picturebox to file?

Here is my code so far:

Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) Handles PictureBox1.MouseDown
If e.Button = MouseButtons.Left Then

[CODE]..........................

View 2 Replies

VS 2010 - Clearing The Drawing In PictureBox

Mar 13, 2012

I've problem with clearing the drawing in PictureBox. The parts of a drawing are created with PictureBox1_ Paint Event like this: Name is one of the Subs (just part of a drawing). I've created a second event Timer1_Tick in which I want to clear the drawing created before but I can't reach it just with g.Clear(Color.White).

View 8 Replies

VS 2010 Drawing Image To Picturebox?

Jul 20, 2011

I have 4 control 3 button and 1 picturebox

vb.net
Private sub Button1 Dim bm As Bitmap = New Bitmap("D:Trening4 - Copy.bmp"

[code].....

View 4 Replies

VS 2010 Drawing A Curve/graph In Picturebox?

Nov 21, 2009

My problem is centering the 0,0 points of my graph to the center of my picturebox

Dim picBoxWidth As Integer = picGraf.Size.Width
Dim picBoxHeight As Integer = picGraf.Size.Height
Dim halfWidth As Integer = picGraf.Size.Width / 2

[code]....

So how to I tell it to start at the center of my picturebox names (picgraf) btw.

View 1 Replies

Drawing On Picturebox Vs Drawing On Form?

Feb 18, 2012

I need some code to draw a resizable, draggable rectangular cursor (or selection box) on a picturebox. I found some excellent code (albeit rather old) that does just that, but on a form rather than a picturebox. I have tried converting the code - basically moving things to the picturebox events (Paint, MouseDown, MouseMove etc). It nearly works but leaves a trail behind it when you move or resize the cursor. In other words, the selection rectangle is not being erased before being drawn in the new position.

Is there some fundamental difference between drawing graphics on a form and drawing on a picturebox that would cause this behaviour? Something like, when you invalidate a form and cause a redraw it erases what you did last? If not, then I just need to dig a bit further and work out how the cursor is being erased from the previous position.

Here's the original code that works fine on a form:

Private DragRect As New RectangleF(20, 20, 100, 80)
Private Adornments(7) As RectangleF
Private MouseInRect As Boolean = False

[Code]....

View 1 Replies

VS 2010 Save Animated .GIF From PictureBox To File?

Sep 26, 2010

Imports System
Imports System.IO
Imports System.Drawing
Imports System.Drawing.Imaging
Imports Gif.Components

[Code]...

"pbAnimated" PictureBox contains the .GIF animation. How can I save that animation to file?

View 9 Replies

VS 2010 Save Controls And Image Inside Picturebox?

Feb 13, 2012

drawing shapes on a picture box then saving them.

My current situation: I have a scrollable picturebox (achieved using panel + picturebox). On top of the image inside the picturebox I've added labels on different locations(the labels are added on run-time using PictureBox1.Controls.Add etc). I want to save the contents as well as the image inside the picturebox.

View 13 Replies

Drawing A Lines In A Picturebox?

Jan 18, 2011

I've looked and tried.. and for some reason just don't seem to be getting right now.

I have a picturebox that is 250x500, I want to draw a vertical line from the top to the bottom.

Using gs = pbMap.CreateGraphics
'Do While x.X < 250
'gs.DrawLine(Pens.Red, x, y)

[Code].....

View 7 Replies

Drawing Line On Picturebox?

May 27, 2010

My program is giving the error: "End of statement expected" The red lines are the ones giving errors. I'm trying to draw lines on a picturebox to create a graph

Dim iScale As Single
Const Distance = 1000
pictureBoxGraph.ForeColor = QBColor(0)

[Code]....

View 16 Replies

Drawing On A Picturebox Control?

Jul 28, 2009

This form has a picturebox and a button. The program draws a random line onto the picturebox every time the button is pressed. I want to modify the program so that it also draws a line onto the picturebox when the program is first run. I added a draw() to the form_load event but that didn't work. What do I need to do?

Public Class Form1
Dim x1 As Integer
Dim y1 As Integer

[code]....

View 1 Replies

Drawing A Resizable Rectangle On Picturebox

May 26, 2010

I have try many different methods but still no avail.how to do this? As i found a good tutorial over

here where it create a resizable rectangle on a form. But what i want is on a picturebox with image.

View 7 Replies

Drawing Multiple Images In Picturebox?

Oct 7, 2009

I got down the drawimage part. The problem I am having, is when I draw another image, it replaces the old one. Here is my

vb
Public Class Form1
Dim PicPoint As Point

[Cod].....

View 27 Replies

Basics: Drawing Graph With Picturebox - Image

Jan 9, 2011

I am new to vb.net, from VB6. Trying to understand drawing a simple line graph into a picturebox, which was so simple in VB6 ! From code snippets, I can see the basic idea using an bitimage to draw the lines and then showing it in a picturebox. I don't understand how to (simulate) scaling of the bitmap's x/y scales like you could do with VB6's .Scale.

View 1 Replies

Drawing Graphics - How To Clear Image In PictureBox

Nov 23, 2011

I have 1 image in picturebox. Now I draw some rectangles. I'm trying clear the image (only rectangles and left the image) without success.

Private Sub btnImageSelection_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnImageSelection.Click
Dim intImages As Integer = 0
Dim intImagesLine As Integer = 0
Dim intImagesColune As Integer = 0
picImage.Image = PictureBox1.Image
[Code] .....

The cycles for is for show the rectangules and works fine. but
i.Clear(Color.Blue)
The image is clear but the rectangles are showed and then unshowed.

View 19 Replies

VS 2008 - Drawing Graph On PictureBox Using Coordinates

Sep 21, 2009

VB 6 has a ScaleHeight and ScaleWidth property which VB 2008 does not support and this is causing me fits to work around. I'm trying to draw some lines (a graph) on a Picture Box (or a Panel) using my own coordinates (not pixels). This can't be all that hard can it?

View 3 Replies

VS 2008 : Drawing With Multiple Colors In A PictureBox?

Apr 13, 2011

I'm basically trying to make a simple, easy-to-use, paint program. I seem to be having problems with using multiple colors in the PictureBox1_Paint option. It draws the graphics but when you change the brush color and click in the picturebox it changes the colors of the previous graphics to the color you are currently trying to use. I need it to allow multiple colors.

Here's the code that I'm currently using..

Imports System.Drawing.Drawing2D
Public Class DynosPaint
Inherits System.Windows.Forms.Form
Private IsFormBeingDragged As Boolean = False

[code]....

View 3 Replies

VS 2008 Drawing With Multiple Colors In A PictureBox?

Apr 13, 2011

I'm basically trying to make a simple, easy-to-use, paint program. I seem to be having problems with using multiple colors in the PictureBox1_Paint option. It draws the graphics but when you change the brush color and click in the picturebox it changes the colors of the previous graphics to the color you are currently trying to use. I need it to allow multiple colors.

Here's the code that I'm currently using..

Imports System.Drawing.Drawing2D
Public Class DynosPaint
Inherits System.Windows.Forms.Form

[code]....

View 1 Replies

Drawing A String On A Picturebox In The Form Load Event?

Jun 13, 2010

I have a question about drawing a string on a picturebox in the form load event. So I have a picturebox on a form and in the form load event of this form I have this code:

Dim gx As Graphics = PictureX.CreateGraphics
Dim f As Font = New Font("Arial", 8)
Dim brr As Brush = New SolidBrush(Color.Black)
' Add the copyright text
gx.DrawString("1", f, brr, 2, 5)

But when I load the program nothing is drawn in the picturebox. Is there something wrong with the code or should I use the paint event of the picturebox?

By the way I also used this code in another program and there it works flawlessly, everything is drawn in the right place there when i load the program.

View 14 Replies

Interface And Graphics :: VB2010: Picturebox Drawing Disappears?

May 26, 2012

Problem1: I have a picturebox on a form. I have also managed to draw several PNG files with transparency onto the picturebox (see below). However, If I move the form outside the border and move it back, the image is gone. My source so far:

Dim k1 As New Bitmap(My.Resources.image1)
Dim k2 As New Bitmap(My.Resources.image2)
Dim drawMe As Graphics = PictureBox1.CreateGraphics
Dim bgcolor As Color = Color.FromArgb(128, 128, 128)
drawMe.Clear(bgcolor)

[Code]...

View 10 Replies

VS 2008 Drawing Chart In Picturebox Then Creating Bmp And Saving

Aug 3, 2009

I'm drawing a chart in a pictruebox with a sub called Techart. After that I'm trying to turn the drawing into a bitmap, so that it will be persistant and also so that I'll be able to save it. This is what I've got from searching the forum:

[Code]...

View 5 Replies

VS 2005 Drawing On PictureBox Erase When A Window Move On Front

Dec 25, 2009

I used a picturebox to allow user draw lines by mouse. I used this code in mouse down:


Dim D As New System.Drawing.Pen(DrawingColor, 2)
Dim g As Graphics = PB.CreateGraphics()
g.DrawLine(D, X1, Y1, X2, Y2)

but when a window appear on front of picturebox... its seams that picturebox redraw itself, so drawn lines erased.

View 5 Replies

Change Image In Windows Forms App. System.Drawing.Bitmap In A PictureBox

Jul 19, 2010

I have a VB.NET Windows Forms app with a logo image on the form as a System.Drawing.Bitmap inside a PictureBox.I used the Visual Studio Designer to add the logo .bmp image so I don't currently have any VB code doing anything with it.I'd like to make the current logo a clickable object/button so when I click on it a file browser dialog opens and I can select a new image to replace the current image.The current image is a local resource and is set in a PictureBox as a System.Drawing.Bitmap.How would I replace that System.Drawing.Bitmap with a file selected from the file browser dialog?

View 1 Replies

Interface And Graphics :: Drawing Objects To Picturebox With Floating Point Numbers?

Jul 17, 2009

If I try to draw a circle by using e.g.

Code:
e.Graphics.DrawEllipse(Pens.Red, 50.133, 100.321, 0.1, 0.1)

I will get an error message. I tried something like

Code:
Public ObjectPoint As PointF
Dim cpoint As New PointF()
cpoint.ObjectPoint = New PointF(startX, startY)
e.Graphics.DrawEllipse(Pens.Blue, cpoint.ObjectPoint, 0.4, 0.4)

but it didn't work for the location and the circle size. How to draw a circle(and rectangle) by using floating point numbers?

View 6 Replies

VS 2008 Drawing Dots/polygons On Mousdown Or Click Event In A Picturebox?

May 1, 2010

I have a problem. Im trying to create a form that enables a user to add dots on a mouse click event over an office floor plan. I have searched the web and this site but still am struggerling. My aim is to be able to draw dots (purpose is to highlight problems) and polygons over the plan (purpose to define which service area the floor area relates). I want to save all graphics to an access database with associated
fields.

My thinking is to place a second picture box over the first and make this transparent and use this as the user interface? I dont expect anyone to solve this for me, however, any help with how to draw dots and polygons through mouse down or mouse click would be most helpful.

View 3 Replies

Save A Picturebox Image Without A Save File Dialog

Mar 18, 2010

i made a vitual dekstop and i have a few problems that to be fixed. The first problem i have is that i have a picturebox as the entire form like the desktop background but the progrblem is that i have some group boxes over that picturebox box. How can i make so you can see throw the group box so that you can see the image behind it. And how can i save a picturebox image without a save file dialog

View 5 Replies

Save Image And Drawing Into MySQL Table?

Jun 25, 2009

I'm currently working with these codes. Am I able to save my image and drawing into mySQL table? what codes should I use in order to save them into my table and I may need to able to retrieve it in a later part.

my codes:

Code:
Public Class Page_2
'Declare Starting Points For Drawn Objects
Private sStartX As Short
Private sStartY As Short

[code]....

View 4 Replies

VS 2008 Save And Print The Long Drawing?

Nov 2, 2010

I have a scrollable drawing (in the form paint event) with a height / width ratio up to 1: 10 . I can see the entire drawing by scrolling with the left and right arrow keys. Problem is when I need to save or print the drawing.

1. - If I try to print or save with the: PrintForm1 or with some code for a screen capture I get only part of the drawing, which is seen on screen.Is there any possibility that I save the whole drawing (the entire form, even the part that can not be seen) as a bmp or png ... (something like extended window in "Snagit" program)?

2. - If I want to print the whole drawing, I know that I have to make in a several pages. Does anyone have a similar example of this?

View 1 Replies

VS 2010 New PictureBox Located Relative To Another PictureBox

Jan 21, 2011

I am working on a small desktop form in VB 2010 and am trying to place a pictureBox with an image in it, next to another pictureBox already located on the form when the user clicks a button.

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
Dim tool As String

[Code]....

But for some reason the newPictureBox with image from "ptext" does not show up on the form. When I specify the new Point to be something like, (50,50) instead of getting the first pictureBox coordinates, the new pictureBox shows up in the right place.

Am I using System.Drawing.Point wrong? Or is there some other error that I'm making?

View 2 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved