|
Hello All,
I have a query:
Suppose I have a Multi-page Tif/Tiff (Single Tiff file with multiple pages) and the pages are from Top to Down manner, as any normal document will be.
What I want to do is to rearrange the pages in a grid of axb pages and again save the document as a single page Tif/Tiff format.
For example, suppose I have a Tif/Tiff file that contains 6 pages, arranged vertically 1 to 6. Now I want to arrange these 6 pages(each page of size 8.5x11 in) so that the first 3 pages come horizontally in one row, and the next 3 pages come horizontally in the second row. After this is done, the resulting image is stored as a single page Tif/Tiff file(whose size would definitely be larger as it now contains 6 pages).
Can anyone help? Some sample code will be of grate help to me.
Thanks in advance
|
|
|
|
|
Have you tried google? See here[^]! This might help. Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Well it seems to be a good class, containing so many functionalities of Tiff, but i can't figure out which method can be utilized to serve me? there are streams and arrays of streams, but I'm sort of confused among usage of them. Can you help a little?
|
|
|
|
|
Hi friends $ experts!!
i need a small help from you'll!! i am working on eraser brush.. i have created a path gradient brush with center color as white and surround color as transperant now i apply the brush on the image. now once i say save this brush the white color should become transparent wheras the transperant color should blend with the image.. i am using this brush so as to get the feather effect.
i have tried with the composite mode as source copy but the tranperant blending effect goes.. can any show me a way to solve my problem?
Thanking in advance
Regards
Samir
|
|
|
|
|
Hey my friends ... I have one application done in C# .. but i want to give it for my customers as a trial version (I want it to count from the day it installed up to 30 days) ... But if i use DateAndTime class ... I think if they change the date and time ... so that i can be faked .... can any body help me with this problem .... or how can i get the real date even if they change it ... i.e like other softwares do ... just count from the day it is installed ....
Thank you a lot
|
|
|
|
|
Any or all of:
0) I wouldn't bother.
1) Store the date and time of install or first use and then calculate the elapsed time when it starts up.
2) Have it access a website to get the current date and time rather than use the system clock.
3) Have it access your site (phone home) to determine the date and time and elapsed time.
|
|
|
|
|
One could also use Environment.TickCount to infer that the time has been changed or the computer has been restarted. If tick count and date are stored together at each use, that can be compared against a later reading. This would not be perfect detection (it would be easy to get around), but it could be used to detect the types of modifications that many users would make.
But, it's probably too much work. Doing a simple time check to a remote server would be enough to deter most users from subverting the trial.
Also, there are other forms of trials. For example, usage could be limited based on how long the application is left open. This could be more easily tracked than the amount of time it's been installed.
|
|
|
|
|
Make a remote call to a server that you control to get the date/time. They can't change the clock on your server.
|
|
|
|
|
My application is only for 1 PC ... i.e there are no servers or other PC's around there ... There is no internet or cant interact with websites ... it is just for a stand alone computer
|
|
|
|
|
Then do what I said here and make the trial based on the total number of hours the application has been open.
|
|
|
|
|
and what is keeping the user from installing the trial app over and over again?
|
|
|
|
|
The installation could store the the number of hours open in the registry. The app could check if that exists at install time. If it doesn't, it creates it. If it does, it leaves it as is. When the app is opened, it makes note of the number of ticks that have passed... when it is closed (and perhaps periodically in case the user forces the application close without proper finalization) it will take note of the ticks again, calculate the difference, and add that to the value in the registry.
Of course, the user could get around that, but users can get around most anything. That should be sufficiently difficult to prevent most users from toying around with it. Some more ideas to make it more secure:
- Do some basic encryption (even with a known/static password) on the value in the registry so the user can't just open regedit and change the value to their liking. Of course, they could remember one of the previously encrypted values, if they thought of that. Or delete the key altogether, but there are ways to detect that too (and ways to get around it, and so on).
- Make the EXE modify itself to make note of the value stored in the registry. If it doesn't match the next time the app is run, that means the user did some tampering. This will be sufficiently non-obvious to trip up most users.
- Create a hidden folder in one of several predetermined but randomly chosen locations. If that folder exists, it means the app was installed before. This will get in the way of users who like to just delete registry keys and reinstall trial apps.
There are various solutions to problems like this, but very simple solutions will trip up the majority of users.
|
|
|
|
|
|
You can do one of two things I recon.
1) Store the date of first install in the registry.
2) Store the date of first install in an encrypted file in app directory.
In either of the two means above, you check the install date in either the registry or the encrypted file and calculate the days remaining from there. Once it has reached 30 days then you set all controlls on the form to falls or just pop up a messagebox to say that the trail has expired and close the app down once OK has been pressed.
If you want the fancy stuff then you may have to spend lots of money to buy an MSI builder or exe builder. I recon the above is much cheaper and should only take a few minutes to code into the app.Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Hey dude ... u've a nice idea .. but what really my question is ... if the user changed the date ...
For e.g .. I installed the app 2 day and today is ..>> 3/5/2010 .. and it is saved in registry ... lets say aftr 15 days ... that is ..>>>3/20/2010 ... if the user changes the time to 3/10/2010 ...It means they faked me 10 days ... and they can do zis forever ... how can i controll this .. thx a lot
|
|
|
|
|
Where in Toronto Ont Canada can I walk in and buy Visual Studio 2008 ?
|
|
|
|
|
Don't think I've ever seen Visual Studio in a physical store (though my coworker says he bought a copy in some student store). Why not buy it online? Or maybe visit a university and see if you can buy a copy from their student store?
|
|
|
|
|
I have... but not recently. (2002)
|
|
|
|
|
For about a thousand bucks (CDN), you can have it delivered to you in 24 hours from Amazon[^].
/ravi
|
|
|
|
|
There's no Microsoft Store near you yet?
|
|
|
|
|
hi,
how do i read and write date from/to xml file?
my xml looks like this (it's basically the app config):
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="Setting1" value="Very" />
<add key="Setting2" value="Easy" />
</appSettings>
</configuration>
for example i found that to read date from xml,i can do this:
DataSet myDS = new DataSet();
myDS.ReadXml(@"C:\appconfig.xml", XmlReadMode.ReadSchema);
Similarly, how can I write to xml using datasetmodified on Thursday, March 4, 2010 7:07 PM
|
|
|
|
|
Dude,
A quick Google Search[^] would have led you to the First Search Result.[^]
The code from the website is
System.IO.StreamWriter xmlSW = new System.IO.StreamWriter("Customers.xml");
custDS.WriteXml(xmlSW, XmlWriteMode.WriteSchema);
xmlSW.Close();
I'm not trying to pick on you with all of the links. I am just trying to show that a little searching would give you the answer you need right away. Instead, you had to wait almost 4 hours for me to reply.
Good luck writing out your data!
Hogan
|
|
|
|
|
hi,
tks for the reply but i noe how to read with your code given.
what i'm looking for is how do you proceed after that? with my given xml, how do i get the value of the key and its value.
for example:
<add key="Setting1" value="Very" />
how do you get the value of Setting1;
and how do you update this value.
similarly how do you create new element and value with dataset.
i tried using the dataset table but im pretty much lost as it provide null value.
|
|
|
|
|
|
Language: C# 2.0
IDE: VS2008 Professional
OS: Windows Vista Home Premium SP2
(Just in case any of this information is needed)
Alright, I'm in the process of writing some software mostly for the fun of it, though it will be useful to others as I have already talked with people about it. Anyhow, on to my issue.
Well, when I started writing the application (a Record Label management system) I was using really inefficient methods and such. I was using things that were not necessary and I wanted this to be more of a quality application than just a "slap-together" project. So I started re-writing some code, re-creating some forms, and so on. The application is MDI and the child windows are for things such as managing sessions, artists, sales, etc.
I have this code which is used to delete an artist. The 'RecordLabel' class is a simple class I wrote that handles the main file I/O (saving/loading the record label data to/from a file). It is referenced like this "RecordLabel recordLabel" in the "MainForm" class. Here is the code from "ArtistsForm":
public Artist GetArtistData()
{
Artist newArtist;
if (null == (newArtist = new Artist()))
return null;
newArtist.UniqueId = txtUniqueId.Text;
newArtist.StageName = txtStageName.Text;
newArtist.FirstName = txtFirstName.Text;
newArtist.LastName = txtLastName.Text;
newArtist.PrimaryPhone = txtPrimaryPhone.Text;
newArtist.SecondaryPhone = txtSecondaryPhone.Text;
newArtist.Email = txtEmail.Text;
newArtist.HomePageUrl = homePageLink.Text;
newArtist.MyspaceUrl = myspaceLink.Text;
newArtist.SoundclickUrl = soundclickLink.Text;
newArtist.HourlySessionRate = txtRecordingRate.Text;
newArtist.Notes = txtNotes.Text;
if (sessionsList.Items.Count > 0)
{
foreach (ListViewItem session in sessionsList.Items)
newArtist.SessionIdList.Add(session.SubItems[0].Text);
}
return newArtist;
}
public bool IsSelectionValid()
{
if ((artistsTree.Nodes[0].Nodes.Count > 0) && (artistsTree.SelectedNode.Level > 0))
return true;
else
return false;
}
private void btnDelete_Click(object sender, EventArgs e)
{
Artist artist;
if ((null != (artist = GetArtistData())) && (IsSelectionValid()))
{
DialogResult result = MessageBox.Show("Are you sure you want to delete the artist named \"" +
artist.StageName + "\"? This operation cannot be undone.", "L.M.E. - Delete Session",
MessageBoxButtons.YesNo, MessageBoxIcon.Error);
if (result == DialogResult.Yes)
{
MainForm parentForm;
if (null != (parentForm = (MainForm)this.MdiParent))
{
if (parentForm.DeleteArtist(artist))
{
if (artist.UniqueId != string.Empty)
{
TreeNode node = artistsTree.SelectedNode;
if (node != null)
{
artistsTree.Nodes[0].Nodes.Remove(node);
if (Artists.Count == 0)
System.Diagnostics.Debug.WriteLine("Artists.Count = 0");
foreach (Artist a in Artists)
{
System.Diagnostics.Debug.WriteLine("Unique ID: " + a.UniqueId);
if (a.UniqueId == artist.UniqueId)
{
System.Diagnostics.Debug.WriteLine("Removed: " + a.UniqueId);
System.Diagnostics.Debug.Write("\tArtist ID:" + artist.UniqueId);
Artists.Remove(a);
return;
}
}
}
}
}
}
}
}
}
I have used the Debug.WriteLine and Debug.Write functions in order to (hopefully) find the problem. However, I have had no such luck and I am no closer to the solution than when I originally started to encounter this issue.
Here is the 'MainForm.DeleteArtist' method:
public bool DeleteArtist(Artist artistData)
{
if ((recordLabel == null) || (recordLabel.Artists == null) || (recordLabel.Artists.Count == 0))
return false;
foreach (Artist artist in recordLabel.Artists)
{
if (artist.UniqueId == artistData.UniqueId)
{
recordLabel.Artists.Remove(artist);
switch (recordLabel.SaveDataToDisk(CurrentDataFilePath))
{
case IoErrorCode.NoError:
sessionTimerForm.Artists = recordLabel.Artists;
sessionsForm.ClearArtistsList();
sessionsForm.Artists = recordLabel.Artists;
sessionTimerForm.RemoveArtist(artistData.StageName);
currentActionStatus.Text = "Data saved successfully.";
currentActionStatus.Image = Lab_Management_Environment.Properties.Resources.preferences;
return true;
default:
return false;
}
}
}
return false;
}
Now for the problem. I create two or three example artists and all goes well. It saves all the data appropriately and I can select each artist and the artist's data is displayed properly in all of the input fields.
Once I delete any artist (first, last, third, whatever) it empties my "List<artist> Artists;" object in the "ArtistsForm" class. I have made sure that it is only deleting the artist with the selected artist's ID, and it's correct.
However, it only gets to this point in the code (from "ArtistsForm"):
if (parentForm.DeleteArtist(artist))
{
if (artist.UniqueId != string.Empty)
{
TreeNode node = artistsTree.SelectedNode;
if (node != null)
{
artistsTree.Nodes[0].Nodes.Remove(node);
if (Artists.Count == 0)
System.Diagnostics.Debug.WriteLine("Artists.Count = 0");
No matter what, it hits the "WriteLine" there. It seems to only happen after the call to "parentForm.DeleteArtist". Any suggestions? This is really irritating me. :-P But I've been patient with it and I can wait for a response. I'm in no hurry and this isn't a work project so I have no deadline.
I apologize for any sloppy coding and such. I'm just trying to get this working before I clean it up. I don't really like looking at this code much anymore because my standard coding practice is quite neat and well put together (at least to me).modified on Thursday, March 4, 2010 9:55 PM
|
|
|
|