|
-
Aug 21st, 2017, 12:51 AM
#1
Thread Starter
Member
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.
-
Aug 21st, 2017, 12:57 AM
#2
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.
-
Aug 21st, 2017, 06:08 AM
#3
Thread Starter
Member
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. ?
-
Aug 21st, 2017, 07:07 AM
#4
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.
-
Aug 21st, 2017, 07:12 AM
#5
Thread Starter
Member
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.
}
-
Aug 21st, 2017, 07:18 AM
#6
Thread Starter
Member
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.
-
Aug 21st, 2017, 07:19 AM
#7
Thread Starter
Member
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.
-
Aug 21st, 2017, 07:34 AM
#8
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.
-
Aug 29th, 2017, 11:48 AM
#9
Thread Starter
Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|