CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 25 of 25

Thread: Flip Rectangle

  1. #16
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: Flip Rectangle

    If you check my signature, there's a link to the Crop & zoom thread.. It should give you all you the code you'll need to do the crop..

    Just you may want too keep track of the Min & max of X and Y, and pass them through to the crop code, so that is an automatic and not manual crop..
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  2. #17
    Join Date
    Apr 2004
    Posts
    265

    Re: Flip Rectangle

    Sorry, I checked the link and it's VB 6

    Thanks

  3. #18
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: Flip Rectangle

    Wait .. Hannes did a line of articles...

    I'll find the right one for you..
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  4. #19
    Join Date
    Jun 2005
    Location
    JHB South Africa
    Posts
    3,772

    Re: Flip Rectangle

    Ahh .. here we go

    Creating Your Own Drawing Application with Visual Basic .NET, Part 4

    And just in case there are links to the first three of the series in the article ...
    Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
    WPF Articles : 3D Animation 1 , 2 , 3
    Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
    Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
    All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.

  5. #20
    Join Date
    Apr 2004
    Posts
    265

    Re: Flip Rectangle

    Sorry again, that's not what I want. I drew an image in a picturebox with the image height as picturebox height and image width as picturebox width. The image is placed somewhere on the center of the picturebox. My intention is to scale the image to fit to the picturebox.

    Thanks

  6. #21
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: Flip Rectangle

    If you are using the height and width then the result should be the same size unless of course you are not using the same scale. twips <> pixels for example
    Always use [code][/code] tags when posting code.

  7. #22
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: Flip Rectangle

    Silly suggestion. Look at the SizeMode property. There are options to AutoFit the image or to Stretch the image.

    I really wish that one of my article can help you one day
    Last edited by HanneSThEGreaT; August 27th, 2011 at 01:40 AM.

  8. #23
    Join Date
    Apr 2004
    Posts
    265

    Re: Flip Rectangle

    Quote Originally Posted by HanneSThEGreaT View Post
    Silly suggestion. Look at the SizeMode property. There are options to AutoFit the image or to Stretch the image.

    I really wish that one of my article can help you one day
    That solved the issue. Thanks!!

  9. #24
    Join Date
    Apr 2004
    Posts
    265

    Re: Flip Rectangle

    Why don't I see anything in the picture box for this code?

    x = 266
    y = 14
    width = 134
    height = -14
    g = Graphics.FromImage(bit)
    g.DrawRectangle(myPen, x, 0 - (y + height), width, height)
    g.DrawString("Test", New Font("Tahoma", 8), Brushes.Black, x, y)
    myPen.Dispose()
    g.Dispose()

    Thanks

  10. #25
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: Flip Rectangle

    I do not see a reference to a picture box in the code
    Always use [code][/code] tags when posting code.

Page 2 of 2 FirstFirst 12

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

Featured