Please,I have same problem
Please I have same problem with ExtFloodFill function in VB.NET.
If you can ,please, send me the code at [email protected].
Please it is very urgent.
PLEASE!!!!!!!!!!!
Thanks
Re: [Resolved] ExtFloodFill
Can you aslo send the sample to me? I'm also in the same problem... :sick:
To : [email protected]
Re: [Resolved] ExtFloodFill
You should not post your email addreses into ANY open forum.
Bots will pick it up and you will be spammed by solicitors.
You can PM your email address to anyone on the board.
If you must, you should use the word AT instead of the symbol @
Quote:
spamMe AT vbforums.com
Re: [Resolved] ExtFloodFill
I don't get it work :S...
If I use it then it will be only white :S
See the code :
Code:
Declare Function BitBlt Lib "gdi32" Alias "BitBlt" (ByVal hDestDC As Integer, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hSrcDC As Integer, ByVal xSrc As Integer, ByVal ySrc As Integer, ByVal dwRop As Integer) As Integer
Declare Function DeleteDC Lib "gdi32" Alias "DeleteDC" (ByVal hdc As Integer) As Integer
Declare Function SelectObject Lib "gdi32" Alias "SelectObject" (ByVal hdc As Integer, ByVal hObject As Integer) As Integer
Declare Function CreateCompatibleDC Lib "gdi32" Alias "CreateCompatibleDC" (ByVal hdc As Integer) As Integer
Declare Function FloodFill Lib "gdi32" Alias "FloodFill" (ByVal hdc As Integer, ByVal x As Integer, ByVal y As Integer, ByVal crColor As Integer) As Integer
Declare Function ExtFloodFill Lib "gdi32" Alias "ExtFloodFill" (ByVal hdc As Integer, ByVal x As Integer, ByVal y As Integer, ByVal crColor As Integer, ByVal wFillType As Integer) As Integer
Declare Function CreateCompatibleBitmap Lib "gdi32" Alias "CreateCompatibleBitmap" (ByVal hdc As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer) As Integer
Const SRCCOPY As Integer = &HCC0020
Const SRCINVERT As Integer = &H660046
Sub Main()
Dim bmp1, bmp2 As Bitmap
Dim g1, g2 As Graphics
Dim hdc1, hdc2 As IntPtr
Dim oldBmp As IntPtr
bmp1 = New Bitmap("pic.bmp")
g1 = Graphics.FromImage(bmp1)
hdc1 = g1.GetHdc
hdc2 = CreateCompatibleDC(hdc1)
oldBmp = SelectObject(hdc2, bmp1.GetHbitmap())
ExtFloodFill(hdc2, 5, 5, &HFF00, 0)
BitBlt(hdc1, 0, 0, 50, 50, hdc2, 0, 0, SRCCOPY)
SelectObject(hdc2, oldBmp)
DeleteDC(hdc2)
g1.ReleaseHdc(hdc1)
g1.Dispose()
bmp1.Save("test1.bmp")
End Sub
test1.bmp is just white :ehh:
Re: [Resolved] ExtFloodFill
hi ,
i have problem with the floodfill algorithm
i have a form with 4 text boxes use for entering 4 numbers and a commoand button that draws a pie chart depending on the numbers from the text boxes on picture box(pic1) , the problem is that the code draws the outlines of the chart but i want it to be filled with colors
does anyone know how to do that
here is the code:
Private Sub draw_Click()
Pic1.Cls
Pic1.DrawWidth = 7
Sum = Val(Text1.Text) + (Text2.Text) + (Text3.Text) + (Text4.Text)
p11 = Val(Text1.Text) / Sum * 6.28
p12 = Val(Text2.Text) / Sum * 6.28
p13 = Val(Text3.Text) / Sum * 6.28
p14 = Val(Text4.Text) / Sum * 6.28
Pic1.Circle (4000, 4000), 1500, vbRed, 0, -p11
Pic1.Circle (4000, 4000), 1500, vbGreen, -p11, -(p11 + p12)
Pic1.Circle (4000, 4000), 1500, vbBlue, -(p11 + p12), -(p11 + p12 + p13)
Pic1.Circle (4000, 4000), 1500, vbYellow, -(p11 + p12 + p13), -6.28
end sub
sorry for my weak english , i really need help