I'm enabling users to rotate photos and generate thumbnails.
I have discovered that if, after a user rotates a photo 180 degrees, then
generates a thumbnail, that the resulting thumbnail appears unrotated (i.e.,
in original position, or rotated zero degrees).
Why is this? (and yes, I have verified that the "original" from which the
thumbnail is generated has, in fact, been rotated 180 degrees prior to
generating the thumbnail).
Here is the code that creates thumbnail:
System.IO.FileS tream fs = new System.IO.FileS tream(pathToFul lSizeImage,
System.IO.FileM ode.Open, System.IO.FileA ccess.Read);
System.Drawing. Image objThumbnail =
System.Drawing. Image.FromStrea m(fs).GetThumbn ailImage(iWidth , iHeight, null,
IntPtr.Zero);
Here is the code that rotates the original:
System.IO.FileS tream fs = new System.IO.FileS tream(pathToOri ginal,
System.IO.FileM ode.Open, System.IO.FileA ccess.ReadWrite );
System.Drawing. Image imageToFlip = System.Drawing. Image.FromStrea m(fs);
imageToFlip.Rot ateFlip(System. Drawing.RotateF lipType.Rotate9 0FlipNone);
// In order to rotate 180 degrees, the user clicks a button twice, which
executes above code twice.
Repeatedly clicking the button that executes the above code causes the
original to rotate in 90 degree increments: can go all the way around with
no problem, and thumbnails can be subsequently generated that reflect the
original's current rotation position - with the only exception being when
the original is rotated 180 degrees.
Any clues or explanations are greatly appreciated! 0 1844 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Mudge |
last post by:
Please, someone, tell me why OO in PHP is better than procedural.
|
by: Simon Wigzell |
last post by:
I need a simple function to generate and save a thumbnail from a picture. It
would require :
Source Picture Fileame
Thumbnail Height and Width
Thumbnail Filename
There are many pay programs available but they do far more than I require
and I want the code to be built in to my code, not operate as a separate
program. Any ideas? The browser knows how to resize pictures easily enough,
|
by: Mike |
last post by:
Sites using thumbnail preview for world wide web file navigation and
searching.
Below are list of sites that are either researching or providing thumbnail
preview images for online web documents. Thumbnail previews are useful for
web site navigation particularly in search engines and directories such as
Google, Altavista and Yahoo. The preview images provide a portion of the
content of the electronic file to aid in navigation.
|
by: |
last post by:
Some time ago I installed VC# 2003, made a small generic project, compile
with the allow unsafe flag and I get the error below:
"error CS1577: Assembly generation failed -- Unexpected exception
processing attribute -- System.ArgumentException: Invalid directory on URL."
(If I do not compile with the unsafe flag compiler setting all compiles
perfect)
After long tracing, I ended up discovering that it is csc.exe installed by
the .NET...
|
by: Cecil Windham |
last post by:
I'm enabling users to rotate photos and generate thumbnails.
I have discovered that if, after a user rotates a photo 180 degrees, then
generates a thumbnail, that the resulting thumbnail appears unrotated (i.e.,
in original position, or rotated zero degrees).
Why is this? (and yes, I have verified that the "original" from which the
thumbnail is generated has, in fact, been rotated 180 degrees prior to
generating the thumbnail).
| |
by: db |
last post by:
In explorer you can change the view setting to thumbnails, and you get
thumbnails even from movies.
I want to do the same from asp.net. I want to create 'on the fly' thumbnails
from some mpg movies, but I don't know if that's possible from asp.net. Who
can help me with this?
|
by: mo |
last post by:
Hi,
I have the following code to create a thumbnail from the input stream
System.Drawing.Image source;
source=System.Drawing.Image.FromStream(new
System.IO.MemoryStream(myData));
System.Drawing.Image image = source.GetThumbnailImage
150,150,null,IntPtr.Zero);
MemoryStream ms = new MemoryStream();
ImageFormat thisformat=image.RawFormat;
|
by: dean.greg |
last post by:
Im looking for a way to generate thumbnails from an image as fast as
possible. Currently I'm using GDI+ however going from 1024x768 to
100x100 takes too long. I'd imagine the whole process can be
optimized by using hardware acceleration (ie DirectX), however I am
not all that familar with the DirectX API. What I'm looking for is
some direction, or even some sample/psuedo code, that might point me
in the right direction.
If not...
|
by: AaronL |
last post by:
Hello,
I would like to have thumbnails generated automatically from images uploaded from my image upload system. Can anyone tell me what I need to do? Here is the link to my php info page, I'm not sure if gd is enabled or not. I may have to go with a freeware cgi script or something
www.lambertsoftware.com/ecomm/phpinfo.php
Thanks!
|
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...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
| |
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...
|
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...
|
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();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |