Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 311301
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T07:54:44+00:00 2026-05-12T07:54:44+00:00

I am using webservice to call method in businesslogics(one class written in vb).I am

  • 0

I am using webservice to call method in businesslogics(one class written in vb).I am getting inputppath and path to where i have to save image in that method.I have to create thumbnail and also i have to save original image.Means i want to save masterimage in one folder and its thumnail in different folder. I used following code

Public Function CreateThumbNails(ByVal intWidth As Integer, ByVal strInputFilePath As String, ByVal strFileName As String, ByVal strOutputFilePath As String) As String
            Dim lnWidth As Integer = intWidth
            Dim lnHeight As Integer = 100
            Dim bmpOut As System.Drawing.Bitmap = Nothing
            Try
                Dim loBMP As New Bitmap(strInputFilePath)
                Dim lnRatio As Decimal
                Dim lnNewWidth As Integer = 0
                Dim lnNewHeight As Integer = 0
                If loBMP.Width < lnWidth AndAlso loBMP.Height < lnHeight Then
                    lnNewWidth = loBMP.Width
                    lnNewHeight = loBMP.Height
                End If
                If loBMP.Width > loBMP.Height Then
                    lnRatio = CDec(lnWidth) / loBMP.Width
                    lnNewWidth = lnWidth
                    Dim lnTemp As Decimal = loBMP.Height * lnRatio
                    lnNewHeight = CInt(lnTemp)
                Else
                    lnRatio = CDec(lnHeight) / loBMP.Height
                    lnNewHeight = lnHeight
                    Dim lnTemp As Decimal = loBMP.Width * lnRatio
                    lnNewWidth = CInt(lnTemp)
                End If

                ' *** This code creates cleaner (though bigger) thumbnails and properly
                ' *** and handles GIF files better by generating a white background for
                ' *** transparent images (as opposed to black)

                bmpOut = New Bitmap(lnNewWidth, lnNewHeight)
                Dim g As Graphics = Graphics.FromImage(bmpOut)
                g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.HighQualityBicubic
                g.FillRectangle(Brushes.White, 0, 0, lnNewWidth, lnNewHeight)
                g.DrawImage(loBMP, 0, 0, lnNewWidth, lnNewHeight)
                loBMP.Dispose()
                bmpOut.Save(HttpContext.Current.Server.MapPath(strOutputFilePath) + strFileName)
                bmpOut.Dispose()

                Return strOutputFilePath + strFileName
            Catch e As Exception

                Throw New Exception("ThumbNail Creation Failed")
                Return ""
            End Try
        End Function

What code i have to include to save original size image in another folder.Can anybody help?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T07:54:45+00:00Added an answer on May 12, 2026 at 7:54 am

    EDIT trigger happy. you don’t need to save it from the bitmap. the file is already there. just copy the file.

    If I understand your question then you want to save the image from before you manipulate it to a new location on the server.

    That file already exists as a file on the server. The file location of that file is passed into your function as a parameter (strInputFilePath).

    The simplest thing to do would to use File.Copy() to copy the file to the desired location.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting this error. When i call the c# WebService using HttpWebRequest .
I have a method (getAllTeams:) that initiates an HTTP request using the ASIHTTPRequest library.
I am trying to call a webservice using WCF that uses the following encoding:
I have an ASP.NET webservice method that returns a generics list (List'<'Construct>) serialized as
I wrote some service that have method that get image ( byte[] ) as
I have a webservice with a method in it. I can call it fine
Hi I am trying to call a webService in titanium using json. That webService
I am trying to call a webservice using ssl. How do i get the
I'm using glassfish 2.1.1. I've watched a mysterious http/webservice-call handling. It seams an http
I'm trying to call a php webservice using WCF. I googled some public php

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.