...atleast in the case of printers when accessed via GDI+ in .NET. For example, when a printer reports a DpiX of 600 and you say:
g->DrawLine(Pens::Black, 0.0f, 50.0f, 600.0f, 50.0f);
...the line drawn goes about three-fourths of the way across an A4 page. Some smart guy somewhere decided that it would be great to use a 1/100 inch co-ordinate system for printers so that the drawing routines used for video output would produce more or less the same size on the printer as well.
Thursday, August 27, 2009
Wednesday, August 19, 2009
Saturday, August 15, 2009
Drawing an image with Alpha in .NET
This is how it is done: How to: Use a Color Matrix to Set Alpha Values in Images. There is an error on that post: it mentions DrawString in one place instead of DrawImage.
The key is to use one of the overloads of DrawImage which takes an ImageAttributes object as a parameter.
One thing I don't understand is that the following call fails if
The key is to use one of the overloads of DrawImage which takes an ImageAttributes object as a parameter.
One thing I don't understand is that the following call fails if
srcUnit is specified to be GraphicsUnit::Display.g->DrawImage(image, imgDest, srcRect,
GraphicsUnit::Pixel, imgAttr);
Thursday, July 09, 2009
Microsoft Connect Gems
My favorites from connect.microsoft.com. They really have managed to connect with my sense of humour. I wonder how they can spare any time on developing new products and new releases when there are so many unresolved issues in their existing products! But still, it was fun to read their replies to some bug reports.
XYZ,
Thanks for your feedback.
But you haven't answered my question. What would you recommend to cope with cases like attached example illustrates? Is there a general pattern for serializing generic collections?
Posted by Unregistered User on 23/11/2005 at 03:12
It seems that the attachment was somehow lost from this bug. Could you please reattach and reactivate?
Posted by Microsoft on 06/12/2006 at 13:05
Thank you for submitting this issue. Unfortunately, we have decided that it will not be addressed because the risk of the fix and its potential breaking nature outweighs its benefit. By the time the next opportunity to make this change comes about, the hope is that the new serialization technologies in a future version of the Windows Communication Foundation will address your scenario. If this issue is causing significant negative business impact, please contact Microsoft Product Support Services. I regret that we could not provide a better resolution. Rest assured that we seriously considered this issue - a Won't Fix decision is never easy to make.
-- XYZ
Thank you very, very much for bringing this to our attention, for following up, and for not giving up after two bug resolutions. I think this is a great example of the value of the MSDN Feedback program. You have indeed uncovered a serious problem with Version Tolerant Serialization and Generics. Unfortunately, Whidbey is pretty much completely closed down right now, and it is impossible to check in a fix even for a bug of this magnitude, which is why I am forced to resolve this as Postponed. However, be assured that we are treating this issue very seriously and are now in the process of discussing alternative delivery vehicles for this fix (e.g. the possibility of making a patch available through Product Support Services.) In the meantime, please use assembly binding redirection (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconassemblybindingredirection.asp) as a workaround.
Thank you again for the time you invested in reporting this problem,
-- XYZ
Tuesday, June 02, 2009
.NET ColorTranslator class
Use System.Drawing.ColorTranslator to convert between all kinds of color formats. Like converting from #FF0000 to Color.Red for example.
Tuesday, April 21, 2009
TrueCrypt
TrueCrypt allows you to create and mount encrypted disk volumes such that your data is encrypted/decrypted on-the-fly as it is read/written. The volume can be mounted from a single file rather than an entire partition. You can select the encryption algorithm used and also use a keyfile instead of a regular password.
Isn't a Windows password enough protection?
No. Someone could boot your machine using a USB or other drive and access your files.
What about "Encrypt contents to secure data"?
I have no idea how that works.
What about BitLocker on Vista?
Sounds good, but you shouldn't be using Vista yet.
Other advantages?
TrueCrypt can encrypt the boot drive. A TrueCrypt volume stored in a single file can easily be moved around, backed up, zipped, deleted and so on...
Isn't a Windows password enough protection?
No. Someone could boot your machine using a USB or other drive and access your files.
What about "Encrypt contents to secure data"?
I have no idea how that works.
What about BitLocker on Vista?
Sounds good, but you shouldn't be using Vista yet.
Other advantages?
TrueCrypt can encrypt the boot drive. A TrueCrypt volume stored in a single file can easily be moved around, backed up, zipped, deleted and so on...
Wednesday, April 15, 2009
Subversion over Apache on Windows
I had installed Collabnet Subversion Server as the VCS on my laptop. The
The Subversion manual prescribes the following setting for using Digest authentication:
Another thing: the locally installed Apache manual is not enabled by default.
httpd.conf installed by default is not usable straight out of the box. Here are a few things I had to fix.The Subversion manual prescribes the following setting for using Digest authentication:
<Location /svn> DAV svn SVNParentPath /var/svn AuthType Digest AuthName "Subversion repository" AuthDigestDomain /svn/ AuthUserFile /etc/svn-auth-file Require valid-user </Location>That doesn't work. From what I learned here, it should actually be:
<Location /svn> DAV svn SVNParentPath /var/svn AuthType Digest AuthName "Subversion repository" AuthDigestDomain /svn AuthUserFile /etc/svn-auth-file Require valid-user </Location>In other words, both
Location and AuthDigestDomain should be /svn without the trailing slash. And remember to use htdigest.exe instead of htpasswd.exe when using Digest authentication.Another thing: the locally installed Apache manual is not enabled by default.
- Find the following line in
httpd.confand uncomment it:
Include conf/extra/httpd-manual.conf - Open
conf/extra/httpd-manual.confand replace all occurrences of the following with the path tohttpd/manual
F:/windows/subversion/../httpd/tmp/httpd/Apache/manual
Subscribe to:
Posts (Atom)