Sebenarnya ada banyak komponen untuk menggambar grafik, tapi gw kurang
suka karena gw selalu kesulitan untuk ngeprint hasilnya. Kalo sudah
begini, biasanya gw membuat sendiri grafiknya, asal tahu posisinya
titik2nya dimana grafik tersebut digambar. Pengetahuan sedikit
matematika sangat membantu untuk menggambar grafik, selanjutnya
tergantung imajinasi anda. Berikut ini sample code untuk menggambar
titik, garis, image, dan ngeprint hasilnya.
===============================
Private Sub cmdShowImage_Click()
Call Print_Grafik (Picture_Utama)
End Sub
Private Sub cmdPrint_Click()
Call Print_Grafik (Printer)
End Sub
Sub Print_Picture(ByVal obj as Object)
' Set font
obj.FontName = "Times New Roman"
obj.FontSize = 8
obj.DrawWidth = 2
obj.DrawStyle = 0
'print text and posistion text
Txt = "Title"
obj.CurrentX = X1
obj.CurrentY = Y1
obj.Print Txt
'print line with colour &HAEAEAE
obj.Line (X1,Y1)-(X2,Y2), &HAEAEAE
'print image
obj.PaintPicture Picture1, XPos1, YPos1,Width1, Height1
If TypeName(obj) = "Printer" Then
obj.EndDoc
End If
End Sub
Best regards
~subchan
________________________________
From: [email protected]
[mailto:[EMAIL PROTECTED] On Behalf Of Rudiana Nurhadian
Sent: Thursday, January 31, 2008 1:37 PM
To: [email protected]
Subject: [Programmer-VB] Bikin grafik
Halo semua master VB...
saya sedang menyusun program (untuk TA) yang dapat melakukan pembacaan
suhu secara periodik dan ingin ditampilkan dalam bentuk grafik langsung
di program VB nya tersebut.
Saya mohon pencerahannya neh, ada yang tau cara bikin grafik di VB ga?
(klo ada sekalian contohnya biar langsung saya pelajari)
terimakasih banyak. Forza Programmer Indonesia!!!
This email and any attachments are confidential and may also be privileged. If
you are not the addressee, do not disclose, copy, circulate or in any other way
use or rely on the information contained in this email or any attachments. If
received in error, notify the sender immediately and delete this email and any
attachments from your system. Emails cannot be guaranteed to be secure or
error free as the message and any attachments could be intercepted, corrupted,
lost, delayed, incomplete or amended. Standard Chartered PLC and its
subsidiaries do not accept liability for damage caused by this email or any
attachments and may monitor email traffic.
Standard Chartered PLC is incorporated in England with limited liability under
company number 966425 and has its registered office at 1 Aldermanbury Square,
London, EC2V 7SB.
Standard Chartered Bank ("SCB") is incorporated in England with limited
liability by Royal Charter 1853, under reference ZC18. The Principal Office of
SCB is situated in England at 1 Aldermanbury Square, London EC2V 7SB. In the
United Kingdom, SCB is authorised and regulated by the Financial Services
Authority under FSA register number 114276.
If you are receiving this email from SCB outside the UK, please click
http://www.standardchartered.com/global/email_disclaimer.html to refer to the
information on other jurisdictions.