|
if you want to create a new image file containing the original image plus a legend or a watermark, this pseudo-code should do:
Bitmap bm=Bitmap.FromFile(filepath);
Graphics g=Graphics.FromImage(bm);
g.DrawString(...);
bm.Save(someOtherFilepath, ImageFormat.Jpeg);
bm.Dispose();
FYI: this simple scheme will fail when someOtherFilepath==filepath
|
|
|
|
|
Visible or not visible? If you want it visible then what you should be searching for is jpg watermark c# (which gives you an article here as the first google result). If you want it invisible then what you want is called steganography for which there is a whole series of articles here as well.
|
|
|
|
|
The quantity resulting from the summation of today's date and a JPG photo will result in two terms that connot be simplified. You can, however, store the result symbolically rather than numerically.
|
|
|
|
|
huh? what do you mean by that? can you send the codez plz. It's kind of urgent ya know.
|
|
|
|
|
I have a list of phone numbers, some of them are valid and some of them aren't. I have to write a simple program, which will check which phone number is valid and which isn't.
I thought to use SerialPort for this, but how can I disconnect directly after the first beep (before somebody answers the phone) or after I got message from the carrier that the phone number isn't valid?
Or may be there is some other way to solve it?
Thanks in advance
|
|
|
|
|
|
Hi fellas,
I wanna know what is the best pattern to my web application to use LINQ to SQL in project.
|
|
|
|
|
|
Is that a design pattern now? And I've been using it for ages!
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.
|
|
|
|
|
You are going at things completely backwards. First you figure out what problem you are trying to solve. Then you decide what patterns provide the best solution for that problem. Then you decide what tools to use to implement those patterns.
The way you are doing things is like asking "What is the best vehicle to buy if I want it to be blue?" It may work out fine, but you may end up trying to drive a blue boat through desert sand or a blue motorcycle across the ocean floor.
|
|
|
|
|
The Avoid-Like-The-Plague pattern.
|
|
|
|
|
Dear Coders.
My app requires the display of simple animations using a picture box or custom control.
Now, could I create an animated GIF and load this into the control, or should I create each individual bitmat and load them one after the other, re-creating the animation?
I do not want to create a 'video' and load that, I need full control over the animation(s).
Thank you
Steve
|
|
|
|
|
An easy way is to override on paint and then use double buffering to paint your animations. The best way is to get a background image and then draw sprites on top of the image rather than trying to let GDI+ render an entire frame. It is painfully slow.
|
|
|
|
|
you could do it either way. Animated GIF has the advantage of being simple, once you have the one file.
CodeProject holds an article (with NGIF in the title) that shows one way to turn a series of images into an animated GIF.
|
|
|
|
|
Thank you, I will have a look!
Steve
|
|
|
|
|
You're welcome.
|
|
|
|
|
I have some static method that i call from the main code.
The method return some object that i allocate in the start of the method - and in the method body i doing some operation on this object and at the end i return it.
Its look like this:
static object locker = new object();
public static SomeObject f(SomeObject org)
{
SomeObject o
lock( locker )
{
o = org.Clone();
Do something on o;
}
return o;
}
I dont know why - but i get the "exception Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
If i lock the scop - how other thread got in ?
Someone can help here ?
|
|
|
|
|
I see nothing that is inherently wrong.
Check all the details of the exception, watch the line number, investigate the line of code.
If all else fails, show us those details and the actual code.
|
|
|
|
|
try:
public static SomeObject Foo(SomeObject someObject){
SomeObject result = null;
if(someObject != null){
lock(someObject){
try{
result = (SomeObject)someObject.Clone();
}
catch(Exception e1){
}
}
}
return result;
}
|
|
|
|
|
Hi there.
I have made a user control which does something with a selected listbox.
The user selects a listbox to handle from the properties menu of the usercontrol
[IMG]http://img690.imageshack.us/img690/6100/listbox.jpg[/IMG]
I used this code to get the listbox at the property window.
<pre>
private ListBox box;
public ListBox _ListBox
{
get
{
return box;
}
set
{
box = value;
}
}
</pre>
well.. the problem is that the user can change the selected listbox's (from property menu) properties, which i realy don't like.. so how can i in any ways avoid that? (Remove the properties or disable the "+")
Thank you
|
|
|
|
|
I have hardly done any such thing, however I think you should read this[^]; the BrowsableAttribute looks promising.
|
|
|
|
|
Snap!
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Attributes are your friend here.
Look up the Browsable and DesignTimeVisibility attributes.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
sry but i can't seem to find anything about attributes. Can you help me a little more?
|
|
|
|
|
Here is a link to the Browsable[^] attribute.
You can look up the DesignTimeVisibleAttribute for yourself.
You will never be a programmer if you cannot use a search engine.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|