|
-
Mar 10th, 2010, 07:44 PM
#1
Thread Starter
New Member
Drawing in VB .NET CF
Hi All,
I'm making a program that gets a client to sign off when a job is done. What I want to be able to do is create a drawing object somehow on the form, and then when the user taps next the contents of that object are saved to a JPG file for use in paperwork (thats in HTML format as well). So how would I go about doing this? I wouldnt even know what control to use 
Thanks!
Lewis
-
Mar 10th, 2010, 07:53 PM
#2
Re: Drawing in VB .NET CF
If you're using standard Windows Forms, you would use a PictureBox and handle its MouseDown, MouseMove and MouseUp events. You'd record the start point, end point and all the recorded points in between and draw the result on the PictureBox. To save, you'd transfer the drawing to the Image in the PictureBox and then call its Save method.
Follow the CodeBank link in my signature and check out my Simple Drawing thread. It's not exactly what you want but very close. You just need to decide how to draw what's recorded:
1. Draw it as a series of dots by calling DrawRectangle multiple times with a 1x1 rectangle.
2. Draw it as a series of lines between each pair of locations.
I'd probably go with the second option.
-
Mar 10th, 2010, 07:55 PM
#3
Thread Starter
New Member
Re: Drawing in VB .NET CF
 Originally Posted by jmcilhinney
If you're using standard Windows Forms, you would use a PictureBox and handle its MouseDown, MouseMove and MouseUp events. You'd record the start point, end point and all the recorded points in between and draw the result on the PictureBox. To save, you'd transfer the drawing to the Image in the PictureBox and then call its Save method.
Follow the CodeBank link in my signature and check out my Simple Drawing thread. It's not exactly what you want but very close. You just need to decide how to draw what's recorded:
1. Draw it as a series of dots by calling DrawRectangle multiple times with a 1x1 rectangle.
2. Draw it as a series of lines between each pair of locations.
I'd probably go with the second option.
Thanks for your prompt response, but this is actually for .NET Compact Framework? Does this still stand? I'll check out the codebank thing anyway.
-
Mar 10th, 2010, 08:05 PM
#4
Re: Drawing in VB .NET CF
 Originally Posted by lewwy
Thanks for your prompt response, but this is actually for .NET Compact Framework? Does this still stand? I'll check out the codebank thing anyway.
This site has a .NET Mobile forum, so if you want mobile-specific advice then you should be posting there. I did notice that you specified the CF. I would assume that everything I have said would be applicable but I'll leave it up to you to check whether all the required types and members are supported.
-
Mar 10th, 2010, 08:06 PM
#5
Thread Starter
New Member
Re: Drawing in VB .NET CF
 Originally Posted by jmcilhinney
This site has a .NET Mobile forum, so if you want mobile-specific advice then you should be posting there. I did notice that you specified the CF. I would assume that everything I have said would be applicable but I'll leave it up to you to check whether all the required types and members are supported.
Ok cool, thanks for your help I'll give that a go. If it doesn't work I'll specify this thread to be deleted and then start a new thread over in the .NET CF area. Thankyou
-
Mar 10th, 2010, 08:08 PM
#6
Re: Drawing in VB .NET CF
 Originally Posted by lewwy
If it doesn't work I'll specify this thread to be deleted and then start a new thread over in the .NET CF area.
Just ask the mods to move the existing thread. The easiest way is to click the Report Post link at the bottom of your post and then ask there. That message will go to all mods.
-
Mar 10th, 2010, 08:49 PM
#7
Re: Drawing in VB .NET CF
-
Mar 11th, 2010, 01:09 AM
#8
Frenzied Member
Re: Drawing in VB .NET CF
Hi,
jmcilhinney's still stands in .Net CF - use a picture box to draw on , and then save it as a jpg. Use mousedown, mouseup and mousemove events. Alternately there are 3rd party signature boxes out there. Alternately an article and some code I wrote ages ago are here
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
|