473,395 Members | 1,574 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,395 software developers and data experts.

Bitmap class problem

TCR
Hi,
I'm using the Image.FromImage() function to load a jpg file into a bitmap
class and then convert it to a lower resolution. The problem I'm having is
that if I check the resolution of the image using either of the properties
(Horizontal or Vertical), it reports it as 72 dpi when in fact they are 300
dpi. Is this a known bug? For example I have an image that is 1200 X 1600
pixels at 300 dpi but when I load it into the bitmap class it reports the
width and height correctly in pixels but not the resolution.
Any help would be greatly appreciated,
Troy Reagan
Nov 16 '05 #1
2 1647
TCR wrote:
Hi,
I'm using the Image.FromImage() function to load a jpg file into a bitmap
class and then convert it to a lower resolution. The problem I'm having is
that if I check the resolution of the image using either of the properties
(Horizontal or Vertical), it reports it as 72 dpi when in fact they are 300
dpi. Is this a known bug? For example I have an image that is 1200 X 1600
pixels at 300 dpi but when I load it into the bitmap class it reports the
width and height correctly in pixels but not the resolution.
Any help would be greatly appreciated,
Troy Reagan


Try importing the image from file like this. See if that makes any
difference.

Bitmap myBitmap = new Bitmap("filename");
Nov 16 '05 #2
TCR
Unfortunately, I tried that and the results were the same. I'll keep
looking but if anyone else has another suggestion, I would appreciate it.
TCR
"Nick" <pa*****@optonline.net> wrote in message
news:LW********************@news4.srv.hcvlny.cv.ne t...
TCR wrote:
Hi,
I'm using the Image.FromImage() function to load a jpg file into a bitmap class and then convert it to a lower resolution. The problem I'm having is that if I check the resolution of the image using either of the properties (Horizontal or Vertical), it reports it as 72 dpi when in fact they are 300 dpi. Is this a known bug? For example I have an image that is 1200 X 1600 pixels at 300 dpi but when I load it into the bitmap class it reports the width and height correctly in pixels but not the resolution.
Any help would be greatly appreciated,
Troy Reagan


Try importing the image from file like this. See if that makes any
difference.

Bitmap myBitmap = new Bitmap("filename");

Nov 16 '05 #3

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

Similar topics

11
by: Prashant | last post by:
Hi, I have a huge problem. I have a data file which looks something like this -: ..1 .5 .9 -1 .2 .5 ...... ..2 .9 .1 .4 .3 -1 ...... ..2 .4 .5 .7 .6 .2 ...... ........
3
by: instruo | last post by:
I'm using the System.Drawing.Bitmap class for loading a 32-bit bmp file which includes an alpha channel. The problem is, when it gets loaded (just using the Bitmap(string filename) constructor),...
7
by: Dennis | last post by:
I am trying to implement drawing on a bitmap and using bitblt to transfer it to the control graphics object in the paint event. It seems to draw on the bitmap ok but doesn't get transferred to the...
8
by: Nathan Sokalski | last post by:
I am trying to write code to rotate a graphic that I have. Here is the code I am currently using: Dim frogbitmap As New Bitmap(Drawing.Image.FromFile(Server.MapPath("images/frog.gif"))) Dim...
7
by: Fir5tSight | last post by:
Hi All, I used the following code in C#: using System.Drawing; //blah blah blah Bitmap bmp = new Bitmap();
15
by: Hamed | last post by:
Have I posted the message to wrong newsgroup? Or Does the question is so much strage? Would someone please kindly direct me to a true newsgroup or resource? Best Regards Hamed
0
by: benfly08 | last post by:
Hi, guys. I have a program to draw bar/pie chart based on the data i hard coded in it. However, my image comes with "BLACK" background color. I don't know how to fix this. The code snippet is...
9
by: poifull | last post by:
Hi All, I have the following task: 1. create an image object in memory (a rectangle with nothing on it) 2. write some text on the rectangle 3. rotate the image 90 degree 4. save the image to a...
2
by: raylopez99 | last post by:
Beware newbies: I spent a day before I figured this out: copying a bitmap (image) file to file is not quite like copying a text file--you have to do some tricks (see below), like using a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...

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.