Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_vb thread: How to Save image displayed in Picture Box


Message #1 by "manoj singh" <manoj241176@y...> on Thu, 21 Nov 2002 12:41:01
Thanks Manish, yeah it worked..
Manoj

--- BlessedSoul <blessedsoul@s...> wrote:
> Hey Manoj
> 
> here i have something for u....  guess it'll suit ur
> requirement
> 
> what i'm doing is copy an image file and paste it on
> clipboard
> programatically
> you'll have to add an extra component, a picturebox
> (visible false)
> 
> step 1: Add an API declaration in a .bas module
>
'---------------------------------------------------------------------------
> -------
> Public Declare Function SendMessage Lib "User32"
> Alias "SendMessageA" (ByVal
> hwnd As Long, ByVal wMsg As Long, ByVal wParam As
> Long, lParam As Any) As
> Long
> Public Const WM_CUT = &H300
> Public Const WM_COPY = &H301
> Public Const WM_PASTE = &H302
> Public Const WM_CLEAR = &H303
> Public Const WM_USER = &H400
> Public Const EM_CANUNDO = &HC6
> Public Const EM_UNDO = &HC7
>
'---------------------------------------------------------------------------
> -------
> 
> Step 2: Call the following code to paste the image
> file (presently the image
> path is hardcoded) on the rich text box
> 
>     Dim SignaturePath As String
>     SignaturePath = App.Path & "\export_hot.gif"    
>                   '
> Marc > here comes the path of file u want to paste
>     picSignature.Picture 
> LoadPicture(SignaturePath)                '
> picSignature is a picture box u'll have to add
>     Clipboard.Clear
>     Clipboard.SetData picSignature.Picture
>     SendMessage RTB.hwnd, WM_PASTE, 0, 0&           
>         ' RTB is
> richtextbox name
> 
> 
> 
> Hope this'll solve your purpose
> All the best
> 
> Manish
> 
> 
> 
> ----- Original Message -----
> From: "manoj singh" <manoj241176@y...>
> To: "professional vb" <pro_vb@p...>
> Sent: Friday, November 22, 2002 12:00 PM
> Subject: [pro_vb] Re: How to Save image displayed in
> Picture Box
> 
> 
> > Thanks Marco,
> >    Yeah I totally agree with u..i tried
> savepicture
> > method but it wasnt working out..so pls tell me,
> whats
> > the API name by which i can do this.
> > Thanks
> > Manoj
> >
> > --- Marco Straforini <marco.straforini@c...>
> > wrote:
> > > Hello Manoj,
> > >
> > > The SavePicture statement does not help you,
> because
> > > your second
> > > picture box does not have a picture associated
> to
> > > it.
> > > You have two choices: use a different component
> that
> > > allows you to
> > > save images (they are cheap) or use APIs to get
> the
> > > image data
> > > and save the image yourself.
> > >
> > > Marco
> > >
> >
> >
> > __________________________________________________
> > Do you Yahoo!?
> > Yahoo! Mail Plus - Powerful. Affordable. Sign up
> now.
> > http://mailplus.yahoo.com
> >
> >
> 
> 
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus ? Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

  Return to Index