Visual Basic 中学校 掲示板 投稿の管理
タグのない投稿を抽出
統計
RSS
Visual Basic 中学校
投稿一覧
他の色で囲まれた部分を塗りつぶす
この投稿へのリンク
https://keijiban.umayadia.com/ThreadDetail.aspx?ThreadId=10945#CommentId24161
この投稿の削除
削除パスワード
削除する
コメント本文
投稿者
下田の住人
 (社会人)
投稿日時
2012/7/12 13:43:31
ご参考までに。
以下odeは
http://rucio.cloudapp.net/ThreadDetail.aspx?ThreadId=10691
をもとに作成しました。
PictureBoxが2つ、Labelが2つ、Button 1つをご用意下さい。
[CODE]
Imports System.Runtime.InteropServices
Public Class Form1
Private Declare Function ExtFloodFill Lib "gdi32" ( _
ByVal hdc As IntPtr, _
ByVal x As Integer, _
ByVal y As Integer, _
ByVal crColor As Integer, _
ByVal wFillType As UInteger) As Boolean
Private Declare Function CreateBrushIndirect Lib "gdi32" (ByRef lpLogBrush As LOGBRUSH) As IntPtr
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean
Private Declare Function GetWindowDC Lib "user32" (ByVal hwnd As IntPtr) As IntPtr
Private Declare Function ReleaseDC Lib "user32" (ByVal hwnd As IntPtr, ByVal hdc As IntPtr) As <MarshalAs(UnmanagedType.Bool)> Boolean
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As IntPtr, _
ByVal hObject As Integer) As <MarshalAs(UnmanagedType.Bool)> Boolean
Private Declare Function GetPixel Lib "gdi32" Alias "GetPixel" (ByVal hdc As IntPtr, ByVal x As Integer, ByVal y As Integer) As Integer
Private Declare Function CreateCompatibleDC Lib "gdi32" Alias "CreateCompatibleDC" (ByVal hdc As IntPtr) As IntPtr
Declare Auto Function BitBlt Lib "GDI32.DLL" ( _
ByVal hdcDest As IntPtr, _
ByVal nXDest As Integer, _
ByVal nYDest As Integer, _
ByVal nWidth As Integer, _
ByVal nHeight As Integer, _
ByVal hdcSrc As IntPtr, _
ByVal nXSrc As Integer, _
ByVal nYSrc As Integer, _
ByVal dwRop As Int32) As Boolean
Private Const FLOODFILLBORDER As UInteger = 0
Private Const FLOODFILLSURFACE As UInteger = 1
Private Const SRCCOPY = &HCC0020&
Private Structure LOGBRUSH
Public lbStyle As Integer
Public lbColor As Integer
Public lbHatch As Integer
End Structure
Dim oldX, oldY As Integer
Dim hDC As IntPtr
Dim hDC2 As IntPtr