Click here to Skip to main content
15,885,214 members
Please Sign up or sign in to vote.
1.50/5 (2 votes)
See more:
Hi everyone :)

I have a question...

Let me explain it.

Code to draw texts:
for (int z = 0; z < base.CellNumber(); z++)
            {
                Rectangle rect = new Rectangle(((base.Hucreler[z].x / ScaleFactor -                   base.Hucreler[z].r / ScaleFactor)
                    * ZoomKontrolCarpan) / base.ZoomKontrolBolen, (base.Hucreler[z].y / ScaleFactor - base.Hucreler[z].r / ScaleFactor) *
                    ZoomKontrolCarpan / base.ZoomKontrolBolen, (2 * base.Hucreler[z].r / ScaleFactor) * ZoomKontrolCarpan / base.ZoomKontrolBolen
                    , (2 * base.Hucreler[z].r / ScaleFactor) * ZoomKontrolCarpan / base.ZoomKontrolBolen);
                g.DrawEllipse(Kalem, rect);
            }


This works great, draws cell ids.
What I want to do is to make mirror of the texts, because of I use
BitMap.RotateFlip(RotateFlipType.Rotate180FlipX)
code somewhere which takes the rotation of whole image and my texts seen like mirrored :/

Do you have any idea? Need Urgent help :/

My best Regards...
Posted
Updated 5-Jun-11 0:46am
v2

below code shows the given text and their mirror position in picture box.
Here i'm using System.Drawing.Drawing2D.Matrix class
C#
private void pictureBox1_Paint(object sender, PaintEventArgs e)
       {

           Graphics graphics = e.Graphics;
           graphics.DrawString("Ambarish!", Font, Brushes.Black, 0, 0);

           // Transform graphics and draw string again.
           graphics.MultiplyTransform(new Matrix(1, 0, 0, -1, 0, 40));
           graphics.DrawString("Ambarish!", Font, Brushes.Black, 0, 0);

           // Reset transform 
           graphics.ResetTransform();
       }


About Matrix Class[^]
 
Share this answer
 
v2
Comments
Un_NaMeD 5-Jun-11 8:42am    
Thank you it helped but the problem is the text I'm drawing is not in a sequence like that. They're placed according to some numbers that written in a text file. The code you send perfectly works for text in a same horizantal line. What about randomly placed ones? Because when they're placed randomly, the mirrar images placed according to their positions.
Sergey Alexandrovich Kryukov 5-Jun-11 17:25pm    
It does not matter! You got a transform which does the trick, that's all you need. Everything else is just for illustration.
Also, no one can ready your mind.
This is the answer; test it and then accept.
--SA
Un_NaMeD 5-Jun-11 18:35pm    
"test it and accept"
Are you the one who is judge here that commands who will accept what? :)
I've already thanked ambarishtv, gave my 5 and ask for another thing. He may or may not give an answer, why do you bother I don't get it :/
Sergey Alexandrovich Kryukov 5-Jun-11 23:23pm    
Don't be rude; nobody deny your right for your decision. You could consider my comment as a contribution to this answer. I tried to answer your "next thing". What didn't you get, anyway?
--SA
Un_NaMeD 6-Jun-11 4:22am    
I wasn't mean to be rude, if it is understood like that, it's just because of my bad English, my apologies. I just thought that I had to let well enough alone with that answer.
You have the position of the ellipse, and you have the text, which you can write with WriteString ( or DrawString, I forget ). So, where is the issue ?
 
Share this answer
 
Comments
Un_NaMeD 5-Jun-11 3:39am    
Oh my, is it that easy?
I searched, but could not find that function?
Un_NaMeD 5-Jun-11 6:38am    
I've changed the problem to another subject. I'm trying to take a mirror of the text. You have any suggestions?
turgayturhan 14-Jun-12 11:03am    
Hi Un_NaMeD, Could you find a solution to the problem? if the problem is resolved, you can help me, right? I am from Turkey. May be in Turkish.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900