Text size with transformed graphics

KIP
06-03-2006, 04:53 PM
I am working on a program to draw building floor plans. Since the size of the building can change and is always larger than the screen, I use a bitmap to draw the building and then set it to a picture box image. The user can then use buttons to zoom in and out on the image. The buttons use a translatetransform to scale the image in and out as well as moving it around.

Here's my problem: I want to add text to the image. When I do that, two things happen. First the text is an upside down mirror image. I think this is because I have transformed the coordinate system so that Y is up not the default down. Second, the size of the font is tiny.

Any ideas how to set the font size so that I have a "real" 12 point font regardless of the size of my bitmap? Also, is there a way to get the text oriented correctly without another transformation since I think that will mess up my image when other stuff is draw in after the text?

passel
06-03-2006, 07:59 PM
Since there are many ways to draw, many ways to transform, and many ways to do text, what ways are you using?
Is everything done through API functions, VB methods, a mix, or something else?
I assume if you are zooming the bitmap using stretchblt, then in order for the text not to be zoomed then it can't be part of the bitmap. Text would have to be a separate operation, applied to the display of the bitmap after the bitmap is transformed.

mkaras
06-04-2006, 08:37 PM
I am working on a program to draw building floor plans. Since the size of the building can change and is always larger than the screen, I use a bitmap to draw the building and then set it to a picture box image. The user can then use buttons to zoom in and out on the image. The buttons use a translatetransform to scale the image in and out as well as moving it around.

Here's my problem: I want to add text to the image. When I do that, two things happen. First the text is an upside down mirror image. I think this is because I have transformed the coordinate system so that Y is up not the default down. Second, the size of the font is tiny.

Any ideas how to set the font size so that I have a "real" 12 point font regardless of the size of my bitmap? Also, is there a way to get the text oriented correctly without another transformation since I think that will mess up my image when other stuff is draw in after the text?


Wouldn't a more versatile approach be to create lists of ojbects that get drawn each time the view window changes? Each object could be a list of relative vectors to the object origin. There are also a number of class constructions available that make collections of objects fairly painless. This approach makes the screen view adaptable to resolutions and makes printing to various sizes much nicer too. Stretching a bitmap to zoom in is a kind is a messy thing and certainly can go to pot when compressed to zoom out.

KIP
06-06-2006, 07:36 PM
Since there are many ways to draw, many ways to transform, and many ways to do text, what ways are you using?
Is everything done through API functions, VB methods, a mix, or something else?
I assume if you are zooming the bitmap using stretchblt, then in order for the text not to be zoomed then it can't be part of the bitmap. Text would have to be a separate operation, applied to the display of the bitmap after the bitmap is transformed.

I am using the VB methods like g.Translatetransform with a matrix for the instructions. I am placing the text with g.DrawString.

KIP
06-06-2006, 07:42 PM
Wouldn't a more versatile approach be to create lists of ojbects that get drawn each time the view window changes? Each object could be a list of relative vectors to the object origin. There are also a number of class constructions available that make collections of objects fairly painless. This approach makes the screen view adaptable to resolutions and makes printing to various sizes much nicer too. Stretching a bitmap to zoom in is a kind is a messy thing and certainly can go to pot when compressed to zoom out.

I'll be honest and tell you I'm not sure I understand what you are refering to with the object collection.
On the streching issue, when I change the bitmap, it is only to change the relative size of the bitmap. I then redraw the bitmap at the new scale. Since the number of objects is fairly small, I can do this on the fly without any speed issues.

passel
06-07-2006, 06:49 AM
I am using the VB methods like g.Translatetransform with a matrix for the instructions. I am placing the text with g.DrawString.

I'm not familiar with g.Translatetransform and g.DrawString.
So I did a quick search on the web, and it looks like those are .Net functions.

You've posted in the Legacy VB area of the forum.
You should have posted in the .Net side where people familiar with VB.Net might be able to help.

I'll ask a moderator to move this post to the .Net side of the forum.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum