Click here to Skip to main content
15,902,938 members
Home / Discussions / C#
   

C#

 
AnswerRe: .exe update Pin
Peace ON12-Jul-10 22:19
Peace ON12-Jul-10 22:19 
QuestionWrite application version and installation path to registry Pin
sumit703412-Jul-10 21:11
sumit703412-Jul-10 21:11 
AnswerRe: Write application version and installation path to registry Pin
Peace ON12-Jul-10 21:46
Peace ON12-Jul-10 21:46 
GeneralRe: Write application version and installation path to registry Pin
sumit703412-Jul-10 22:32
sumit703412-Jul-10 22:32 
AnswerRe: Write application version and installation path to registry Pin
Peace ON12-Jul-10 22:39
Peace ON12-Jul-10 22:39 
Questionproblem in occurs in win 7 Pin
prasadbuddhika12-Jul-10 20:22
prasadbuddhika12-Jul-10 20:22 
AnswerRe: problem in occurs in win 7 Pin
Corinna John12-Jul-10 21:13
Corinna John12-Jul-10 21:13 
QuestionHow to resize the drwan rectangle when zoomin the image in the picture box? [modified] Pin
Nivas8212-Jul-10 18:21
Nivas8212-Jul-10 18:21 
drawn an rectangle on the image using picture box.

quires

1. when tried to zoom image the drawn rectangles needs to be placed on the drawn area.
2. Also draw another rectangle (in zoomed mode).
3. when i zommed out the rectangle needs to resized.

How can i achieve this.

I achieved this by using graphics.drawrectangle but i don't want to draw rectangle on the image because it's stay permanently on the image.


Please help on this......

//getting size of picture box in sz1
public void ZoomIn()
        {
            //pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
            if (sz1.Width >= 800 * 6)
                MessageBox.Show("Max ZoomIn");
            else
            {
                sz1.Width += 100;
                sz1.Height += 100;
                pictureBox1.Size = sz1;
                
                pictureBox1.Invalidate();
            }
            

        }

private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
        {
            
                

                if (mybitmap == null)
                {
                    mybitmap = new Bitmap(pictureBox1.Image.Width, pictureBox1.Image.Height);
                    mybitmap.SetResolution(300, 300);
                }


                    rect = new Rectangle(e.X, e.Y, 0, 0);
                    pictureBox1.Invalidate();

           

        }




private void pictureBox1_Paint(object sender, PaintEventArgs e)
        {
            

                if (mybitmap == null)
                {
                    return;
                }

                
                    
                    using (Pen pen = new Pen(Color.Green, 2))
                    {
                       
                        
                            foreach (Rectangle r in rectangles)
                            {
                                e.Graphics.DrawRectangle(pen, r);

                                e.Graphics.DrawString(lab[c].ToString(), new Font(lab[c].ToString(), 8F), new SolidBrush(label1.ForeColor), r);
                                

                            }

                            
                    }
       
        }


modified on Tuesday, July 13, 2010 4:15 AM

AnswerRe: How to resize the drwan rectangle when zoomin the image in the picture box? Pin
R. Giskard Reventlov12-Jul-10 21:27
R. Giskard Reventlov12-Jul-10 21:27 
GeneralRe: How to resize the drwan rectangle when zoomin the image in the picture box? Pin
Nivas8212-Jul-10 22:12
Nivas8212-Jul-10 22:12 
GeneralRe: How to resize the drwan rectangle when zoomin the image in the picture box? Pin
PaulPrice12-Jul-10 22:21
PaulPrice12-Jul-10 22:21 
GeneralRe: How to resize the drwan rectangle when zoomin the image in the picture box? [modified] Pin
Nivas8212-Jul-10 22:26
Nivas8212-Jul-10 22:26 
AnswerRe: How to resize the drwan rectangle when zoomin the image in the picture box? Pin
Nivas8226-Jul-10 0:22
Nivas8226-Jul-10 0:22 
QuestionInlined Code Question Pin
Richard Blythe12-Jul-10 14:27
Richard Blythe12-Jul-10 14:27 
AnswerRe: Inlined Code Question Pin
Not Active12-Jul-10 14:36
mentorNot Active12-Jul-10 14:36 
AnswerRe: Inlined Code Question Pin
PIEBALDconsult12-Jul-10 17:40
mvePIEBALDconsult12-Jul-10 17:40 
GeneralRe: Inlined Code Question Pin
Richard Blythe13-Jul-10 4:59
Richard Blythe13-Jul-10 4:59 
GeneralRe: Inlined Code Question Pin
PIEBALDconsult13-Jul-10 17:43
mvePIEBALDconsult13-Jul-10 17:43 
AnswerRe: Inlined Code Question Pin
harold aptroot13-Jul-10 5:16
harold aptroot13-Jul-10 5:16 
GeneralRe: Inlined Code Question Pin
Richard Blythe13-Jul-10 5:31
Richard Blythe13-Jul-10 5:31 
QuestionHow can I make a self updating application - specifically a plug-in - via C#? Pin
euroazn12-Jul-10 7:40
euroazn12-Jul-10 7:40 
AnswerRe: How can I make a self updating application - specifically a plug-in - via C#? Pin
ramzg12-Jul-10 9:47
ramzg12-Jul-10 9:47 
AnswerRe: How can I make a self updating application - specifically a plug-in - via C#? Pin
Not Active12-Jul-10 11:47
mentorNot Active12-Jul-10 11:47 
Question.NET IL Code Pin
I Believe In GOD12-Jul-10 7:22
I Believe In GOD12-Jul-10 7:22 
AnswerRe: .NET IL Code PinPopular
DaveyM6912-Jul-10 7:25
professionalDaveyM6912-Jul-10 7:25 

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.