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.
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.
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. ?
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.
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.
}
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.
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.
Re: After starting of my form application, sometimes form draw image area looks strec
Four things:
1.
Quote:
copy the Paint event handler from VS and paste it here
You haven't done that. That's not even valid VB code.
2.
Quote:
paste it here inside appropriate formatting tags
I'm not seeing any formatting.
3.
Quote:
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.
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