Results 1 to 9 of 9

Thread: After starting of my form application, sometimes form draw image area looks strech

  1. #1

    Thread Starter
    Member
    Join Date
    Jun 2017
    Posts
    45

    After starting of my form application, sometimes form draw image area looks strech

    Hi All,

    I have draw image in Form under paint event using e.graphics.drawimage but after start and close my application, sometimes image looksa like strech in form. We put image in picturebox and from there we take image and draw it on form.

    can you please help me to resolve issue.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: After starting of my form application, sometimes form draw image area looks strec

    You're doing something wrong. We don't know what you're doing so we can't tell you what's wrong with it. Show us what you're doing.

    That said, if you're drawing in the Paint event handler then there should be no need for a PictureBox. The PictureBox draws its own Image. Don't do both.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Member
    Join Date
    Jun 2017
    Posts
    45

    Re: After starting of my form application, sometimes form draw image area looks strec

    We need to take picturebox in form. Thats our recruitment, so we do like e.graphics.drawimage(pitcurebox.image,0,0,Me.Width,Me.height)

    Is any thing we neeed to change in picturebox property. ?

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: After starting of my form application, sometimes form draw image area looks strec

    Please take the time and make the effort to provide a FULL and CLEAR description of the issue rather than vague approximations. Show us the actual code, i.e. copy the Paint event handler from VS and paste it here inside appropriate formatting tags. Post screenshots of what things should look like and what they do look like. Assume that we know nothing about your application other than what you tell us... because that is the case. Give us AL the relevant information.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Member
    Join Date
    Jun 2017
    Posts
    45

    Re: After starting of my form application, sometimes form draw image area looks strec

    OK thanks for replying, i want one help so that it will fix,

    form_paint(e as paintevent)
    {
    e.graphics.drawimage(picturebox.image,0,0,Me.width,Me.Heiht)
    End
    End sub
    }
    after executing that form open and showing form for very less timethen it closed. I want that form part should not be displayed. and it exit from application.
    Is there any way so that i can achieve this functionallity. This will help me to resolve issue.
    }

  6. #6

    Thread Starter
    Member
    Join Date
    Jun 2017
    Posts
    45

    Re: After starting of my form application, sometimes form draw image area looks strec

    I want

    form_paint()
    {
    e.graphics.drawimage(picturebox.image,0,0,Me.width,Me.Heiht)
    If InStr(VB.Command(), "-b") > 0 Then
    {
    Dim bm As New Bitmap(Me.Width, Me.Height)
    Me.DrawToBitmap(bm, New Rectangle(0, 0, Me.Width, Me.Height))
    bm.save("a.bmp")
    End
    }
    Endsub
    }

    so once -b command come it just save whatever things present on form and save it and exit from application. But is showing form for some second than application close. I want nothing should be shown while giving -b command.

  7. #7

    Thread Starter
    Member
    Join Date
    Jun 2017
    Posts
    45

    Re: After starting of my form application, sometimes form draw image area looks strec

    if anyone could help me , it is really good for me.

  8. #8
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: After starting of my form application, sometimes form draw image area looks strec

    Four things:

    1.
    copy the Paint event handler from VS and paste it here
    You haven't done that. That's not even valid VB code.

    2.
    paste it here inside appropriate formatting tags
    I'm not seeing any formatting.

    3.
    Post screenshots of what things should look like and what they do look like.
    Need I say more?

    4. Why are you using 'End'? NEVER, EVER use 'End'. If you want to exit the application then either call Application.Exit or Close on the main form. Whichever you choose though, it should absolutely NOT be done in the Paint event handler.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  9. #9

    Thread Starter
    Member
    Join Date
    Jun 2017
    Posts
    45

    Re: After starting of my form application, sometimes form draw image area looks strec

    Thanks for solution, it is working fine sir,,, thank you so much

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width