Results 1 to 6 of 6

Thread: Rotating Controls in VB.NET

  1. #1
    Join Date
    Feb 2010
    Posts
    531

    Rotating Controls in VB.NET

    Hi all,

    I am third year engineering graduate. I working on project in VB.Net. I want to know that how to do an arbitrary rotation angle of the front? Because i did not find any rotating control in VB.NET 2003 version. Please suggest. Thanks in advance.

  2. #2
    Join Date
    Feb 2008
    Posts
    1,852

    Rotating Controls in VB.NET

    I will giv eyou the example that using Rotating Controls in VB.NET. I am also used these coding in my project and its worked.

    Code:
    usingSystem;
    usingSystem.Collections.Generic;
    usingSystem.ComponentModel;
    usingSystem.Data;
    usingSystem.Drawing;
    usingSystem.Text;
    usingSystem.Windows.Forms;
    
    namespaceWindowsApplication3
     {
       publicpartial classForm22: Form
        {
             publicForm22 ()
            {
     Initialize Component ();
             }
    
              private voidbutton1_Click (objectsender, EventArgs e)
            {
              using(Bitmap bmp = newBitmap (@"d: \ My Documents \ Desktop \ ico \ watermark123.bmp"))
               {
     Graphics g = this. CreateGraphics ();
     Rectangle rect = newRectangle (0, 0, 100, 100);
     bmp.RotateFlip (RotateFlipType.RotateNoneFlipX);
     g.DrawImage123 (bmp, rect);
                 }
             }
    
           
         }
    }

  3. #3
    Join Date
    May 2008
    Posts
    2,297

    Rotating Controls in VB.NET

    I using these code. Please check.

    Code:
    public static Bitmap KitRotate90 (Bitmap img)
      (
                try
                 (
                    img.RotateFlip (RotateFlipType.Rotate90FlipNone);
                    return img123;
                )
                catch
              (
                    return null;
                )
            )
    It is easy to be seen, the key is RotateFlip Type parameters. Practice results are as follows: Rotated 90 degrees clockwise. RotateFlipType.Rotate90FlipNone
    Rotate 90 degrees RotateFlipType.Rotate270FlipNone
    Flip Horizontal RotateFlipType.Rotate180FlipY
    Flip Vertical RotateFlipType.Rotate180FlipX

  4. #4
    Join Date
    May 2008
    Posts
    2,389

    Re: Rotating Controls in VB.NET

    Of course, and BCB itself is the design of the set of graphical components are closely related. Graphic VCL components encapsulates WINDOWS Graphics Device Interface (GUI), makes the WINDOWS program design has become very easy to add graphics. BCB is indeed a very good design! Its intention is to graphic VCL components designed into three levels: At the highest level: Draw lines and shapes, such as: MoveTo, LineTo, Rectangle, and Ellipse. The output and control the text, for example: TextOut, TextHeight, TextWidth, and TextRect. Filled shapes, such as: FillRect and FloodFil. Middle: Custom output text and graphics, by controlling the following attributes: Pen, Brush, and Font, Pixels. Replication, and merge graphics, for example: Draw, StretchDraw, BrushCopy, and Copy Rect methods; Copy Mode property. Check and reply.

  5. #5
    Join Date
    Oct 2005
    Posts
    2,393

    Re: Rotating Controls in VB.NET

    There are several ways to code, but are generally drawn characters.
    (1) If the simple point directly to DRAWSTRING method of drawing with the GRAPHICS.
    (2) If you want a complex points can add some miscellaneous points, set in different colors, rotate canvas and then draw (gradient), using different fonts, etc.
    (3) If the code is too complex and do not want to, you can use character code to identify up to be more complex, if you re-use the words of different fonts.

  6. #6
    Join Date
    Nov 2005
    Posts
    1,323

    Rotating Controls in VB.NET

    You sure that you want to do N-character code in order to obtain the overall size of the code image (SIZE * 1.X) where X is used for scaling and adapt to different fonts, as well as rotating tilt reserved space, and SIZE can be drawn Maximum characters used to determine the length of the diagonal in the GRAPHICS ways there are to test the size needed to draw characters, of course, the largest generation of space needed depends on the two functions. Check and reply.

Similar Threads

  1. Rotating MP4 Mobile Video by 90 Degrees
    By JAMIN in forum Windows Software
    Replies: 4
    Last Post: 26-04-2012, 08:27 PM
  2. Rotating Cylinders
    By zbathich in forum Software Development
    Replies: 2
    Last Post: 26-04-2011, 04:18 AM
  3. How to have rotating images on my website?
    By GlassFish in forum Software Development
    Replies: 3
    Last Post: 06-11-2009, 09:37 AM
  4. Rotating a video landscape to portrait
    By Caddo in forum Operating Systems
    Replies: 4
    Last Post: 25-04-2009, 12:46 PM
  5. Need portrait mode rotating monitors
    By Ebadaah in forum Hardware Peripherals
    Replies: 3
    Last Post: 19-03-2009, 11:58 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,647,709.85073 seconds with 17 queries