Home > Net >  Consult: c # redraw loading image dithering problem quickly
Consult: c # redraw loading image dithering problem quickly

Time:04-15

Main loading drawing below, loading image is big size, each time only load part of the image shows the effect of forward, eventually the current method of jitter, and the speed is slow, the great god, have a good solution,
String ludisk=the string. Format (" D: \ \ 11 \ \ 0101 JPG ");
The Stream s=File. Open (ludisk, FileMode. Open, FileAccess. Read, FileShare. ReadWrite);
//imgL=Image. FromStream (s);
ImgL=Bitmap. FromStream (s);
Spyware doctor ispose ();

Bit=(Bitmap) imgL;

Label1. Text=bit. Width. The ToString () + "____" + bit. Height. The ToString ();

GraphicsUnit units=GraphicsUnit. Pixel;//units set into pixels

Bitmap bmpVoltage1=new Bitmap (Width - 50, Height);
Graphics gVoltage1=Graphics. FromImage (bmpVoltage1);

For (int I=0; I & lt; 5000; I=I + 1)
{
Srect=new Rectangle (I, 00, 2000, 1080);

//gVoltage1. DrawImage (bit, the rect, I, 0200, 0108, units);
GVoltage1. DrawImage (bit, 0, 0, srect, units);
//gVoltage1. DrawImage (bit drect, srect, units);
PictureBox. Image=bmpVoltage1;
PictureBox. The Update ();
PictureBox. Invalidate ();
}

CodePudding user response:

In speed adjustment for it every time I increase the size of the jitter is likely to be the faster, the greater the

CodePudding user response:

PictureBox. The Update ();//update the display immediately, will refresh the picturebox. Image, do a whole drawing
PictureBox. Invalidate ();//send a message that pictureBox visible parts all invalid, trigger drawing

The two, you delete the second try,
In addition, under the double buffer drawing understanding,

CodePudding user response:

Open the double buffered DoubleBuffered=true;
All controls have this property

CodePudding user response:

Is open the double buffered pictureBox control

CodePudding user response:

refer to the second floor rabbit party - consultant reply:
pictureBox. The Update ();//update the display immediately, will refresh the picturebox. Image, do a whole drawing
PictureBox. Invalidate ();//send a message that pictureBox visible parts all invalid, trigger drawing

The two, you delete the second try,
In addition, under the double buffer drawing understanding,


Delete the effect is the same, no improvement, double cache is opened

CodePudding user response:

Drawing 5000 patterns, that is, a few microseconds, did not show a color piece, just because your machine also has a little difference
  •  Tags:  
  • C#
  • Related