473,324 Members | 2,257 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

pixel per Inch

Hi!

Is there anywhere a possibility to calculate the number of pixels/inch on
the current screen?

I have a Length. Now, i have to calculate, How many pixel this Length is on
the current screen.

Does anyone have an idea?

Thomas
Nov 15 '05 #1
2 4496
use the Bounds property of System.Windows.Forms.Screen class.

"Thomas Kehl" <t.kehl (at) heeb.com> wrote in message
news:ei**************@TK2MSFTNGP09.phx.gbl...
Hi!

Is there anywhere a possibility to calculate the number of pixels/inch on
the current screen?

I have a Length. Now, i have to calculate, How many pixel this Length is on the current screen.

Does anyone have an idea?

Thomas

Nov 15 '05 #2
If you have a Graphics object (eg from a PaintEventArgs), you can use the
DpiX and DpiY properties.

"Thomas Kehl" <t.kehl (at) heeb.com> wrote in message
news:ei**************@TK2MSFTNGP09.phx.gbl...
Hi!

Is there anywhere a possibility to calculate the number of pixels/inch on
the current screen?

I have a Length. Now, i have to calculate, How many pixel this Length is on the current screen.

Does anyone have an idea?

Thomas

Nov 15 '05 #3

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

Similar topics

4
by: grogerteal | last post by:
Hello, I am pretty new to programming and would like someone to help me get started on the program that I need to make. I hope it is not hard to do, but what I would like is a simple app that...
4
by: perspolis | last post by:
Hi all I have some points in twips measurement.how can I convert them to pixel measurement ? thanks
8
by: Rainer Queck | last post by:
Hi NG, in a dataset.datatable I have rows, containing metric data as doubles. I need to display/edit these values in textboxes depending on the culture (Metric/Inch). Is there something like a...
30
by: Chaos | last post by:
As my first attempt to loop through every pixel of an image, I used for thisY in range(0, thisHeight): for thisX in range(0, thisWidth): #Actions here for Pixel thisX, thisY But it takes...
4
by: Jimmy | last post by:
hi, all I attempt to use the function inch() to get the character at the current position, and compare it with a particular character like : if screen.inch(x,y) == 'F' but this method doesn't...
3
by: headware | last post by:
I have to create some vertical text for a web page that allows users to print to labels. We decided to do this by creating an <imgtag on the web page and having the src attribute point to another...
8
by: ofiras | last post by:
Hi, I made a "Paint" program, but I couldn't find a method to paint 1 pixel using graphic state ("Graphics g = Graphics.FromHwnd(this.Handle);") How can I paint 1 pixel? I guess I can make a...
1
by: ofiras | last post by:
In bitmap, how can I find the nearest pixel (pixel 1) to a specific pixel (pixel 2) that has different color from pixel 2? Or how can I find a pixel in a specific distance from pixel 2 (like a...
9
by: raylopez99 | last post by:
After refering to the below thread, I take it for C# Forms 2.0, there a way to draw a 1 pixel by 1 pixel rectangle, which I was able to do just now successfully. ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.