Page 1 of 2 12 LastLast
Results 1 to 40 of 41

Thread: *RESOLVED* Cant resize an image "correctly"

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    Thumbs up *RESOLVED* Cant resize an image "correctly"

    I dont get this, when I resize an image, .NET modifies the image and "smooths" it. I dont want it to do so!
    This is a small picture, resized with my app and with mspaint, see the difference:



    I want my program to resize the image just like MS Paint would do it. Right now, when I resize the picturebox, .NET makes the image smooth or whatever, you can see. How can I do what mspaint does?
    I tried the DrawImage class and I also tried to resize the image by setting the sizeMode to stretch. Both work the same way

    help plz
    Attached Images Attached Images  
    Last edited by MrPolite; Sep 26th, 2002 at 03:30 PM.
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  2. #2

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    *bump*
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  3. #3
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    I have this C# code from one of my projects. You can probably adapt it to meet your needs:
    Code:
    private void ZoomIn()
    {
    	//Code here zooms in on the current picture
    	Bitmap pic = new Bitmap(thumbPanel.CurrentThumbPath); //This is the file path.
    	int ix;
    	int iy;
    	int iZoomRate = 100;
    			
    	if (viewAreaPic.Width > viewAreaPic.Height)
    	{
    		ix = viewAreaPic.Width + iZoomRate;
    		iy = (viewAreaPic.Width + iZoomRate) * viewAreaPic.Height / viewAreaPic.Width;
    	}
    	else
    	{
    		iy = viewAreaPic.Height + iZoomRate;
    		ix = (viewAreaPic.Height + iZoomRate) * viewAreaPic.Width / viewAreaPic.Height;
    	}
    
    	pic = (Bitmap)(pic.GetThumbnailImage(ix, iy, null, (IntPtr)0));
    	viewAreaPic.SizeMode = PictureBoxSizeMode.AutoSize;
    	viewAreaPic.Image = pic;
    }
    
    private void ZoomOut()
    {
    	Bitmap pic = new Bitmap(thumbPanel.CurrentThumbPath);  //This is the file path.
    	int ix;
    	int iy;
    	int iZoomRate = -100;
    			
    	if (viewAreaPic.Width > viewAreaPic.Height)
    	{
    		ix = viewAreaPic.Width + iZoomRate;
    		iy = (viewAreaPic.Width + iZoomRate) * viewAreaPic.Height / viewAreaPic.Width;
    	}
    	else
    	{
    		iy = viewAreaPic.Height + iZoomRate;
    		ix = (viewAreaPic.Height + iZoomRate) * viewAreaPic.Width / viewAreaPic.Height;
    	}
    			
    	pic = (Bitmap)(pic.GetThumbnailImage(ix, iy, null, (IntPtr)0));
    	viewAreaPic.SizeMode = PictureBoxSizeMode.AutoSize;
    	viewAreaPic.Image = pic;
    }

  4. #4

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    hmm, do you get a different result hellswraith?
    I tried your code, and I get the same result. I did this:

    picImage.SizeMode = PictureBoxSizeMode.AutoSize
    picImage.Image = picImage.Image.GetThumbnailImage(newWidth, newHeight, Nothing, IntPtr.Zero)


    Resizes the picture in the same way. Basically if I set the sizeMode to Stretch and then I just resize the picturebox, I get the exact same result.

    Am I using your code correctly?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  5. #5
    Member Aerials's Avatar
    Join Date
    Jul 2002
    Location
    Chile
    Posts
    50
    Hmm does it do the same when u make it larger?

  6. #6

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by Aerials
    Hmm does it do the same when u make it larger?
    well, the picturebox's size is getting bigger as I'm zooming in it. Just like you would zoom in a picture in mspaint, but here I'm getting a weird result
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  7. #7
    Fanatic Member siyan's Avatar
    Join Date
    Jul 2001
    Location
    GOOOAAAAALLLLL!!!!!
    Posts
    869
    MrPolite, coudl you possibly pass along your code? reason is here: http://www.vbforums.com/showthread.p...hreadid=194635

    -C

  8. #8

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by siyan
    MrPolite, coudl you possibly pass along your code? reason is here: http://www.vbforums.com/showthread.p...hreadid=194635

    -C
    well, you can just simply set the SizeMode property of your picturebox to PictureBoxSizeMode.StretchImage and then just change the hight and width of the picturebox. I just dont like the way it resizes it.

    If you do the above method, it wont resize the real image inside, it will just show the resized image. (for example if you save PictureBox.Image to a file, it will be saved with its original size and not with the resized size). If you want the REAL image inside the picturebox to be resized then you could do this:

    VB Code:
    1. Dim gr As Graphics = picBox.CreateGraphics()
    2. Dim tmpImage As Image = picBox.Image
    3.  
    4. ' Clear the image
    5. gr.Clear(picBox.BackColor)
    6.  
    7. picBox.SizeMode = PictureBoxSizeMode.AutoSize
    8. gr.DrawImage(tmpImage, 0, 0, newWidth, newHeight)

    I'm not that good in VB.NET, so my way might not be the best way for this, but it works. (meh, you guys post your code if you know a better way)
    umm and btw I havent tested that code




    Now someone plz help ME!!
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  9. #9

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    anyone?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  10. #10
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    happened the same to me

  11. #11

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    well, it sucks but there should be a way to do this correctly!!!!! (well, besides using an API)
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  12. #12
    Hyperactive Member
    Join Date
    Feb 2002
    Posts
    261
    Alright. I'm making a game, in which I need the exact same functionality.

    Here's what I'm using:

    Dim imgImage1 as Image
    Dim imgImage2 as Image

    'Actually, I use the Bitmap object, but Bitmap is inherited from Image, so it works exactly the same

    'Make imgImage1 = the graphic you want to stretch

    'Make imgImage2 = a blank image of the same resolution you want to stretch imgImage1 to

    Dim G as Graphics = Graphics.FromImage(imgImage2)
    G.DrawImage(imgImage1, New Rectangle(0, 0, <your width>, <your height>))

    Basically, the DrawImage function will re-draw imgImage1 on imgImage2 and stretch it to the boundaries of the specified Rectangle object.

    Maybe I need to visit these forums more often.

  13. #13

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by Hu Flung Dung
    Alright. I'm making a game, in which I need the exact same functionality.

    Here's what I'm using:

    Dim imgImage1 as Image
    Dim imgImage2 as Image

    'Actually, I use the Bitmap object, but Bitmap is inherited from Image, so it works exactly the same

    'Make imgImage1 = the graphic you want to stretch

    'Make imgImage2 = a blank image of the same resolution you want to stretch imgImage1 to

    Dim G as Graphics = Graphics.FromImage(imgImage2)
    G.DrawImage(imgImage1, New Rectangle(0, 0, <your width>, <your height>))

    Basically, the DrawImage function will re-draw imgImage1 on imgImage2 and stretch it to the boundaries of the specified Rectangle object.

    Maybe I need to visit these forums more often.
    well I've tried the DrawImage method, I dont think your code would result in anything different.... I'll try it though
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  14. #14

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    nope, same problem
    I didnt say I want to know how to resize an Image. My problem is that the image isnt resized correctly, the way I want it to be
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  15. #15
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    I think you reason why the resized image is being smoothed out is because it is being antialiased.

    Try to play around with the antialiased property and see if that works.

    Good luck
    Dont gain the world and lose your soul

  16. #16
    Member Aerials's Avatar
    Join Date
    Jul 2002
    Location
    Chile
    Posts
    50
    Good point Dev
    I think you're right
    try it P

  17. #17

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by DevGrp
    I think you reason why the resized image is being smoothed out is because it is being antialiased.

    Try to play around with the antialiased property and see if that works.

    Good luck
    where can I find that?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  18. #18
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    I'll try to figure something out when I get home.

    BTW It would help if you posted some code for me to work with.

    Later
    Dont gain the world and lose your soul

  19. #19

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by DevGrp
    I'll try to figure something out when I get home.

    BTW It would help if you posted some code for me to work with.

    Later
    umm same code that I posted before...

    VB Code:
    1. Dim gr As Graphics = picBox.CreateGraphics()
    2. Dim tmpImage As Image = picBox.Image
    3.  
    4. gr.Clear(picBox.BackColor)
    5.  
    6. picBox.SizeMode = PictureBoxSizeMode.AutoSize
    7. gr.DrawImage(tmpImage, 0, 0, newWidth, newHeight)
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  20. #20
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    Hey, Sorry I took so long to reply. Anyway, I did'nt try the antialias mode with your code, because I needed more to work with. However I did try something else and It worked perfect. The code will resize and save the image to a format of your choice.

    Source and program is attached.
    It is in C# but I can convert it to VB.NET if you want.

    Good luck.

    Code:
    System.Drawing.Size sz = new System.Drawing.Size();
    			sz.Width = int.Parse(txtWidth.Text);
    			sz.Height = int.Parse(txtHeight.Text);
    			
                Image tempImage = picBox.Image;
    			Bitmap b = new Bitmap(tempImage, sz);
    			picBox.Image = b;
    			lblHeight.Text = b.Height.ToString();
    			lblWidth.Text = b.Width.ToString();
    			b.Save(@"newimage.jpg",System.Drawing.Imaging.ImageFormat.Jpeg);
    Attached Files Attached Files
    Dont gain the world and lose your soul

  21. #21
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    zip damaged?

  22. #22
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    Try again PT, I just downloaded it and it worked fine.

    I'm using WinRar to extract it.
    Dont gain the world and lose your soul

  23. #23

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    hey DevGrp, thanks for your help but still the same problem
    It DOES resize the image, so does my code.... but I'm still getting the same result: when the image is resized, it gets blury

    and yes I know, this is not noticable if you have a picture of something and you are resizing it a little bit. But if you have a very small picture which is made of some basic lines, it's gunno look very ugly when you resize it (see the picture in the first post)

    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  24. #24
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    Did you use the code I posted? Because I tried my program with the pictures that you posted, and when I resize it, it comes out ok. Its not blurry. I increase and decrease the size and its not blurry.
    Dont gain the world and lose your soul

  25. #25

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by DevGrp
    Did you use the code I posted? Because I tried my program with the pictures that you posted, and when I resize it, it comes out ok. Its not blurry. I increase and decrease the size and its not blurry.
    yes I used your code.... the original picture that I used is this :

    and the RESULT is the one that you see in the first post

    try using this image and try resizing it to something like 500x500 pixels and you'll see that it gets blury
    Attached Images Attached Images  
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  26. #26
    Frenzied Member DevGrp's Avatar
    Join Date
    Nov 2001
    Location
    Charlotte, NC
    Posts
    1,256
    I'll see what I can do.
    Dont gain the world and lose your soul

  27. #27

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by DevGrp
    I'll see what I can do.
    I was trying to avoid any APIs, because they THINK .NET can do EVERYTHING, but sounds like it's not always true.....


    tnx for your help I hope you can find a way
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  28. #28
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    yea...the zip is ok the problem is that windows unzipper in xp SUCKS

  29. #29
    Fanatic Member Slaine's Avatar
    Join Date
    Jul 2002
    Posts
    641
    I think the problem is because .net is 'resampling' the picture to increase the size, whereas in paint you are just zooming into a view and all it does is show you an enlarged view of the pixels.

    To remdy this you need to build your own resampling routine that will iterate throught the image you wish to resize and build a new image based on the pixel information.

    So say for example your original image is 2 pixels wide by 2 pxels deep as below:

    Code:
    ox
    xo
    
    x = black pixel
    o = white pxel

    Then you would have a loop something like

    Code:
    For x = 1 to 2
        for y = 1 to 2
            if pixel(x,y) = black then
                draw a black box in new image
            else
                 draw a white box in new image
            end if.
        next y
    next x
    This is greatly simplyfied but say you are wanting to zoom in 500% then you are aming to draw a new image that looks like the following:

    Code:
    oooooxxxxx
    oooooxxxxx
    oooooxxxxx
    oooooxxxxx
    oooooxxxxx
    xxxxxooooo
    xxxxxooooo
    xxxxxooooo
    xxxxxooooo
    xxxxxooooo
    ie: you are examining each pixel in the original image and drawing a larger version of it (based on the scaling factor) in the new image.

    I imagine the resizing code behind the .net picture box is doing just this but that it has an antialiasing/resampling procedure built in. I doubt that you can switch this off so the only way to do what you want is to do it manually as above.

    Initially it is probably a lot more work to get the thing implemented but if you stick it in a procedure you would be able to use it anywhere.

    Hope this is of help.
    Martin J Wallace (Slaine)

  30. #30
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    ....

  31. #31

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Thanks Slaine making a function of my own would be a little hard I guess or rather SLOW
    also I want a function that will change the picture's size to the specified height and width (stretch the picture).... making a function like this is kinda hard...

    So how should I use an API in .NET? I guess I should stick with bitblt/stretchblt
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  32. #32
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    bah one of the reasons i moved to .NET was that..to NOT use API's ... or try to avoid to ... :|

  33. #33
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Here is some C# code you can convert. I use this code to scale images to fit in the viewing area of my app so you can see the whole picture. It seems to do a good job. Maybe it will work for you. Other than something like this...I don't know what to tell you.
    Code:
    private void ScaleImageToFit(string filename)
    {
       // This will take in a file path, figure out the available view
       // area, then make the passed in picture fit that area.
       Bitmap pic = new Bitmap(filename);
    
       // Get the size of the pic.
       SizeF sizef = new SizeF(pic.Width / pic.HorizontalResolution, pic.Height / pic.VerticalResolution);
    
       // Figure out the scale based on orientation of the pic.
       float fScale = Math.Min(viewArea.Width / sizef.Width, viewArea.Height / sizef.Height);
    
       // Subtract from the scale so the scroll bars don't appear.
       fScale -= 0.2f;
    
       // Get the size of the image after scale.
       sizef.Width *= fScale;
       sizef.Height *= fScale;
    
       // Set the size of the view area.
       viewAreaPic.Width = (int)sizef.Width;
       viewAreaPic.Height = (int)sizef.Height;
    			
       // Let the pic fill the view area since it is now resized
       // to the proper size.
       viewAreaPic.Image = pic;
    }

  34. #34
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    You may also want to pass this hint in to the Graphics object with your code:
    g.SmoothingMode = SmoothingMode.HighQuality

    There are a few other smoothing modes. My guess is you probably want high quality, not antialiased.

    Good luck.

  35. #35

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by hellswraith
    You may also want to pass this hint in to the Graphics object with your code:
    g.SmoothingMode = SmoothingMode.HighQuality

    There are a few other smoothing modes. My guess is you probably want high quality, not antialiased.

    Good luck.
    THANK YOU!!!!



    Finally it worked!I didnt think there is a way to change these stuff! aaah what a fool I am!!!

    this did the work:
    gr.InterpolationMode = InterpolationMode.NearestNeighbor



    thanks again!
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  36. #36
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    hehe excelent

  37. #37
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Welcome. Every time I read this post I didn't realize what you were asking. Sorry I didn't get you pointed in that direction from the beginning.

  38. #38

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by hellswraith
    Welcome. Every time I read this post I didn't realize what you were asking. Sorry I didn't get you pointed in that direction from the beginning.
    oh well, my english is quite messed up. It's hard to explain
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  39. #39

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    aah I had another problem! if anyone wants to do this, remember to do this too:
    gr.PixelOffsetMode = PixelOffsetMode.Half
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  40. #40
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    hmm im having problems implementing that in a asp.net page im doing(it's in C#):

    PHP Code:
    Bitmap bm = new Bitmap(Server.MapPath(@"Deviantart\labyrinthine.jpg"));
    Bitmap bit = new Bitmap(1,1);
    System.Drawing.Image thumbnail bit;
    Graphics g Graphics.FromImage(thumbnail);
    g.CompositingQuality System.Drawing.Drawing2D.CompositingQuality.HighQuality;
    g.PixelOffsetMode System.Drawing.Drawing2D.PixelOffsetMode.Half;
    thumbnail bm.GetThumbnailImage(widthheight, new System.Drawing.Image.GetThumbnailImageAbort(Thumbnail), IntPtr.Zero);

    Response.ContentType "image/jpeg";
    thumbnail.Save(Response.OutputStreamImageFormat.Jpeg); 
    hmm...do u think the best way is using the GetThumbnail() function or manually resizing them(if yes then how? i didnt found a way of doing so)?
    \m/\m/

Page 1 of 2 12 LastLast

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