16,015,108 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by MinhajAli (Top 15 by date)
MinhajAli
5-May-17 13:58pm
View
Thank you for your reply.
I will try
MinhajAli
22-Jun-16 15:00pm
View
using the above code I am getting notification but it's blank (without message) .
MinhajAli
22-Jun-16 14:58pm
View
I am getting the same problem. could you please help.
how do you solve the issue.
MinhajAli
1-Jan-16 12:07pm
View
Thanks for your reply. Actually i am week in this area.
I am trying it. I will get back to you.
MinhajAli
31-Dec-15 1:08am
View
Thanks all for your reply.
but still i need the solution.
MinhajAli
22-Dec-15 11:39am
View
Thanks for your reply.
i follow your given link but no luck.
In my case i am loading an image on pucturebox and counting the mouse click on that image for finding specific thing on image.Suppose i am loading the image of Hair and the user want to count the hair. for user information i am drawing rectangle on it that which hair user had already count.
if user mistakenly click on wrong place than there is a button to undo so how to remove that particular rectangle.
is there any other solution..?
MinhajAli
22-Dec-15 10:14am
View
Thanks for reply.
But Picturebox.Invalidate is not forcing to redraw in my case.
actually i am loading an image in picturebox and on that image i am drawing the rectangle on MouseDown event.
MinhajAli
31-Jul-13 6:35am
View
@Nelek
actualy i am not able to find math angles, means x and y point. for creating perpendicular line.
in this application we have x1,y1,x2,y2 points,
if you show how to find x3,y3,x4,y4 value then i can solve my problem.
MinhajAli
31-Jul-13 6:24am
View
Deleted
I have usage
Public Class Form2
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
picRegion.Image = Image.FromFile("C:/ss.jpg")
End Sub
Private m_BufferGraphics As Graphics
Private m_Drawing As Boolean
Private m_BufferBitmap As Bitmap
Private m_X1 As Integer
Private m_Y1 As Integer
Private m_X2 As Integer
Private m_Y2 As Integer
Private m_X3 As Integer
Private m_Y3 As Integer
Private m_X4 As Integer
Private m_Y4 As Integer
Private Sub PictureBox1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles picRegion.MouseDown
If e.Button <> MouseButtons.Left Then Exit Sub
m_Drawing = True
SaveSnapshot()
m_X1 = e.X
m_Y1 = e.Y
End Sub
Private Sub SaveSnapshot()
Dim new_bitmap As Bitmap
new_bitmap = New Bitmap(Me.picRegion.Image.Size.Width, Me.picRegion.Image.Size.Height, Me.picRegion.CreateGraphics())
m_BufferGraphics = Graphics.FromImage(picRegion.Image)
m_BufferBitmap = new_bitmap
End Sub
Private Sub PrivewForm(ByVal gr As Graphics)
If Not (m_BufferBitmap Is Nothing) Then gr.DrawImage(m_BufferBitmap, 0, 0)
End Sub
Private Sub PictureBox1_MouseMove(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles picRegion.MouseMove
If Not m_Drawing Then Exit Sub
m_X2 = e.X
m_Y2 = e.Y
PrivewForm(Me.picRegion.CreateGraphics())
Me.picRegion.Refresh()
Dim pen As New Pen(Color.Crimson, 3)
Me.picRegion.CreateGraphics().DrawLine(pen, m_X1, m_Y1, m_X2, m_Y2)
PrivewForm(Me.picRegion.CreateGraphics())
'perpendicular line
End Sub
Private Sub PictureBox1_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles picRegion.MouseUp
If Not m_Drawing Then Exit Sub
m_Drawing = False
m_X2 = e.X
m_Y2 = e.Y
Dim pen2 As New Pen(Color.Crimson, 3)
m_BufferGraphics.DrawLine(pen2, m_X1, m_Y1, e.X, e.Y)
Me.picRegion.Refresh()
If m_Y1 = m_Y2 Then
m_X3 = m_X1
m_Y3 = m_Y1 - 15
m_X4 = m_X1
m_Y4 = m_Y1 + 15
Dim pen31 As New Pen(Color.Cyan, 3)
m_BufferGraphics.DrawLine(pen31, m_X3, m_Y3, m_X4, m_Y4)
Me.picRegion.Refresh()
m_X3 = m_X2
m_Y3 = m_Y2 - 15
m_X4 = m_X2
m_Y4 = m_Y2 + 15
Dim pen32 As New Pen(Color.Cyan, 3)
m_BufferGraphics.DrawLine(pen32, m_X3, m_Y3, m_X4, m_Y4)
Me.picRegion.Refresh()
End If
End Sub
End Class
MinhajAli
27-Jul-13 3:24am
View
Thanks alot Excellent answer
MinhajAli
30-Mar-13 8:12am
View
Thanks for reply.
yes there was a problem with installer thats why i was facing problem. now i have resolved by another process.
when my application will run first time i have added code for registered all dll. and now its runing fine.
MinhajAli
18-Dec-12 6:38am
View
I am using Avicap32.dll
MinhajAli
22-Nov-12 6:12am
View
Thank you for Reply.
but its not returning device name.
Message box is displaying "Microsoft WDm Image Capture (Win32)"
where as i am using the device which are.
1.DinoCapture 2.0
2.Frontech Gill2225.
and i have usage the code ...
Const WM_CAP As Short = &H400S
Const WM_CAP_DRIVER_CONNECT As Integer = WM_CAP + 10
Const WM_CAP_DRIVER_DISCONNECT As Integer = WM_CAP + 11
Const WM_CAP_EDIT_COPY As Integer = WM_CAP + 30
Const WM_CAP_SET_PREVIEW As Integer = WM_CAP + 50
Const WM_CAP_SET_PREVIEWRATE As Integer = WM_CAP + 52
Const WM_CAP_SET_SCALE As Integer = WM_CAP + 53
Const WS_CHILD As Integer = &H40000000
Const WS_VISIBLE As Integer = &H10000000
Const SWP_NOMOVE As Short = &H2S
Const SWP_NOSIZE As Short = 1
Const SWP_NOZORDER As Short = &H4S
Const HWND_BOTTOM As Short = 1
Dim iDevice As Integer = 0 ' = "{6BDD1FC6-810F-11D0-BEC7-08002BE2092F}\0004" ' Current device ID
Dim hHwnd As Integer ' Handle to preview window
Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, _
<marshalas(unmanagedtype.asany)> ByVal lParam As Object) As Integer
Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos" (ByVal hwnd As Integer, _
ByVal hWndInsertAfter As Integer, ByVal x As Integer, ByVal y As Integer, _
ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer) As Integer
Declare Function DestroyWindow Lib "user32" (ByVal hndw As Integer) As Boolean
Declare Function capCreateCaptureWindowA Lib "avicap32.dll" _
(ByVal lpszWindowName As String, ByVal dwStyle As Integer, _
ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, _
ByVal nHeight As Short, ByVal hWndParent As Integer, _
ByVal nID As Integer) As Integer
Declare Function capGetDriverDescriptionA Lib "avicap32.dll" (ByVal wDriver As Short, _
ByVal lpszName As String, ByVal cbName As Integer, ByVal lpszVer As String, _
ByVal cbVer As Integer) As Boolean
Private Sub OpenForm()
Try
Dim strName As String = Space(100)
Dim strVer As String = Space(100)
Dim bReturn As Boolean
Dim x As Short = 0
Do
bReturn = capGetDriverDescriptionA(x, strName, 100, strVer, 100)
MsgBox("Device name =" & strName)
x += CType(1, Short)
Loop Until bReturn = False
Dim iHeight As Integer = picCapture.Height
Dim iWidth As Integer = picCapture.Width
hHwnd = capCreateCaptureWindowA(iDevice.ToString, WS_VISIBLE Or WS_CHILD, 0, 0, 640, _
480, picCapture.Handle.ToInt32, 0)
'
' Connect to device
'
If SendMessage(hHwnd, WM_CAP_DRIVER_CONNECT, iDevice, 0) Then
SendMessage(hHwnd, WM_CAP_SET_SCALE, True, 0)
SendMessage(hHwnd, WM_CAP_SET_PREVIEWRATE, 66, 0)
SendMessage(hHwnd, WM_CAP_SET_PREVIEW, True, 0)
SetWindowPos(hHwnd, HWND_BOTTOM, 0, 0, picCapture.Width, picCapture.Height, _
SWP_NOMOVE Or SWP_NOZORDER)
End If
Catch ex As Exception
End Try
End Sub
and on form loading evet i am calling OpenForm() function.
MinhajAli
3-Aug-12 4:22am
View
Deleted
Thanks for Reply...
But i solve the problem using itextsharp.dll
i have usage this code.
public void CreatePdf()
{
Document pdfdoc = new Document(PageSize.A4, 50, 50, 25, 25);
PdfWriter.GetInstance(pdfdoc, new System.IO.FileStream(Application.StartupPath + "/Report/Report.pdf", System.IO.FileMode.Create));
pdfdoc.Open();
int i;
PdfPTable table = new PdfPTable(8);
PdfPCell cell = new PdfPCell();
table.WidthPercentage = 100;
for (i = 0; i <= 6; i++)
{
if (i == 0)
{
table.AddCell("Day");
table.AddCell("Period 1");
table.AddCell("Period 2");
table.AddCell("Period 3");
table.AddCell("Period 4");
table.AddCell("Period 5");
table.AddCell("Period 6");
table.AddCell("Period 7");
}
if (i == 1)
{
i = i-1;
table.AddCell("Monday");
table.AddCell(dataGridViewRoutine.Rows[i].Cells[1].Value.ToString());
table.AddCell(dataGridViewRoutine.Rows[i].Cells[2].Value.ToString());
table.AddCell(dataGridViewRoutine.Rows[i].Cells[3].Value.ToString());
table.AddCell(dataGridViewRoutine.Rows[i].Cells[4].Value.ToString());
table.AddCell(dataGridViewRoutine.Rows[i].Cells[5].Value.ToString());
table.AddCell(dataGridViewRoutine.Rows[i].Cells[6].Value.ToString());
table.AddCell(dataGridViewRoutine.Rows[i].Cells[7].Value.ToString());
i = i + 1;
}
else if (i == 2)
{
i = i - 1;
table.AddCell("Tuesday");
table.AddCell(dataGridViewRoutine.Rows[i].Cells[1].Value.ToString());
table.AddCell(dataGridViewRoutine.Rows[i].Cells[2].Value.ToString());
table.AddCell(dataGridViewRoutine.Rows[i].Cells[3].Value.ToString());
table.AddCell(dataGridViewRoutine.Rows[i].Cells[4].Value.ToString());
table.AddCell(dataGridViewRoutine.Rows[i].Cells[5].Value.ToString());
table.AddCell(dataGridViewRoutine.Rows[i].Cells[6].Value.ToString());
table.AddCell(dataGridViewRoutine.Rows[i].Cells[7].Value.ToString());
i = i + 1;
}
else if (i == 3)
{
i = i - 1;
table.AddCell("Wednesday");
table.AddCell(dataGridViewRoutine.Rows[i].Cells[1].Value.ToString());
table.AddCell(dataGridViewRoutine.Rows[i].Cells[2].Value.ToString());
table.AddCell(dataGridViewRoutine.Rows[i].Cells[3].Value.ToString());
table.AddCell(dataGridViewRoutine.Rows[i].Cells[4].Value.ToString());
table.AddCell(dataGridViewRoutine.Rows[i].Cells[5].Value.ToString());
table.AddCell(dataGridViewRoutine.Rows[i].Cells[6].Value.ToString());
table.AddCell(dataGridViewRoutine.Rows[i].Cells[7].Value.ToString());
i = i + 1;
}
}
MinhajAli
22-Jun-12 5:31am
View
Restart Visual studio.. you will fing your package as pre requisite
Hi I am Finding package in Prerequisites but its neither installing the MySQL nor giving any error or message...
If Any One have Any Idea....Reply....
Show More