how flip the canvas vertically ?
-
hi all i draw a canvas on page in 2 row and 2 col format. now i want to flip vertically them, please help me how can i flip it on its same location. thanks in advance.
What have you tried? Where are you stuck? What help do you need?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony AntiTwitter: @DalekDave is now a follower!
-
hi all i draw a canvas on page in 2 row and 2 col format. now i want to flip vertically them, please help me how can i flip it on its same location. thanks in advance.
-
What have you tried? Where are you stuck? What help do you need?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony AntiTwitter: @DalekDave is now a follower!
bool Draw_Mirror_Image = checkBox_mirror_image.Checked;
bool Flip\_horz\_or\_vert = radioButton\_mirr\_img\_FV.Checked; //Flip\_horz\_or\_vert = false for flip horizontal // and = true for flip vertical StringFormat stringFormat = new StringFormat(); stringFormat.Alignment = StringAlignment.Center; stringFormat.LineAlignment = StringAlignment.Center; stringFormat.FormatFlags = StringFormatFlags.LineLimit; stringFormat.Trimming = StringTrimming.Word; RectangleF rect2 = panel2.ClientRectangle; float image\_draw\_wd = 200; float image\_draw\_ht = 100; int X = 0; int Y = 0; Brush myBrush = new SolidBrush(Color.FromArgb(128, Color.Blue)); int ROW=3; int COL=3; Pen pen = new Pen(Color.Red, 4); float Zoom\_Value = 100; float X\_SF = 1; float Y\_SF = 1; string draw\_text = "35"; Font draw\_text\_Font = new Font("Microsoft Sans Serif", 18, FontStyle.Bold); for (int r = 1; r <= ROW; r++) { X = 0; for (int cl = 1; cl <= COL; cl++) { draw\_text = "ROW : " + r.ToString() + "\\nCOL : " + cl.ToString(); Rectangle dr\_rect = new Rectangle(new Point(X, Y), new Size((int)image\_draw\_wd, ((int)image\_draw\_ht))); if (Draw\_Mirror\_Image) { if (Flip\_horz\_or\_vert == false) { //flip horz pe.ScaleTransform(-X\_SF, Y\_SF); //pe.TranslateTransform(-((X + image\_draw\_wd) \* (float)(Zoom\_Value / 100f)), 0); pe.TranslateTransform(-((image\_draw\_wd) \* (float)(Zoom\_Value / 100f)), 0); } else { //flip vert pe.ScaleTransform(X\_SF, -Y\_SF); //pe.TranslateTransform(0, -((Y + image\_draw\_ht) \* (float)(Zoom\_Value / 100f))); pe.TranslateTransform(0, -((image\_draw\_ht) \* (float)(Zoom\_Value / 100f))); } } pe.DrawString(draw\_text, draw