Click here to Skip to main content
15,890,825 members
Home / Discussions / Visual Basic
   

Visual Basic

 
AnswerRe: HourGlass cursor Problem Pin
Johan Hakkesteegt13-Sep-09 22:43
Johan Hakkesteegt13-Sep-09 22:43 
GeneralRe: HourGlass cursor Problem Pin
mdrizwan_113-Sep-09 23:18
mdrizwan_113-Sep-09 23:18 
GeneralRe: HourGlass cursor Problem Pin
Johan Hakkesteegt13-Sep-09 23:20
Johan Hakkesteegt13-Sep-09 23:20 
QuestionHelp Using BitBlt Pin
Kobi_Z13-Sep-09 20:38
Kobi_Z13-Sep-09 20:38 
AnswerRe: Help Using BitBlt Pin
Christian Graus13-Sep-09 20:59
protectorChristian Graus13-Sep-09 20:59 
GeneralRe: Help Using BitBlt Pin
Kobi_Z13-Sep-09 21:32
Kobi_Z13-Sep-09 21:32 
GeneralRe: Help Using BitBlt Pin
Christian Graus14-Sep-09 0:54
protectorChristian Graus14-Sep-09 0:54 
AnswerRe: Help Using BitBlt Pin
orbano14-Sep-09 22:01
orbano14-Sep-09 22:01 
imho an efficienty pattern findign algorithm would be your best choice. using bitblt is like using the worst pattern finding solution ever Smile | :)
ofcourse you might want to aviod using GetPixel(). Heres a class, use this (unfortunately i cant give proper credit to the author):

-Load your bitmap;
-Create a fast bitmap.
-copy your loaded bitmap into fast bitmap (instanicate a graphics over it and use drawimage)
-you have a simple array of bites in the fast bitmap (bits). expose it and use with an efficient pattern finder.

public class FastBitmapEditor
    {
        public int Height;
        public int Width;
        public Bitmap bitmap;
        byte[] bits;
        GCHandle handle;
        int stride;
        int pixelFormatSize;


        public FastBitmapEditor(int width, int height)
        {
            Width = width;
            Height = height;
            PixelFormat format = PixelFormat.Format32bppArgb;
            pixelFormatSize = Image.GetPixelFormatSize(format) / 8;
            stride = width * pixelFormatSize;
            bits = new byte[stride * height];
            handle = GCHandle.Alloc(bits, GCHandleType.Pinned);
            IntPtr pointer = Marshal.UnsafeAddrOfPinnedArrayElement(bits, 0);
            bitmap = new Bitmap(width, height, stride, format, pointer);
        }

        public Color GetPixel(int x, int y)
        {
            int blue = bits[(y * Width + x) * 4];

            int green = bits[(y * Width + x) * 4 + 1];

            int red = bits[(y * Width + x) * 4 + 2];

            int alpha = bits[(y * Width + x) * 4 + 3];

            return Color.FromArgb(alpha, red, green, blue);
        }
}

QuestionNeed algorithm Pin
xx77abs13-Sep-09 7:26
xx77abs13-Sep-09 7:26 
AnswerRe: Need algorithm Pin
0x3c013-Sep-09 10:46
0x3c013-Sep-09 10:46 
GeneralRe: Need algorithm Pin
xx77abs14-Sep-09 0:23
xx77abs14-Sep-09 0:23 
AnswerRe: Need algorithm Pin
Johan Hakkesteegt13-Sep-09 19:54
Johan Hakkesteegt13-Sep-09 19:54 
GeneralRe: Need algorithm Pin
xx77abs14-Sep-09 0:24
xx77abs14-Sep-09 0:24 
AnswerRe: Need algorithm Pin
tosch13-Sep-09 20:31
tosch13-Sep-09 20:31 
GeneralRe: Need algorithm Pin
xx77abs14-Sep-09 0:25
xx77abs14-Sep-09 0:25 
GeneralRe: Need algorithm Pin
tosch15-Sep-09 2:35
tosch15-Sep-09 2:35 
GeneralRe: Need algorithm Pin
xx77abs15-Sep-09 8:30
xx77abs15-Sep-09 8:30 
QuestionHigh memory usage Pin
TheMrProgrammer13-Sep-09 5:22
TheMrProgrammer13-Sep-09 5:22 
AnswerRe: High memory usage Pin
Steven J Jowett13-Sep-09 5:31
Steven J Jowett13-Sep-09 5:31 
GeneralRe: High memory usage Pin
TheMrProgrammer13-Sep-09 6:31
TheMrProgrammer13-Sep-09 6:31 
GeneralRe: High memory usage Pin
Hurricane300013-Sep-09 6:38
Hurricane300013-Sep-09 6:38 
GeneralRe: High memory usage Pin
TheMrProgrammer13-Sep-09 18:01
TheMrProgrammer13-Sep-09 18:01 
GeneralRe: High memory usage Pin
N a v a n e e t h13-Sep-09 6:59
N a v a n e e t h13-Sep-09 6:59 
GeneralRe: High memory usage Pin
TheMrProgrammer13-Sep-09 18:02
TheMrProgrammer13-Sep-09 18:02 
GeneralRe: High memory usage Pin
Dave Kreskowiak13-Sep-09 15:21
mveDave Kreskowiak13-Sep-09 15:21 

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.