x10Hosting Forums

Corporate Free Hosting for the Masses.



Register

Closed Thread
 
LinkBack Thread Tools Display Modes
Dan
X10 Senior Mod

Dan's Avatar

Join Date: Aug 2007
Posts: 1,121
Credits: 10,137
Dan has a brilliant future
Location: UK

 
09-20-2008, 12:20 PM
Visual Basic Help!

Hi Everyone,
Recently I have started with Visual Basic, but I've now got a little stuck...
I need a script to save the contents of a form as a JPG file.
If anyone can do this for me or tell me how to do it easily, they will recieve around 250 credits from me.

Thanks!!!
Dan
__________________
Dan
Senior Moderator


DO NOT PM ME OR ANY OTHER STAFF UNLESS ASKED TO DO SO.



Dan is offlineReport Post
x10Hosting Member

Join Date: Jul 2008
Posts: 4
Credits: 254
andypalmer86 is on a distinguished road
 
09-20-2008, 10:08 PM
Re: Visual Basic Help!

a post in this thread does what you're looking for I think
andypalmer86 is offlineReport Post
Dan
X10 Senior Mod

Dan's Avatar

Join Date: Aug 2007
Posts: 1,121
Credits: 10,137
Dan has a brilliant future
Location: UK

 
09-21-2008, 08:53 AM
Re: Visual Basic Help!

Quote:
Originally Posted by andypalmer86 View Post
a post in this thread does what you're looking for I think
That doesn't work for me I'm afraid :(
I think that person was probably using an older version of VB. I'm running the new 2008 one...

Anyone else help me?
__________________
Dan
Senior Moderator


DO NOT PM ME OR ANY OTHER STAFF UNLESS ASKED TO DO SO.



Dan is offlineReport Post
x10Hosting Member

Join Date: Oct 2007
Posts: 11
Credits: 255
ezdookie is on a distinguished road
 
09-21-2008, 12:06 PM
Re: Visual Basic Help!

Eh... Hi.. I don't have Visual Studio 2008 but if you are in problems you can add me to msn ezdookie@gmail.com for connect to your computer via VNC and make your job there...

Did you understand my english??.. uh..

P.D. That job was programmed with Visual Basic 6.0

Last edited by ezdookie; 09-21-2008 at 12:07 PM.
ezdookie is offlineReport Post
Dan
X10 Senior Mod

Dan's Avatar

Join Date: Aug 2007
Posts: 1,121
Credits: 10,137
Dan has a brilliant future
Location: UK

 
09-22-2008, 02:29 PM
Re: Visual Basic Help!

Quote:
Originally Posted by ezdookie View Post
Eh... Hi.. I don't have Visual Studio 2008 but if you are in problems you can add me to msn ezdookie@gmail.com for connect to your computer via VNC and make your job there...

Did you understand my english??.. uh..

P.D. That job was programmed with Visual Basic 6.0
I'm not sure I get what you mean...
I would just like a script please that will let me do this.
Anyone?
__________________
Dan
Senior Moderator


DO NOT PM ME OR ANY OTHER STAFF UNLESS ASKED TO DO SO.



Dan is offlineReport Post
x10 Sophmore

xmakina's Avatar

Join Date: May 2008
Posts: 239
Credits: 2,077
xmakina will become famous soon enough
Location: England

Send a message via MSN to xmakina
 
09-23-2008, 11:12 AM
Re: Visual Basic Help!

I don't have much experience in VB.Net but I think this thread might be of value:

http://forums.ni.com/ni/board/messag...essage.id=1097
xmakina is offlineReport Post
x10 Sophmore

supajason's Avatar

Join Date: Oct 2007
Posts: 236
Credits: 1,462
supajason will become famous soon enough
Location: England........:-)

Send a message via MSN to supajason
 
09-23-2008, 01:01 PM
Re: Visual Basic Help!

Quote:
Originally Posted by http://www.developerfusion.co.uk/forums/p/26911/109890/
You can take and save a picture of your form like this:

Code:
Option Explicit

Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _
ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)

Private Const KEYEVENTF_KEYUP = &H2

Private Function SaveFormPic() As Picture
   Dim pic As StdPicture
   Set pic = Clipboard.GetData(vbCFBitmap)
   keybd_event vbKeyMenu, 0, 0, 0
   keybd_event vbKeySnapshot, 0, 0, 0
   DoEvents
   keybd_event vbKeySnapshot, 0, KEYEVENTF_KEYUP, 0
   keybd_event vbKeyMenu, 0, KEYEVENTF_KEYUP, 0
   DoEvents
   Set SaveFormPic = Clipboard.GetData(vbCFBitmap)
   Clipboard.SetData pic, vbCFBitmap
End Function

Private Sub Command1_Click()
   SavePicture Clipboard.GetData(vbCFBitmap), "C:\MyPic.jpg" 'picture location
End Sub
The example requires one command button. It will take a picture of your form and save it into file "c:\mypic.jpg". You can change that.

Good luck.
From : http://www.developerfusion.co.uk/forums/p/26911/109890/
__________________
SuPaJaSoN WaS HeRE
supajason is offlineReport Post
Dan
X10 Senior Mod

Dan's Avatar

Join Date: Aug 2007
Posts: 1,121
Credits: 10,137
Dan has a brilliant future
Location: UK

 
09-23-2008, 01:42 PM
Re: Visual Basic Help!

Quote:
Originally Posted by supajason View Post
That doesn't work either I'm afraid...
I hope I can get something that works soon.
__________________
Dan
Senior Moderator


DO NOT PM ME OR ANY OTHER STAFF UNLESS ASKED TO DO SO.



Dan is offlineReport Post
Retired staff (11-12-2008)

Join Date: Jul 2006
Posts: 1,301
Credits: 7,409
Micro is on a distinguished road
Location: Hampshire

 
09-23-2008, 02:45 PM
Re: Visual Basic Help!

Quote:
Originally Posted by Dan View Post
That doesn't work either I'm afraid...
I hope I can get something that works soon.
Try this:

Put this at the top of the class file (form file, whatever)

Code:
Imports System.Drawing
Imports System.Drawing.Imaging
And this where you want to save it
Code:
Dim img as Bitmap = new Bitmap( Me.Width, Me.Height )
Dim g as Graphics = Graphics.FromImage( img )
 g.CopyFromScreen( new Point( Me.Left, Me.Top ), new Point( 0, 0 ), new Size( Me.Width, Me.Height ) )
img.Save( "filename.jpg", ImageFormat.Jpeg )
__________________
Micro
Account Manager

Do NOT PM me without my prior permission. Thanks.
Micro is offlineReport Post
Dan
X10 Senior Mod

Dan's Avatar

Join Date: Aug 2007
Posts: 1,121
Credits: 10,137
Dan has a brilliant future
Location: UK

 
09-24-2008, 02:45 PM
Re: Visual Basic Help!

Quote:
Originally Posted by Micro View Post
Try this:

Put this at the top of the class file (form file, whatever)

Code:
Imports System.Drawing
Imports System.Drawing.Imaging
And this where you want to save it
Code:
Dim img as Bitmap = new Bitmap( Me.Width, Me.Height )
Dim g as Graphics = Graphics.FromImage( img )
 g.CopyFromScreen( new Point( Me.Left, Me.Top ), new Point( 0, 0 ), new Size( Me.Width, Me.Height ) )
img.Save( "filename.jpg", ImageFormat.Jpeg )
That works just great micro!!!
Thanks! Sending you 250 credits now for helping me.
__________________
Dan
Senior Moderator


DO NOT PM ME OR ANY OTHER STAFF UNLESS ASKED TO DO SO.



Dan is offlineReport Post
Closed Thread

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
A simple Visual Basic Login Form Zenax Tutorials 0 03-13-2007 09:59 AM
Visual Basic + Microsoft Access Zenax Off Topic 2 03-01-2007 04:12 AM
Using Visual Basic 2005 TheJeffsta Scripts & 3rd Party Apps 3 08-05-2006 03:18 PM
Visual Basic for Free? AsPeRiTy Scripts & 3rd Party Apps 9 08-15-2005 09:24 PM
Visual Basic: An introduction Part 1 thegoodlist Tutorials 0 06-08-2005 12:00 PM


All times are GMT -5. The time now is 07:04 PM. Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.2.0 RC7
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios

Remortgages | Restaurant Equipment | Car Finance | Loan | Cheap Loan