|
Hi Dave,
what I am actually like to realise is to magnify a Picture 8 times,
every pixel should become a small rectangle.
And I like to hafe this magnification as a bitmap that can be shown in a PictureBox,
becaus than I can scroll the form of the PictureBox without loosing the Picture when it is coverd
by a other Form.
Regards,
Hans-Christian
|
|
|
|
|
For a beginner, you're tackling a pretty complex subject with Win32/GDI...
OK... It's a real pain, but here goes. Of course, you have to have the Declares for StretchBlt, SelectObject, DeleteObject, and DeleteDC created to use this...
Private Sub CreateMagnifiedImage(ByVal MagFactor As Integer, ByVal srcBitmap As Bitmap) As Bitmap
If srcBitmap IsNot Nothing Then
Dim magSize As New Size(srcBitmap.Width * MagFactor, srcBitmap.Height * MagFactor)
Dim magBitmap As New Bitmap(magSize.Width, magSize.Height)
Dim g As Graphics = Graphics.FromImage(magBitmap)
DrawMagnifiedImage(g, srcBitmap, magSize)
g.Dispose()
End If
End Sub
' This is the code Ive used before to magnifiy an image...
Private Sub DrawMagnifiedImage(ByVal gTarget As Graphics, ByVal srcBitmap As Bitmap, ByVal newSize As Size)
Dim hBmp as IntPtr = srcBitmap.GetHbitmap()
Dim hdcTarget As IntPtr = gTarget.GetHdc()
Dim hdcSource As IntPtr = CreateCompatibleDC(hdcTarget)
Dim hOrig As IntPtr = SelectObject(hdcSrc, hBmp)
StretchBlt(hdcTarget, 0, 0, newSize.Width, newSize.Height, hdcSource, 0, 0, srcBitmap.Wdith, srcBitmap.Height, TernaryRasterOperations.SRCCOPY)
SelectObject(hdcSource, hOrig)
DeleteObject(hBmp)
DeleteDC(hdcSource)
gTarget.Release(hdcTarget)
End Sub
|
|
|
|
|
Hi Dave,
Thank you! This was it was I am looking for, since weeks!
Hans-Christian
|
|
|
|
|
can anybody let me the oops concept in .net with an example. how to use polymorphism, abstract class, encapsulation in our application.
thanks for your help.
Rafeeque
|
|
|
|
|
With "an example"?? That's simply not possible. OOP concepts take entire books to cover. One or two examples in a forum environment simply is not going to be enough to cover the huge scope of your question. About the only suggest we can make is to get a compule of books. Search Amazon for "OOP VB.NET" or "VB.NET Beginner" and you'll come up with a bunch of them.
|
|
|
|
|
Sounds more like general homework questions to me.
__________________
Bob is my homeboy.
|
|
|
|
|
Doesn't change my answer!
|
|
|
|
|
Dave Kreskowiak wrote: Doesn't change my answer!
Yep. Homework or not, same answer
|
|
|
|
|
I wasn't disagreeing with your answer!
__________________
Bob is my homeboy.
|
|
|
|
|
i know its not simple to explain. give some brief notes or good links for encapsulation, polymorphism, abstract class with some coding example. and how it will use in our application.??
thanks for your help
|
|
|
|
|
You're still asking for WAY TOO MUCH information for a forum environment. Don't make me repeat myself.
|
|
|
|
|
Dear Mr. Dave Kreskowiak
Microsoft MVP Visual Developer
Thanks for your help. If you don't want to give me a link, tell me clearly. why r u dropping such kind of hurt message. Anyhow one of my good friend given the following link
http://www.c-sharpcorner.com/UploadFile/eecabral/OOPSand.NET211102005075520AM/OOPSand.NET2.aspx
Thanks for your co-operation.
Regards
Rafeeque Ahmed
|
|
|
|
|
That article just scrathes the surface. There's far more to OOP than what's in that article.
|
|
|
|
|
i hv developed an application in vb.net its having more 50 forms. when i open the same in vs.net my pc become slow. when the application is running, the pc get slow. this application was developed for Electrical Company and having 10 different users to access their option. the database also having much more (means 2 lakhs) record under one table not in every tables. some its giving error 'time out expired' while retrieving datas from the table.
what is best way to develop an application. what is procedure. what are things to be careful while developing an application?????. for retrieving data im using sqldatapter and filling in dataset. after that im not closing the connection. i read from some vb.net help book that if you fill the tables in dataset, after its filled in dataset its closing the connection automatically. im using sqlcommand and executenonquery to store information to the table.
it's a memory problem, obviously i would need to figure why so much memory is being used. It could be a problem with my code or perhaps just a problem due to the amount of data im retrieving.
kindly help
Rafeeque ahmed
|
|
|
|
|
Rafeeque Ahmed wrote: what is best way to develop an application.
Entire books are written on this subject alone. There is really no way of answering your question because of it's broad scope.
Rafeeque Ahmed wrote: what is procedure.
Again, another book.
Rafeeque Ahmed wrote: what are things to be careful while developing an application?????.
And another...
Rafeeque Ahmed wrote: it's a memory problem, obviously
No, it's not. It a major design problem with your app. Since we know nothing of your application, what's it's purpose is, what the slow parts of the app are, the structure of your database, the amount of data you REALLY need to be retrieving, are you using the appropriate methods for manipulting the data, are your queries optimized for the data and operation in question, ..., on and on and on, ... There is really nothing we can answer here other than suggesting a design review of your database, then a complete code review to veryify that you're doing things in the most advantageous way possible.
|
|
|
|
|
Your application performance problem can be one or more of many things. I would re-look over the entire design and see where there are potential bottlenecks and address them.
Rafeeque Ahmed wrote: what is best way to develop an application. what is procedure. what are things to be careful while developing an application?????
Like Dave said, this would require entire books or full term university coursework to cover...I would look around at a few books or on the web...
|
|
|
|
|
Iam using Webbrowser control in VB6 for Reporting and Printing.
While printing it also prints IE Header and Footer.
I searched many times from the google. But i didnt get any relevant result also.
I need to disable the Header and Footer of Webbowser control using VB, not manually from the page setup of IE.
And also to diable the Keyboard events for the Webbrowser.
Its very urgent!!!!
Please guide me.
Thanks & Regards
Kumaran
|
|
|
|
|
Hello,
How can i load a textfile into a textbox?
i tried:
dim txt as string
FileOpen(...)
Input(1, txt)
textbox1.text = txt
FileClose(1)
when i try this, i only get the first line of the file and not the lines below. how can i open a complete textfile and load it's (complete!) text into a textbox?
thanks in advance,
--Zaegra--
|
|
|
|
|
FileName = App.path & "\TextFile.txt"
Open FileName For Input As 1
whole_file = Input$(LOF(1), #1)
Close 1
Text1.Text = whole_file
Note : if the file contains more than one line you have to set the textbox control to multiline is true and their scrolls.
Thanks & Regards
Kumaran
|
|
|
|
|
Thanks, I will check this out
|
|
|
|
|
What's the process to submit an article of vb.net in this site?
|
|
|
|
|
|
Nilish wrote: What's the process to submit an article of vb.net in this site?
Just like how any other article on this site. Go to the Submission Wizard link that Dave provided...
|
|
|
|
|
Hi Every one,
I am trying to create a crystal report with custome paper size, but i won't be to do so.
Please help me to solve this issue.
|
|
|
|
|