VB.NET Tutorial For Beginners - Drawing To A Form And Saving Your Image (Visual Basic .NET)

Поділитися
Вставка
  • Опубліковано 27 сер 2024

КОМЕНТАРІ • 81

  • @terryk558
    @terryk558 10 років тому +3

    I discovered VBToolbox earlier this week and have gone through a dozen of your Tutorials. I find them excellent. The pace is perfect and you explain things clearly. Thank you so much for taking the time to put these together and share them with us!

    • @VBToolbox
      @VBToolbox  10 років тому

      And thank *YOU* for taking the time to submit some encouraging feedback, Terry. I appreciate that. :-)

  • @robertolpalafox2412
    @robertolpalafox2412 4 роки тому +1

    I followed you on every single step, it is a very good example.

  • @ericamaya1449
    @ericamaya1449 Рік тому

    Excellent , very usefull👍

  • @NewLeaf88
    @NewLeaf88 10 років тому +1

    Thanks for another great Tutorial! I look forward to all your tutorials because you are clear and concise. Thank you so much VB Toolbox. Hopefully you might do videos on macros/bots webbrower/webrequest :)

    • @holdenlondon6944
      @holdenlondon6944 3 роки тому

      I guess I'm kinda randomly asking but do anybody know a good website to watch new series online ?

    • @julianjackson456
      @julianjackson456 3 роки тому

      @Holden London i watch on flixzone. You can find it on google :)

    • @stanleyreyansh6835
      @stanleyreyansh6835 3 роки тому

      @Julian Jackson yea, I've been watching on FlixZone for since march myself =)

    • @christophercristiano4579
      @christophercristiano4579 3 роки тому

      @Julian Jackson thanks, I signed up and it seems like they got a lot of movies there :) I appreciate it!

    • @fabianfisher6740
      @fabianfisher6740 3 роки тому

      @Holden London no problem xD

  • @mathteacher2651
    @mathteacher2651 6 років тому

    You rock man!
    I really appreciate this example!

  • @ngoanhuynh4042
    @ngoanhuynh4042 2 роки тому

    Character In the video It's great, I like it a lot $$

  • @buddyroach
    @buddyroach 8 років тому +2

    when i draw, it skips across the canvas into little dots. how do you make it continue to draw in a continuous stoke?

    • @VBToolbox
      @VBToolbox  8 років тому +4

      To prevent skipping, we can use a different drawing technique. Rather than drawing rectangles, we can capture the mouse points and draw lines between the captured points using a Queue collection.
      We'll just need to alter a few lines to make this work.
      1.) Add a Queue collection as a variable in your Form class. This will store your mouse positions:
      Private qMouse As New Queue(Of Point)
      2.) In our PaintBrush() Sub, change the parameters to "Size" and use the type "Single" to choose the width of your Pen stroke. We will then check to see if we have any points in our queue, and if we do, we will draw a line between them and remove them from the Queue collection:
      Private Sub PaintBrush(Size As Single)
      Using g As Graphics = Graphics.FromImage(pbDraw.Image)
      If qMouse.Count > 1 Then
      g.DrawLine(New Pen(DrawColor, Size), qMouse(0), qMouse(1))
      qMouse.Dequeue()
      End If
      End Using
      pbDraw.Refresh()
      End Sub
      3.) To capture and draw we'll use the MouseUp, MouseDown, and MouseMove events, just like we did in the tutorial:
      pbDraw_MouseDown:
      Draw = True
      qMouse.Enqueue(e.Location)
      PaintBrush(1.0F)
      pbDraw_MouseUp:
      Draw = False
      qMouse.Clear()
      pbDraw_MouseMove:
      If Draw = True Then
      qMouse.Enqueue(e.Location)
      PaintBrush(1.0F)
      End If
      Note: I'm supplying a static value of "1.0F" for the PaintBrush(Size). You can make it more dynamic by supplying these like we did with the ComboBox in the tutorial.
      I hope this helps! :-)

  • @CarlFritz24
    @CarlFritz24 9 років тому +1

    Very impressive...
    WHAT IF... we could build our own Photo viewer, using that method (having a Table to store the paths from photos and retrieve the paths for the Form) ?
    That would be... really FUN !
    Thank you for your shared amazing abilities.

    • @VBToolbox
      @VBToolbox  9 років тому +1

      Hello, Carlos! :-) Hmmm That would actually be pretty simple to do - maybe with a SQL Ce database, or even just a simple .CSV file. I already have a simple Photo Viewer tutorial even. (Here: ua-cam.com/video/w6fvczfcbBU/v-deo.html). Storing the file paths would be a piece of cake.

    • @CarlFritz24
      @CarlFritz24 9 років тому +1

      OK, VB Toolbox.
      I already found out there is such a project that you have done.
      And it is just fantastic (it seems we had the same idea. You, first...) !
      I have to say:
      - man, I would absolutely love to have your knowledge on this stuff !
      And everyone in UA-cam... absolutely loves (...) you.
      We don't need to see the other videos (related to what you explain in yours) !
      Many thanks, and I have an idea for a project (which I will try to make...) !
      Anyway... because you are so special... I'm going to tell you:
      - an application to control our entire life (Banks, Home expenses - with statistics for food , Salaries and taxes, Personal schedules, Birthdays, Medical situations

    • @VBToolbox
      @VBToolbox  9 років тому +1

      Carlos Alberto Araujo Thank you for the vote of confidence and encouragement, Carlos! :-D
      While your app sounds pretty complex, I think that we're really only limited by our imagination and motivation. The important thing is to take it one piece at a time. First, get each component working. Then, improve the code to make it work more efficiently with less code.
      Excel can be very useful and can be greatly extended via macros, but a compiled application can offer so much more flexibility and power. I'm much more comfortable working with databases than excel, but in reality they're very similar. You're just working with a Dataset - columns and rows - and performing look-ups and calculations.

  • @dhavhe84
    @dhavhe84 6 років тому

    Thank you very much. This video helped me a lot. A very didactic example. Good job

  • @JuanAndresBaldion
    @JuanAndresBaldion 4 роки тому

    This is amazing, thanks for this video, very well explained and totally usefull

  • @nuriiasker6958
    @nuriiasker6958 2 роки тому +2

    Really .. nice , Is there ones about user grants ? ( User as admin .. has all permissions .. others not all ) I mean admin can save, delete, update, search, others only can search . thanks so much, late but thank you .

    • @VBToolbox
      @VBToolbox  2 роки тому +1

      I know I built a very basic permissions table just like that with one of my SQL tutorials, but I'm not sure if I ever demo'd that. It's included in one of my SQL project links (part 4), I believe.
      Database is the best way to manage permissions, for sure, but you could also use an encrypted text file or .ini file if you didn't want to use a database.

  • @amolpathakndb
    @amolpathakndb 4 роки тому

    thank you very very very much for this tutorial

  • @srihandayani6733
    @srihandayani6733 2 роки тому

    Thank you very much

  • @MrBabyJugger
    @MrBabyJugger 8 років тому +1

    Hi, I have a form with animation morphing. I wanted to save it into a .gif file with that animation. Is it possible?

  • @FirstNameLastName-gm8xq
    @FirstNameLastName-gm8xq 7 років тому +1

    Could you make a tutorial on adding text do it also? or if you could, add the code to do so... not the whole program, just the snippit

  • @nagisafurukawa8864
    @nagisafurukawa8864 7 років тому +1

    What about if I have a list view displaying images and i want to save them in a created directory, how can I do so?

  • @paritoshshah8361
    @paritoshshah8361 7 років тому +1

    thanx a lot. working gr8

  • @mozgotron12
    @mozgotron12 3 роки тому

    Отличный мастер класс!

  • @Core034
    @Core034 3 роки тому

    THX so much 🥳🥳🥳

  • @TheJoker0
    @TheJoker0 9 років тому +1

    Hi Vbtoolbox! I have seen your tutorials and I love them. I am working in a program and in my program I have 3 PictureBox and 1 TextBox and I wont to blend 2 pictures and the text on TextBox in the third PictureBox and save that picture. Can You help me PLEASE.

  • @user-mh6to3hs9x
    @user-mh6to3hs9x 2 роки тому

    When the graphics size exceeds the picturebox,
    I can use scrllobar to keep drawings are visible and save as parts of image,but
    For example,when the square exceeds the viewport,especially in using"for... next"
    automatically drawing,how to keep it? thanks for your videos!

  • @fivepaprika4039
    @fivepaprika4039 2 роки тому

    Hi there, great video, is it possible to capture a specific square area within the form design? as I can’t seem to change the location of the capture and size with much success…
    Hope that makes sense
    Thank You for any help!!!

  • @buddyroach
    @buddyroach 9 років тому

    what if i want to save it as gif? i tried and it made the image all weird looking and bad quality but it was a gif from the start and looked better. how do i get full quality rendering on gifs?

  • @IvanJamesLegaspi
    @IvanJamesLegaspi 6 років тому

    It just draws a bunch of dots if the mouse moves too fast. Please help.

  • @FirstNameLastName-gm8xq
    @FirstNameLastName-gm8xq 7 років тому

    For your second idea on the thing without rectangles, my program crashes when trying to use this
    dim thickness as integer = "1"
    dim thickness1 as string = thickness.ToString + ".0F"
    or this dim thickness1 as string = thickness + ".0F"
    mousemove:
    qMouse.Enqueue(e.Location)
    PaintBrush(thickness)

  • @ricobernardo2767
    @ricobernardo2767 5 років тому

    i cannot able to see the image I set on the picturebox when i used this code what should i do?

  • @ricobernardo2767
    @ricobernardo2767 6 років тому

    what if I wanted to draw on picturebox with an image?

  • @FirstNameLastName-gm8xq
    @FirstNameLastName-gm8xq 7 років тому

    Also, i want to draw to an image, and it wont let me, a custom image i can select with a opendialog and it wont draw to it, could you help me?

  • @COLORPAPERPRINCESS
    @COLORPAPERPRINCESS 8 років тому

    wow cool!!!

  • @Kinko01765
    @Kinko01765 6 років тому

    Hi, thank you for your video .
    I have some question about How do I control name of image with textbox ,date and time?

  • @jameel7
    @jameel7 8 років тому

    plz help picturebox saves in white image whitout the drawing

  • @jericotelan6020
    @jericotelan6020 4 роки тому

    What if I want to save multiple drawings?

  • @robelaynalem2748
    @robelaynalem2748 7 років тому

    it was a wonderfull tutorial;....thanks so much
    can you help me how to draw lines (any graphics) during run time and make some selection using mouse to assign values......
    thanks so much

  • @raghadoudah
    @raghadoudah 5 років тому

    Thank you!

  • @mohamedzer85
    @mohamedzer85 9 років тому +1

    I love your tutorials man :) great job and thank you so much
    I was wondering if you can make a tutorial and show us how to create an e-signature for a vb application !
    I did create 1 following this tutorial but the signature is kinda different and I would like to save it to a db ...
    I found a tool called inksecuresignature but I didn't know how to use to save the signature into db or png ...
    can yo u help plz ?
    thanks

    • @VBToolbox
      @VBToolbox  9 років тому +1

      Mohammed Zerzouri Thank you, sir. I've never worked with e-signatures specifically; However, I am working on a tutorial for storing images to a database. Hopefully, you will be able to adapt it for your needs. You will need to have the PNG or at least a memory stream of the image data available in order to place it in the database. If the tool allows you to see the image in your application, then you should be able to capture it to PNG using the picturebox or graphics object that is displaying the image.

    • @mohamedzer85
      @mohamedzer85 9 років тому

      VB Toolbox thanks

    • @VBToolbox
      @VBToolbox  9 років тому

      Mohammed Zerzouri If you'd like to see my source prior to a tutorial, it can be download here: www.dropbox.com/s/n6skmrga831lpdn/DBPicturesTut.zip?dl=0
      To actually use it you'll need to adjust the connection string and queries to match your database.

  • @polasanderson6353
    @polasanderson6353 10 років тому +1

    I suggest for you ;)
    What about if you create tut about how to open from openfiledialog picture draw to picture and save it on desktop example ?

  • @mathteacher2651
    @mathteacher2651 6 років тому

    Thank You.

  • @chiecoy
    @chiecoy 8 років тому

    is there a way that can add a undo button...

  • @mianayaz
    @mianayaz 5 років тому

    Thank's

  • @bullykinggaming2679
    @bullykinggaming2679 10 років тому

    very helpful on my thesis. wheres the other tutorial to how save the picture in document and i can use different file name??

    • @VBToolbox
      @VBToolbox  10 років тому

      Do you mean like a SaveFileDialog?

    • @bullykinggaming2679
      @bullykinggaming2679 10 років тому

      YES sir. i want to save it in the document. because your saving image is on the debug folder and if you save more just one sources. please help me in the codings..

    • @bullykinggaming2679
      @bullykinggaming2679 10 років тому

      because my client is a nursery school. i want their drawing save properly in the folder in a different file name.

    • @bullykinggaming2679
      @bullykinggaming2679 10 років тому

      please help sir... thankyouuu :)

    • @VBToolbox
      @VBToolbox  10 років тому

      My tutorial on StreamWriter shows how to use the SaveFileDialog. :-) ua-cam.com/video/lhHmOwtb76E/v-deo.html

  • @dukestt
    @dukestt 9 років тому +1

    There are no mistakes, just happy little accidents....

    • @VBToolbox
      @VBToolbox  9 років тому +1

      Bwahaha! Thank you, Bob Ross! ;-D

  • @Brwlix
    @Brwlix 5 років тому

    thanks

  • @anisahmadi5044
    @anisahmadi5044 7 років тому

    hello
    thank you for this video
    I'm asking if you can upload the source code plz

    • @VBToolbox
      @VBToolbox  7 років тому +1

      Hello, Anis. This is a really old tutorial and this was the closest project source that I could locate in my archive. I think that the drawing size may need to be fixed but everything else appears to be functional. Link: www.dropbox.com/s/v3e47zqccvtzajj/DrawingTut.zip?dl=0

  • @cahyoanggoroseto2583
    @cahyoanggoroseto2583 7 років тому

    i love you alll :* :* :* :*

    • @teachwithcomputer
      @teachwithcomputer 6 років тому

      God will bless you for this beautiful tutorial. I have been looking for a vb.net code to draw on the InkPicture control and save the image. With this tutorial, EUREKA! Thanks a lot.

  • @user-mh6to3hs9x
    @user-mh6to3hs9x 2 роки тому

    automaticallyautomaticallyautomatically

  • @quangdang4517
    @quangdang4517 2 роки тому

    Character In the video It's great, I like it a lot $$