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

Bitmap.HorizontalResolution is read-only.

To my big suprise HorizontalResolution and VerticalResolution iof the Bitmap
class are read-only!
Is there any reason to this? And How do I change them?

Bitmap bitmap = new Bitmap(imgPhoto.Width,imgPhoto.Height,FileFormat);
bitmap.HorizontalResolution=(float)Resolution.XPix elsInInch;
bitmap.VerticalResolution=(float)Resolution.YPixel sInInch;

Thanks.
Oct 31 '05 #1
1 3013
> To my big suprise HorizontalResolution and VerticalResolution iof the
Bitmap
class are read-only!
Is there any reason to this? And How do I change them?

Bitmap bitmap = new Bitmap(imgPhoto.Width,imgPhoto.Height,FileFormat);
bitmap.HorizontalResolution=(float)Resolution.XPix elsInInch;
bitmap.VerticalResolution=(float)Resolution.YPixel sInInch;

Found it:
bitmap.SetResolution((float)Resolution.XPixelsInIn ch,(float)Resolution.YPixe
lsInInch);

Odd that they made those read-only.
Oct 31 '05 #2

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

Similar topics

3
by: Kirk Quinbar | last post by:
hi, I have the following sample .NET 1.0 code which converts a metafile to a bitmap: Dim tmpImage As Bitmap 'System.Drawing.Image Dim streamX As New System.IO.MemoryStream() Dim fs As...
9
by: Mark Johnson | last post by:
How can you save all or a portion of the Grafics object to a Image/Bitmap ? I am try to save the Images from Cards.dll to a BitMap file. I can read in the Images to the Grafics, but when I try this...
2
by: TCR | last post by:
Hi, I posted this earlier and got a suggestion that didn't pan out. I am trying to determine if there is a known bug related to the resolution value returned when opening a .jpg file by passing...
0
by: CroDude | last post by:
Hi all! I have problems when writting bitmap to a byte array and after reading it back form byte to Bitmap object. What I do is this: First I throw Bitmap to a memory-stream and then I write it...
9
by: SStory | last post by:
I use a bitmap class new bitmap(filepath) this should and does load my jpg into memory. I then want to use mybitmap.save(filepath,imaging.imageformat.jpeg) to save it; overwriting the...
8
by: gsmith | last post by:
Hello, I am developing a video recording (mjpeg) system which records large binary files. I need to read the JPEG data from the binary file and create a bitmap object to be displayed....
14
by: eliss.carmine | last post by:
I'm using TCP/IP to send a Bitmap object over Sockets. This is my first time using C# at all so I don't know if this is the "right" way to do it. I've already found out several times the way I was...
0
by: Duracel | last post by:
Hi, I've got a routine that fetches a bitmap from a COM server and converts it into a .NET format bitmap. The original DIB surface is 24 bit. When blitting this bitmap to a window, the speed...
12
by: active | last post by:
I've been looking on the Internet for a way to convert a DIB to a Bitmap without success. Now I'm wondering if that is the approach I should be taking. All I want to do is display the DIB or...
1
by: jj | last post by:
The following creates a copy of an image. It worked fine in Visual Studio 2005, but after installing Visual Studio 2008 then opening the solution as a ..net 2.0 project, I get an error on the...
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.