Results 1 to 4 of 4

Thread: load a picture to a varible

  1. #1
    Join Date
    Jul 2005
    Posts
    93
    Rep Power
    0

    Default load a picture to a varible

    how do i load a picture to a varible and measure the resolution of it . if the resolution is less than 200 x 300 it should then dispay a message , if it is greater than 200 x 300 it should display another message then load the picture from the variable to a picture box " picture1.picture .

    please.

  2. #2
    digimon Guest

    Default

    if using .net c#, then do this:

    u gonna have to load picture from file using a filestream (call it fs). then u say MyImg=Image.Fromstream(fs);

    next thing is to get the size right?
    int length=MyImg.Size.Width;
    int height = Myimg.Size.Height;

  3. #3
    Join Date
    Dec 2002
    Posts
    500
    Rep Power
    0

    Default

    Image.FromFile.. if u using .NET
    Cultured in Aggression and Koding like a Warrior!!
    “Common sense is instinct. Enough of it is genius.” - George Bernard Shaw.
    "The significant problems we face cannot be solved by the same level of thinking that created them." - Albert Einstein

  4. #4
    digimon Guest

    Default

    i prefer to use my own filestream as sometimes the image.fromfile does not close the file stream itself. so i close it with Fs.close()

Posting Permissions

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