Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > .NET Languages
You last visited: Today at 19:45

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[VB] Wie ruft man diese Function auf?

Discussion on [VB] Wie ruft man diese Function auf? within the .NET Languages forum part of the Coders Den category.

Reply
 
Old   #1

 
EasyFarm's Avatar
 
elite*gold: 281
Join Date: May 2011
Posts: 1,547
Received Thanks: 942
[VB] Wie ruft man diese Function auf?

Hi.

Kleines problem ^^
Ich habe 3 Pictureboxen, 2 möchte ich kombinieren und in der 3 anzeigen.
So sieht meine Function aus:

Code:
 Private Function ImageAddColorEffect(image1 As Bitmap, image2 As Bitmap) As Bitmap
        Dim NewBitmap As New Bitmap(image1.Width, image1.Height)
        For X As Integer = 0 To image1.Width - 1
            For Y As Integer = 0 To image1.Height - 1
                Dim R As Integer = Math.Min(CInt(image1.GetPixel(X, Y).R) + image2.GetPixel(X, Y).R, 255)
                Dim G As Integer = Math.Min(CInt(image1.GetPixel(X, Y).G) + image2.GetPixel(X, Y).G, 255)
                Dim B As Integer = Math.Min(CInt(image1.GetPixel(X, Y).B) + image2.GetPixel(X, Y).B, 255)
                Dim NewColor As Color = Color.FromArgb(R, G, B)
                NewBitmap.SetPixel(X, Y, NewColor)
            Next
        Next
        Return NewBitmap
    End Function
Doch wie rufe ich diese auf?

Danke :S
Mfg. Easy
EasyFarm is offline  
Old 09/21/2013, 18:20   #2
 
tolio's Avatar
 
elite*gold: 2932
The Black Market: 169/1/0
Join Date: Oct 2009
Posts: 6,966
Received Thanks: 1,097
die bilder aus box 1 und 2 zu bitmaps machen und als parameter angeben und das ergebniss in box 3 ausgeben

wenn dir das nicht klar ist lass sein was auch immer du da tust sein, gehe zurück auf los und fang mit programmieren lernen von vorne an
tolio is offline  
Thanks
1 User
Old 09/22/2013, 08:37   #3
 
elite*gold: 0
Join Date: Jun 2013
Posts: 44
Received Thanks: 2
Code:
PictureBox3.Image = ImageAddColorEffect(PictureBox1.Image, PictureBox2.Image)
Ungetestet!
VBJ is offline  
Old 09/22/2013, 14:26   #4
 
tolio's Avatar
 
elite*gold: 2932
The Black Market: 169/1/0
Join Date: Oct 2009
Posts: 6,966
Received Thanks: 1,097
^afaik ist ein image ist vom typ image und nicht bitmap
tolio is offline  
Old 09/22/2013, 14:34   #5
 
elite*gold: 0
Join Date: Jun 2013
Posts: 44
Received Thanks: 2
Dann:

Dim bmp as Bitmap = PictureBox1.image
Dim bmp2 as Bitmap = PictureBox2.image
PictureBox3.Image = ImageAddColorEffect(bmp, bmp2)
VBJ is offline  
Old 09/22/2013, 15:07   #6
 
tolio's Avatar
 
elite*gold: 2932
The Black Market: 169/1/0
Join Date: Oct 2009
Posts: 6,966
Received Thanks: 1,097
nen image ist immernoch kein bitmap

option strict und sowas
es gibt mit sicherheit entsprechende methoden die die image oder bitmap klassen bereitstellen um das zu konvertieren, aber mit nem gleich ist es nicht getan, implizierte konvertierung, vorallem bei komplexen typen kann gewaltig schief gehen
tolio is offline  
Thanks
1 User
Old 09/22/2013, 16:10   #7
 
elite*gold: 1000
Join Date: Apr 2012
Posts: 1,003
Received Thanks: 208
Quote:
Dim bmp As Bitmap = DirectCast(pictureBox1.Image, Bitmap)
Dim bmp2 As Bitmap = DirectCast(pictureBox2.Image, Bitmap)
pictureBox3.Image = ImageAddColorEffect(bmp, bmp2)
So ist es richtig.
qkuh is offline  
Old 09/22/2013, 16:17   #8
 
tolio's Avatar
 
elite*gold: 2932
The Black Market: 169/1/0
Join Date: Oct 2009
Posts: 6,966
Received Thanks: 1,097
ich würde den konstruktor direkt nutzen

dim bmp as bitmap = new bitmap(image)
tolio is offline  
Reply


Similar Threads Similar Threads
Running Function 2 after Function 1 finished
09/15/2013 - AutoIt - 3 Replies
Hey, its me again. Im stuck on a problem since yesterday and as much as i hate to ask for help, i really dont know what else to try. I want Function 2 to run after Function 1 has finished. I tried GuiCtrlSetOnEvent and MsgLoop, but i dont really understand it. I tried to read tutorials but they didnt help at all. The line that are underline is what im talking about. I want gamestart() to run first and when its finished, i want iniviteteam() to run. #AutoIt3Wrapper_UseX64=n...
clickandbuy ruft an?!
04/16/2011 - Main - 4 Replies
Hallo, vor nem Monat oder so wurden meine kompletten Accounts durch einen Stealer/Keylogger geklaut. Das heißt: epvp(alter Account), facebook, Email, Webhosting(hab ich durch den Hoster wieder), clickandbuy, ICQ, Skype Heute hat clickandbuy angerufen & wollte mit mir sprechen. Da ich jedoch noch geschlafen habe, wollten die später wieder anrufen. Die wollten mit meinem Vater nicht sprechen. Warum rufen die an? Von meinem Konto wurde nichts abgebucht & joa. Könnte es sein, weil ich die...
wie ruft man ..
09/23/2010 - Metin2 Private Server - 10 Replies
wie ruft man die neuen reittiere
Tingle ruft auf!
04/25/2008 - WoW Private Server - 4 Replies
Hallo liebe Pserver zocker! Wie schon bekannst ist gibt es einen eigenen privat server für diese community! http://www.elitepvpers.com/forum/e-pvp-news/129028- e-pvp-project-denim.html ich würde alle hier bitten es doch mal anzuschaun, und drauf zu spielen. da ich als debugger eingestellt bin, würde ich mich freuen wenn ihr spielt und bugs das ihr findet an gm's schickt bzw gm tickets schreibt! Weil ohne user keine buggs :/. freu mich euch darauf zu sehn!



All times are GMT +2. The time now is 19:45.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.