Results 1 to 4 of 4

Thread: graphic viewer ... making it better

  1. #1

    Thread Starter
    Hyperactive Member theman32x's Avatar
    Join Date
    May 2000
    Location
    New Jersey, USA
    Posts
    305

    Post

    I recently made a very simple graphic viewer. All it did was open up graphic files to view and then be able to close those files.

    Well, now I want to add 2 more things to it. You know how when you're on the internet and you see a graphic and you highlight it and copy it. How can I paste a graphic into my program? I am using the image control.

    The next thing I would like to add to my program is the ability to save the graphic.

    How would I go about doing this? Any help is appreciated.

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Code:
    'load picture from clipboard
    Picture = Clipboard.GetData(2)
    'Save a picture
    SavePicture Picture, filename
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3

    Thread Starter
    Hyperactive Member theman32x's Avatar
    Join Date
    May 2000
    Location
    New Jersey, USA
    Posts
    305

    i had some problems with that code

    Image1.Picture = Clipboard.GetData(2)

    that worked for me ... but how come it will only paste graphics that i right clicked on n clicked on copy instead of me just being able to highlight n press ctrl + c?

    now the code to save the picture didn't work ...

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    that worked for me ... but how come it will only paste graphics that i right clicked on n clicked on copy instead of me just being able to highlight n press ctrl + c?
    what? Sorry, i didn't understand.

    What error did you get with savepicture? Picture argument is the source picture (image1.image) and filename is the filename argument is a string "C:\yourpath\yourfilename"
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width