473,804 Members | 4,181 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Converting RectangleF to Rectangle

Hi

Is there any EASY way to convert RectangleF to a Rectangle object? Casting doesnt work, and it doesn't have a ToRectangle function or anything like that (although it should!

Thanks

Yaron
Nov 16 '05 #1
1 16724
Hi,
"Yaron" <an*******@disc ussions.microso ft.com> wrote in message
news:34******** *************** ***********@mic rosoft.com...
Hi,

Is there any EASY way to convert RectangleF to a Rectangle object? Casting doesnt work, and it doesn't have a ToRectangle function or anything like
that (although it should!)

See static method Round on Rectangle, it takes a RectangleF and returns a
Rectangle.

HTH,
greetings

Thanks!

Yaron

Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
528
by: João Santa Bárbara | last post by:
hi all i need to convert from rect to rectf .. how can i do this .. (VB.NET) thks JSB PS: i saw a sample in C# RectangleF TextRect; TextRect = (RectangleF)ClientRectangle;
2
2203
by: Jose Michael Meo R. Barrido | last post by:
I made a custom runded rectangle usercontrol. I used a function i found on the internet. the function works fine(see "GetRoundRect" below). I use the fullowing code to make my usercontrol rounded.... ***************************************************** Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs) Dim x1 As Integer = 0 Dim x2 As Integer = Me.ClientSize.Width Dim iHeight As Int32 = Me.Height Dim...
1
1561
by: Yaron | last post by:
Hi Is there any EASY way to convert RectangleF to a Rectangle object? Casting doesnt work, and it doesn't have a ToRectangle function or anything like that (although it should! Thanks Yaron
0
1267
by: B-Dog | last post by:
I'm using this class here http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnwinforms/html/printwinforms.asp to build a tabular print report and it works fine but when I try and add a rectangle to the page they brush stroke is huge, about .5 inch wide? The document is setup in inches but I don't know why these are showing up like this, nevers seen this happen. Here is the code I'm using below but there must be something...
5
4711
by: DazedAndConfused | last post by:
I have a rectangle around text that I want to fill in with color. I do not know the height of the rectangle until I actually go through and draw out the text. Is there a way of filling in the rectangle that will allow the text to show through? I did try: myColor = Color.FromArgb(127, Color.GreenYellow) Dim fillBrush As New SolidBrush(myColor) but that isn't exactly the effect I wanted.
1
6645
by: dishal | last post by:
Can anyone help me please? How do I convert these codes to launch from a JFrame instead of a Java Applet? A simple program where the user can sketch curves and shapes in a variety of colors on a variety of background colors. The user selects a drawing color form a pop-up menu at the top of the applet. If the user clicks "Set Background", the background color is set to the current drawing color and the drawing ...
4
2595
by: nothix9 | last post by:
Hello guys, Ive been working this for 2 days, I am required to position a string using drawstring but the problem is its dynamic and changes depending on the database or source. A quick fix I thought was to position it at the end of the report but its required at the middle of other entries. Can you give me tips and different approach how to programmatically adjust the height of the rectangle depending on the string it would need to write? ...
0
1888
by: MSwaffer | last post by:
When I run the following tests (In NUnit): public void ShouldOffsetRectangle() { RectangleF standAloneRect = new RectangleF(0, 0, 10, 10); standAloneRect.Offset(1, 1); Assert.AreEqual(1, standAloneRect.X, "standAlone failed"); }
4
12025
by: jbro | last post by:
hello, I'm trying to figure out how to add a ToolTip to a RectangleF, so when the user moves the mouse over the rectangle a tooltip with information regarding that rectangle will pop up. I hope someone out there knows how to do this. For example this is what I have: private void Form1_Paint (object sender, PaintEventArgs e) { Graphics g = e.Graphics; RectangleF r = new RectangleF(20.5, 20.3, 100.45, 200.68); ...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10575
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10330
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10319
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7616
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6851
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3816
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.