Now if i click on the picture box, i have given the code to retrive the color (ARGB) of background image where i clicked and then i have to colour the foreground image with the selected color from palette , The background image is the same image which is in picturebox1.image but it is coloured with block of dark colors for each parts. I have a image in picturebox, and the other image in the background of the picturebox. If Not Destino.Image Is Nothing Then ()Ĭodigo a insertar (From, Control, class.)īitBlt2(dest, 0, 0, 47, 47, Src, 0, 0, SRCAND)īitBlt2(dest, 0, 0, 47, 47, Mask, 0, 0, SRCINVERT) 'Clone the bitmap so we can dispose this one Public Sub BitBlt2(ByRef Destino As PictureBox, ByVal dX As Integer, ByVal dY As Integer, ByVal dW As Integer, ByVal dH As Integer, ByVal Origen As PictureBox, ByVal sX As Integer, ByVal sY As Integer, ByVal Flag As Integer)ĭim srcPic As Graphics = Destino.CreateGraphics 'Get a Graphics Object from the formĭim orgPic As Graphics = Origen.CreateGraphics 'Get a Graphics Object from the toĭim srcBmp As New Bitmap(src.Width, src.Height, srcPic) 'Create a EMPTY bitmap from that graphicsĭim srcMem As Graphics = Graphics.FromImage(srcBmp) 'Create a Graphics object in memory from that bitmapĭim HDC1 As IntPtr = orgPic.GetHdc 'get the IntPtr's of the graphicsĭim HDC2 As IntPtr = srcMem.GetHdc 'get the IntPtr's of the graphicsīitBlt(HDC2, dX, dY, dW, dH, HDC1, sX, sY, Flag) Public Const SRCAND As Integer = &H8800C6ĭeclare Auto Function BitBlt Lib "GDI32.DLL" ( _ Public Const SRCINVERT As Integer = &H660046 Public Const SRCCOPY As Integer = &HCC0020
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |