|
Michael Schäuble wrote: The Frames class makes a lot of sense - I already had started one, which also converts the raw data to GDI when necessary.
No. A Frames class handles with MANY frames.
A Frame class (without s) would handle the inner stuff of a single frame.
So a Frames class would be some collection of Frame instances, but not care about the internals of a Frame.
This is similar to a Form holding ListBoxes, however the Form doesn't do anything to the content of its ListBoxes.
Michael Schäuble wrote: some funny results
I can't comment, too vague. Performance can be very tricky, for many many reasons. A big one is: has the data recently been loaded in memory, so it still is in cache. Another is: does the code happen to be optimized (some .NET classes are, I would hope; your code may not, yet). etc.
Michael Schäuble wrote: how-to information ...about the slicing
No. It is very simple: try to do all required operations on a small set of data (a few MB at most) while it is in cache, before moving to the next chunk of data, since for most image processing, when done properly, fetching the data takes more time than processing it.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi all,
I am trying to create a Multi column Drop down list in VB.NET. I have tried to add an array to each data table row but was not able to get the array in the list, i only get the first value. ie. D1, D2.
Private Sub CreateDataSource()
' Populate using a DataTable
DataTable = New DataTable("Employees")
dataTable.Columns.Add("Employee ID")
dataTable.Columns.Add("Name")
dataTable.Columns.Add("Job")
Dim arr1() As Object = {"D1", "Natalia", "Developer" }
dataTable.Rows.Add(arr1)
Dim arr2() As Object = {"D2", "Jonathan", "Developer" }
dataTable.Rows.Add(arr2)
multiColumnComboBoxEx1.DataSource = dataTable
multiColumnComboBoxEx1.DisplayMember = "Employee ID"
multiColumnComboBoxEx1.ValueMember = "Name"
End Sub
How, ever the C# version of the code works fine.
private void CreateDataSource()
{
dataTable = new DataTable("Employees");
dataTable.Columns.Add("Employee ID", typeof(string));
dataTable.Columns.Add("Name", typeof(string));
dataTable.Columns.Add("Job", typeof(string));
dataTable.Rows.Add(new string[] { "D1", "Natalia", "Developer" });
dataTable.Rows.Add(new string[] { "D2", "Jonathan", "Developer" });
multiColumnComboBoxEx1.DataSource = dataTable;
multiColumnComboBoxEx1.DisplayMember = "Employee ID";
multiColumnComboBoxEx1.ValueMember = "Name";
}
Please give me some idea as to why it does not work with VB.NET.
Thanks
|
|
|
|
|
I do not know why your code does not work in VB.NET, but if I had a problem like this the first thing I would do is top make my VB code match my c# code as closely as possible.
So to start try changing:
dataTable.Columns.Add("Employee ID")
dataTable.Columns.Add("Name")
dataTable.Columns.Add("Job")
to:
dataTable.Columns.Add("Employee ID", Type.GetType("System.String"))
dataTable.Columns.Add("Name", Type.GetType("System.String"))
dataTable.Columns.Add("Job", Type.GetType("System.String"))
and:
Dim arr1() As Object = {"D1", "Natalia", "Developer" }
dataTable.Rows.Add(arr1)
Dim arr2() As Object = {"D2", "Jonathan", "Developer" }
dataTable.Rows.Add(arr2)
to:
dataTable.Rows.Add(New String() {"D1", "Natalia", "Developer"})
dataTable.Rows.Add(New String() {"D2", "Jonathan", "Developer"})
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.”
|
|
|
|
|
Even with the proper coversion I am not able to get the multiple column. It looks like i m not able to create load the array on to the dropdown list.
thnx
|
|
|
|
|
i am using the drawimageunscaled from drawing a bitmap
before showing the image
i am setting the height and width of form = that of bitmap
height = b.height
width = b.width
but if the image is large, say, 3 megapixels then
the size of form is limited to resolution of monitor
what should i do?
TheMrProgrammer
http://www.icbse.com/2009/funny-exam-answers-school-students
http://download.cnet.com/TheCalcMan/3000-2094_4-10958266.html
|
|
|
|
|
Hi,
if your system has only one screen, all forms are size-limited to the size of the screen.
you can view (part of) a larger image, and optionally provide panning; one way would be by using a scrollable control. I could do that with a Panel; you might look at ScrollableControl too.
AFAIK a PictureBox is too stupid a control to provide this functionality.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
hey thanks!
but i have one more doubt.
suppose i have a bitmap : rectangle(0,0,10000,10000)
and i want to have a another bitmap having (300,300,300,300) of the above
bitmap, how can i do that.
TheMrProgrammer
http://www.icbse.com/2009/funny-exam-answers-school-students
http://download.cnet.com/TheCalcMan/3000-2094_4-10958266.html
|
|
|
|
|
Not sure what you want exactly, however there are 4 overloads to DrawImageUnscaled, and 30 to DrawImage; there is bound to be one that can do what you want, remember you are allowed to give fractional and negative locations.
BTW: when drawing onto a Bitmap, use Graphics.FromImage().
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi
I'm having problems due to a cast (*), made by the software automatically, from string to MySqlDateTime;
Is there any way of writing the ctype operator for class string, to make the cast to MySqlDateTime ?
Can someone give some help???
(*) - the exception apears on a DataGridView, that is connected to a table in a mysql database.
I'm already using a CalendarColumn, found somewhere in the web, but as soon as I pick a value,
vb throws a exception throgh DataGridView.DataError event, saying: "invalid cast from System.String to MySql.Data.Types.MysqlDateTime"
|
|
|
|
|
Somebody might know the answer to your problem instantly, but for the rest of us, could you post the section of code where the error occurs so that we can suggest alternative strategies.
[Edit]
Just found this!
Take a look at this[^], the relevant part is a fair way down so you'll probably be better off doing a search for mysqldatetime
[/Edit]
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.”
modified on Monday, August 24, 2009 8:49 AM
|
|
|
|
|
|
I have NO code in my application to handle the input of the date,
just the necessary to create the datasource for the datagridview.
I use a CalendarColumn to pick a date in the column...
When I pick a value for the cell, and I "get out" of the cell, a exception is thrown, and a dialog with the error is displayed:
"Invalid cast from System.String to MySql.Data.Types.MySqlDateTime".
The call Stack in the message says that the error is thrown in the method PushFormattedValue,
that I suppose that cannot be overloaded (or whatever...)
PS: Sorry for my english
|
|
|
|
|
ok, never mind...
i think i just solved my problem with this code:
If e.DesiredType.Equals(GetType(MySql.Data.Types.MySqlDateTime)) Then
If String.IsNullOrEmpty(e.Value) Then
e.Value = DBNull.Value
Else
Try
e.Value = New MySql.Data.Types.MySqlDateTime(DateTime.Parse(e.Value))
Catch
e.Value = DBNull.Value
End Try
End If
e.ParsingApplied = True
End If
in the method
Private Sub DataGridCusto_CellParsing(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellParsingEventArgs) Handles DataGridCusto.CellParsing
thanks
|
|
|
|
|
Best Of Regards,
SOFTDEV
Sad like books with torn pages, sad like unfinished stories ...
|
|
|
|
|
how to know a button from a other application is Enable for me press it automatic ?
|
|
|
|
|
Any attempt to do this will be buggy and error prone, but I'm sure there is a windows API for getting a window state. A button is a window
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
If both apps are .NET then you could try using reflection. Not going to be easy.
Steve Jowett
-------------------------
Real programmers don't comment their code. If it was hard to write, it should be hard to read.
|
|
|
|
|
hi again,
i have program in vb.net 2005 and i will generate a report in crystal report 10 which is already a package in visual studio 2005. i have a sort of problem in report footer.
why is it i can't view any data from report footer? i drag the field from database field in field explorer. but when i drag it to page header section or detail section data is there. is it possible to have data in report footer or not? because in msaccess report, i dont have the problem in viewing the data in report footer, it goes well.
C# コードMicrosoft End User
2000-2008
「「「「「「「「「「「「「「「「「「「「「「「「「「「「
The best things in life are free
」」」」」」」」」」」」」」」」」」」」」」」」」」」」
|
|
|
|
|
Follow the below steps, atleast will get a solution.
1. Open your crystal reports, from the tool bar -> crystal report ->Insert ->summary
Then From Top Select Your -> field from datatable
2. Calculate this summry as -> Mode
3. Don't change-> Grand Total ( Report Footer )
Now, when you click 'OK' you acn find that field will be in your "report footer" save and run the report, you will get your expectation.
|
|
|
|
|
Hello All,
I am trying to create Image at runtime(Like : Mspaint) using text Picture Line,Rectangle,Ovel . but i have generate some problem in Picturebox.
When i m Draging control over Picturebox then try to print or copy it. At this time Control does not display.
If you can think then I Can.
|
|
|
|
|
Your issue is that you are clueless. Nothing that you're doing stands any chance of working. Did you consider trying to do some research instead of just inventing a theory and going with it ?
Your form has a method which will paint it to an image. A picture box is for people who can't program to show images on their form, that is all. If you want to draw an image, you need the Graphics class. MSDN has all the details
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
Got my 5!
|
|
|
|
|
and mine
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
Hi,
here are two bits of information for you:
1.
there are several relevant articles here on CodeProject (e.g. search for Paint.NET)
2.
I have a standard reply for such questions, here it goes (example code is C#, VB.NET would be similar):
there are several steps to correctly draw something; it does not matter how complex the paint job is: from a single line, to a complex drawing, or a real work of art.
To make sure it all becomes visible on the screen and gets repainted automatically when moving, resizing, minimizing/maximizing/restoring or uncovering your Form, one should follow these steps:
1.
decide upon what object you want to draw; it normally is a Control (e.g. a Panel) or a Form itself. I prefer to add a Panel to a Form, then draw on the Panel. And I do not like PictureBoxes, they are pretty useless.
2.
create some variables (Rectangle, struct, class, whatever) that hold the parameters of your drawing. For a rectangle that could be top and left coordinate, and width+height, or just a Rectangle. etc. For a complex drawing, it could be a List of objects that derive of a common type, each having its own PaintMe() method.
3.
create a Paint handler (either add your own paint handler to the Paint event, or override the OnPaint method) for that Panel, and do all your drawing in there, using the Graphics object inside the PaintEventArgs, and your variables. Do not call CreateGraphics!
4.
if and when you want to change things, modify the variables and call Panel.Invalidate() or one of its overloads (for selective invalidation).
5.
If you want to animate things, perform the move (step 4) inside the Tick handler of a Windows.Forms.Timer which ticks on the GUI thread, so you are allowed to call Invalidate() from there too.
BTW: if you need to create some objects (Fonts, Pens, Brushes, ...) either keep them
alive in class members (hence create them only once); or create them inside the Paint
handler and don't forget to call Dispose() on them.
C# example:
private Panel panel;
private bool paintRectFlag=true;
private Rectangle rect=new Rectangle(20, 20, 300, 200);
private Pen rectPen=Pens.Black;
public Form1() {
InitializeComponents();
panel=new Panel();
panel.Bounds=new Rectangle(…);
panel.Paint+=panelPaintHandler;
Controls.Add(panel);
}
protected void panelPaintHandler(object sender, PaintEventArgs e) {
Graphics g=e.Graphics;
if (paintRectFlag) g.DrawRectangle(rectPen, rect);
}
protected void buttonClickHandler(object sender, EventArgs e) {
paintRectFlag=!paintRectFlag;
panel.Invalidate();
}
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
hi,
i have lot of doubt in crystal report.
i have taken printout in 10*12 size paper.
how we can mention paper size in pragmatically ??
another one doubt i have taken printout for billing purpose.if we are going to take morethan one page, total amount is printing every page.
i dont need to print total amount in every page only last page.
plz help me very urgent
Yours,
KaNNaN
-----------------------------------------------------------------
"Success is When Ur Signature Becomes An Autograph"
Mail To : foreverkans@gmail.com
modified on Monday, August 24, 2009 3:06 AM
|
|
|
|
|