|
Graphics gs =this.CreateGraphics();
now use gs.SetClip() function ..hopeit'll solve your problem
sameer
|
|
|
|
|
Problem is this that i have put this croped image in pictureBox and have to obtain croped image pixels infombut graphics image cannot be converted in to Botmap ,Actually i want to make cropped image as Bitmap
plz Help me
|
|
|
|
|
can you write a littler Piece of code that you are doing.
sameer
|
|
|
|
|
Image_Processing wrote: but graphics image cannot be converted in to Botmap
Actually they are easily converted to Bitmaps several ways. A simple one
Bitmap MyBitmap = (Bitmap)MyPictureBox.Image;
Regards
|
|
|
|
|
You can achieve this effect by calling a special version of Graphics.DrawImage() .
Create a Bitmap in the size of your cropping area.
Then get yourself a Graphics object to draw into this bitmap using Graphics.FromImage() .
Using this Graphics object you draw the original image into the new bitmap in a way that the top left corner of the crop area is painted to the top left corner of your new bitmap.
Don't forget to dispose of the Graphics object afterwards or you'll create a resource leak.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi All,
I am using DataGridView in my application.I want to highlight the selected row(without setting the backcolor or forecolor) when the user selects the row.Is there a way to do this.
Regards
Vinutha
Vinutha
|
|
|
|
|
row is already get selected by default behaviour of datagrid.
for any special color you can use
myDataGrid1.SelectionBackColor Property
and to access current row you can use
myDataGrid1.CurrentRowIndex
sameer
|
|
|
|
|
|
I have a method in a separate class file that I'd like to call.
The separate file is called dataaccessclass.cs is structured like:
using System;
namespace aspnetcsharpdemo
{
/// <summary>
/// Summary description for Class1.
/// </summary>
public class Class1
{
public static string Class11()
{
// this is the method that would do the select
string result = "test";
return result;
}
}
}
When I try the following code it fails with - C:\Inetpub\wwwroot\aspnetcsharpdemo\test5.aspx.cs(52): The type or namespace name 'DataAccessSelectClass' could not be found (are you missing a using directive or an assembly reference?)
Label1.Text = DataAccessSelectClass.Class11();
Whats the proper way to call the method ?
|
|
|
|
|
I can't see where your DataAccessSelectClass is coming from? And as it seems, neither can the compiler
For the example code you've posted, you should be using
Text1.Text = Class1.Class11();
That should give you what you need.
Another thing to consider is, if you're going to just return a string that's not going to change, why not set it up as a public const string or as read only property?
Steve.
|
|
|
|
|
well the code I posted is in a file called DataAccessSelectClass.cs (and its called from a webform1.aspx.cs page)
the code inside the method is just temporary - once I figure out how to call it, the code will be changed to return a dataset.
|
|
|
|
|
digsy_ wrote: namespace aspnetcsharpdemo
{
///
/// Summary description for Class1.
///
public class Class1
What the file is called does not matter. This class is called Class1, or aspnetcsharpdemo.Class1. You're looking for a different class, with a method called Class11 ?? Or is Class11 a class in a namespace called DataAccessSelectClass and your code is totally confused ?
Use real class names, not class1 or class11.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
As Christina said, the file name is irrelevant.
To access the method in the class you use:
Label1.Text = aspnetcsharpdemo.Class1.Class11();
If you would have named your class DataAccessSelectClass instead of Class1, you would use:
Label1.Text = aspnetcsharpdemo.DataAccessSelectClass.Class11();
And if you had using aspnetcsharpdemo; at the top of your page, or if your page class was inside namespace aspnetcsharpdemo , you could use:
Label1.Text = DataAccessSelectClass.Class11();
---
b { font-weight: normal; }
|
|
|
|
|
use this
Label1.Text = aspnetcsharpdemo.Class11();
sAqIb
|
|
|
|
|
sorry for the mistake
use this
Label1.Text = aspnetcsharpdemo.Class1.Class11();
means, namespacename.classname.function_name_of_class();
it will work
sAqIb
|
|
|
|
|
sorry for the mistake
use this
Label1.Text = aspnetcsharpdemo.Class1.Class11();
means, namespacename.classname.function_name_of_class();
it will work
sAqIb
|
|
|
|
|
I've written a code that creates a receives the request, sent by the web browser(I use FireFox), and then it parses the request and set the headers of a WebRequest object and if it finds any information after the empty line, it writes the information in the WebRequest object, then I get a WebResponse object out of the WebRequest object and creates 2 byte arrays, then it reads the WebResponse stream and puts the data in the first byte array and then puts the Header information of the WebResponse in the second array using the ToByteArray method of the WebResponse's Header propety.
Then I have tried to methods for sending data to the web browser:
1)I have sent the Header array first in a separated Send method and then the Data array in a separated Send method after that, that makes the browser report the "Done" status and shows nothing!
2)I have added the data to the end of the header and sent them az a single Send method, that makes the browser show the html and css and jscript information but it leaves the places of the pictures empty!
Does anyone know, what should I do to fix this problem?
Should I send the header just if the data is in html/text format?
Or the Gip/Png/Jpg of Application data formats also need the header?
If they need, how to make the browser show the images and flashes?
Please help!
Sojaner!
|
|
|
|
|
Hi,
How can i 'see' what check box(es) are selected in an if statement?
This is how i want it:
if(chkbx1.checked == true AndOr chkbx2.checked == true ....... AndOr chkbx10.checked == true)
Thanks in advance!
|
|
|
|
|
What is the AndOr operator supposed to do? The C# or operator || is non exclusive, which means that it's result is true if either operand is true or both operands are true.
|
|
|
|
|
Hi,
I want to check if non is selected or 1 or more.
Depending on which chkboxes are selected, its suppose to do something with all the code "behind" the selected boxes.
So || is what i need ha.
Ima try that.
Do you also happened to know how i can merge 2 .txt files into a new file?
Thanks in advance!
|
|
|
|
|
The shortest way:
string file1 = File.ReadAllText("file1.txt");
string file2 = File.ReadAllText("file2.txt");
File.WriteAllText("file3.txt", file1 + file2);
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Hi Greeeg,
Thanks for your reply,
I meant in a new file.
So if i understand the way you did it. Than this is how it would be done to a new file (please do correct me if i'am wrong):
string file1 = File.ReadAllText("file1.txt");
string file2 = File.ReadAllText("file2.txt");
StreamWriter file3 = new StreamWriter("file3.txt", true);
file1.Write(file3);
file2.Write(file3);
|
|
|
|
|
See my previous post. I made a mistake and rewrote it
modified 12-Sep-18 21:01pm.
|
|
|
|
|
|
Hi,
Is there a way that I can programmatically resize the columns of a listview in report mode so all the text in the columns is visible when it comes up?
thanx
|
|
|
|