Click here to Skip to main content
15,896,507 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: How to get the path for font folder Pin
Chatura Dilan6-Feb-06 1:05
Chatura Dilan6-Feb-06 1:05 
GeneralRe: How to get the path for font folder Pin
Dave Kreskowiak6-Feb-06 2:36
mveDave Kreskowiak6-Feb-06 2:36 
QuestionDirect Read/Write access to disk sectors Pin
IH8Microsoft4-Feb-06 14:29
IH8Microsoft4-Feb-06 14:29 
AnswerRe: Direct Read/Write access to disk sectors Pin
Dave Kreskowiak5-Feb-06 3:55
mveDave Kreskowiak5-Feb-06 3:55 
GeneralRe: Direct Read/Write access to disk sectors Pin
IH8Microsoft5-Feb-06 7:50
IH8Microsoft5-Feb-06 7:50 
GeneralRe: Direct Read/Write access to disk sectors Pin
Dave Kreskowiak5-Feb-06 8:00
mveDave Kreskowiak5-Feb-06 8:00 
GeneralRe: Direct Read/Write access to disk sectors Pin
IH8Microsoft5-Feb-06 8:56
IH8Microsoft5-Feb-06 8:56 
QuestionHow can I resize an image? the code is included! Pin
JUNEYT4-Feb-06 4:35
JUNEYT4-Feb-06 4:35 
Hello! Confused | :confused:

I have been trying to resize an image (which is loaded to Picturebox1). The actual image size is greater than the size of Picturebox1. The picturebox1 uses strechimage attribute. My aim is to adjust the loaded image size and write it as a watermark on to another image. It writes but it doesn't resize the image according to size of the picturebox1 Width & Height. It is using the original size of the image when it writes.

If you have an idea why that happens, please let me know!

Thanks!

CODE::

Private Function DrawImageCallback(ByVal callBackData As IntPtr) As Boolean

'Test for call that passes callBackData parameter.

If callBackData.Equals(IntPtr.Zero) Then
' If no callBackData passed, abort DrawImage method.
Return True
Else
' If callBackData passed, continue DrawImage method.
Return False
End If

End Function



' Copy the watermark image over the result image.
Private Sub DrawWatermark(ByVal watermark_bm As Bitmap, _
ByVal result_bm As Bitmap, ByVal x As Integer, ByVal y As Integer)

Dim imageCallback As New Graphics.DrawImageAbort(AddressOf DrawImageCallback)
Dim imageCallbackData As New IntPtr(1)

' Create rectangle for adjusted image.
Dim destRect2 As New Rectangle(PictureBox1.Location.X, PictureBox1.Location.Y, PictureBox1.Width, PictureBox1.Height)

Dim es As Graphics = Graphics.FromImage(result_bm)
es.InterpolationMode = Drawing2D.InterpolationMode.HighQualityBicubic

' Create image attributes and set large gamma.
Dim imageAttr As New ImageAttributes()

'imageAttr.SetGamma(4.0F)

' Draw adjusted image to screen.
es.DrawImage(watermark_bm, destRect2, x, y, PictureBox1.Width, PictureBox1.Height, GraphicsUnit.Pixel, imageAttr, imageCallback, imageCallbackData)

End Sub
AnswerRe: How can I resize an image? the code is included! Pin
Guffa4-Feb-06 7:40
Guffa4-Feb-06 7:40 
GeneralRe: How can I resize an image? the code is included! Pin
JUNEYT4-Feb-06 12:25
JUNEYT4-Feb-06 12:25 
AnswerRe: How can I resize an image? the code is included! Pin
Guffa4-Feb-06 12:47
Guffa4-Feb-06 12:47 
GeneralRe: How can I resize an image? the code is included! Pin
JUNEYT4-Feb-06 23:29
JUNEYT4-Feb-06 23:29 
QuestionReport writers for VB.NET Pin
trimtrom4-Feb-06 4:16
trimtrom4-Feb-06 4:16 
QuestionSql access using web service Pin
intrigued4-Feb-06 1:14
intrigued4-Feb-06 1:14 
QuestionUseing Stored Procedure Pin
alien viper3-Feb-06 23:22
alien viper3-Feb-06 23:22 
AnswerRe: Useing Stored Procedure Pin
Guffa3-Feb-06 23:35
Guffa3-Feb-06 23:35 
QuestionHow can I access to scanner vb.net? Pin
JUNEYT3-Feb-06 23:11
JUNEYT3-Feb-06 23:11 
QuestionPInvoke issue Pin
jimjo3-Feb-06 21:27
jimjo3-Feb-06 21:27 
Questioninserting into database Pin
raj kumar reddy3-Feb-06 17:44
raj kumar reddy3-Feb-06 17:44 
AnswerRe: inserting into database Pin
Rana Muhammad Javed Khan3-Feb-06 19:01
Rana Muhammad Javed Khan3-Feb-06 19:01 
AnswerRe: inserting into database Pin
S Douglas3-Feb-06 22:12
professionalS Douglas3-Feb-06 22:12 
QuestionGet Ip Address and put it in TextBox1?? Pin
Darshon3-Feb-06 12:12
Darshon3-Feb-06 12:12 
AnswerRe: Get Ip Address and put it in TextBox1?? Pin
Jason McBurney3-Feb-06 12:43
Jason McBurney3-Feb-06 12:43 
GeneralRe: Get Ip Address and put it in TextBox1?? Pin
Darshon3-Feb-06 19:30
Darshon3-Feb-06 19:30 
GeneralRe: Get Ip Address and put it in TextBox1?? Pin
Jason McBurney7-Feb-06 5:40
Jason McBurney7-Feb-06 5:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.