Click here to Skip to main content
15,896,118 members
Home / Discussions / C#
   

C#

 
AnswerRe: Stored Procedure Question Pin
J4amieC6-Jul-10 0:37
J4amieC6-Jul-10 0:37 
GeneralRe: Stored Procedure Question Pin
ddecoy6-Jul-10 1:25
ddecoy6-Jul-10 1:25 
GeneralRe: Stored Procedure Question Pin
J4amieC6-Jul-10 2:03
J4amieC6-Jul-10 2:03 
GeneralRe: Stored Procedure Question Pin
ddecoy6-Jul-10 2:15
ddecoy6-Jul-10 2:15 
GeneralRe: Stored Procedure Question Pin
Dave Kreskowiak6-Jul-10 3:40
mveDave Kreskowiak6-Jul-10 3:40 
QuestionMessage Removed Pin
5-Jul-10 21:34
Helfdane5-Jul-10 21:34 
AnswerRe: Hunting memory leaks Pin
Richard MacCutchan5-Jul-10 21:40
mveRichard MacCutchan5-Jul-10 21:40 
QuestionZoom Image problem... Pin
Nivas825-Jul-10 20:41
Nivas825-Jul-10 20:41 
Hi,

Have resize the image to fit the picture box (for other purpose). now i tried to zoom in the image and i succeed on it. but my problem is when i zoom the image the image get zoomed and image moves toward right.

if I use zero instead of c(in below code) the image placed at the left corner and when zoomed it starts from there. but i need to place the image in that particular location.

How can zoom the image without changing the position of the image.

Thanks in advance.
<br />
//sz1 = (800, 600)<br />
private Image resizeimage(Image my, Size sz1)<br />
        {<br />
            double ratio = 0d;<br />
            double myThumbWidth = 0d;<br />
            double myThumbHeight = 0d;<br />
            Bitmap bp;<br />
           int c;<br />
           int d;<br />
            <br />
                if ((my.Width / Convert.ToDouble(sz1.Width)) > (my.Height /<br />
                Convert.ToDouble(sz1.Height)))<br />
                    ratio = Convert.ToDouble(my.Width) / Convert.ToDouble(sz1.Width);<br />
                else<br />
                    ratio = Convert.ToDouble(my.Height) / Convert.ToDouble(sz1.Height);<br />
         <br />
            <br />
            myThumbHeight = Math.Ceiling(my.Height / ratio);<br />
            myThumbWidth = Math.Ceiling(my.Width / ratio);<br />
            Size thumbSize = new Size((int)myThumbWidth, (int)myThumbHeight);<br />
            bp = new Bitmap(sz1.Width, sz1.Height);<br />
            c = (sz1.Width - thumbSize.Width) / 2;<br />
            d = (sz1.Height - thumbSize.Height);<br />
            System.Drawing.Graphics g = Graphics.FromImage(bp);<br />
            g.SmoothingMode = SmoothingMode.HighQuality;<br />
            g.InterpolationMode = InterpolationMode.HighQualityBicubic;<br />
            g.PixelOffsetMode = PixelOffsetMode.HighQuality;<br />
            rect = new Rectangle(c, d, thumbSize.Width, thumbSize.Height);<br />
            g.DrawImage(my, rect, 0, 0, my.Width, my.Height, GraphicsUnit.Pixel);<br />
            if (f == false)<br />
            {<br />
                sz = bp.Size;<br />
                pictureBox1.Size = sz;<br />
            }<br />
            rect = new Rectangle(0, 0, 0, 0);<br />
            return (bp);<br />
// this will trigged when clicked on the picture box<br />
public void ZoomIn()<br />
        {<br />
            pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;<br />
            if (sz.Width >= c)<br />
                MessageBox.Show("Max ZoomIn");<br />
            else<br />
            {<br />
                sz.Width += 50;<br />
                sz.Height += 50;<br />
<br />
                pictureBox1.Size = sz;<br />
                pictureBox1.Invalidate();<br />
            }<br />
<br />

GeneralRe: Zoom Image problem... Pin
Nivas826-Jul-10 20:39
Nivas826-Jul-10 20:39 
QuestionCombo Box value set problem Pin
raju_shiva5-Jul-10 19:51
raju_shiva5-Jul-10 19:51 
AnswerRe: Combo Box value set problem Pin
Stanciu Vlad5-Jul-10 20:18
Stanciu Vlad5-Jul-10 20:18 
GeneralRe: Combo Box value set problem Pin
raju_shiva5-Jul-10 23:55
raju_shiva5-Jul-10 23:55 
QuestionSend Message in LAN Pin
ShafiqA5-Jul-10 19:49
ShafiqA5-Jul-10 19:49 
AnswerRe: Send Message in LAN Pin
Roger Wright5-Jul-10 20:07
professionalRoger Wright5-Jul-10 20:07 
GeneralRe: Send Message in LAN Pin
ShafiqA5-Jul-10 20:18
ShafiqA5-Jul-10 20:18 
GeneralRe: Send Message in LAN Pin
Richard MacCutchan5-Jul-10 21:46
mveRichard MacCutchan5-Jul-10 21:46 
GeneralRe: Send Message in LAN Pin
ShafiqA5-Jul-10 22:30
ShafiqA5-Jul-10 22:30 
GeneralRe: Send Message in LAN Pin
Richard MacCutchan6-Jul-10 1:41
mveRichard MacCutchan6-Jul-10 1:41 
GeneralRe: Send Message in LAN Pin
Roger Wright6-Jul-10 2:53
professionalRoger Wright6-Jul-10 2:53 
QuestionUsing FFMpeg with C# .NET Pin
sridharv865-Jul-10 18:42
sridharv865-Jul-10 18:42 
AnswerRe: Using FFMpeg with C# .NET Pin
Peace ON5-Jul-10 22:12
Peace ON5-Jul-10 22:12 
Questionerror in combobox databinding Pin
swtlibra5-Jul-10 17:54
swtlibra5-Jul-10 17:54 
AnswerRe: error in combobox databinding Pin
thatraja5-Jul-10 18:27
professionalthatraja5-Jul-10 18:27 
GeneralRe: error in combobox databinding Pin
swtlibra5-Jul-10 18:53
swtlibra5-Jul-10 18:53 
QuestionQuick app.config question Pin
Megidolaon5-Jul-10 12:24
Megidolaon5-Jul-10 12:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.