CadEditor.UtilsGDI.ResizeBitmap C# (CSharp) Метод

ResizeBitmap() публичный статический Метод

public static ResizeBitmap ( Image sourceBMP, int width, int height ) : Image
sourceBMP Image
width int
height int
Результат Image
        public static Image ResizeBitmap(Image sourceBMP, int width, int height)
        {
            ResamplingService resamplingService = new ResamplingService();
            resamplingService.Filter = ResamplingFilters.Box;
            ushort[][,] input = ConvertBitmapToArray((Bitmap)sourceBMP);
            ushort[][,] output = resamplingService.Resample(input, width, height);
            Image imgCustom = (Image)ConvertArrayToBitmap(output);
            return imgCustom;
        }

Usage Example

Пример #1
0
        private void reloadAllData()
        {
            mapDatas = MapConfig.loadMap(curActiveMapNo);
            setPal();
            int videoPageId = curActiveVideo;

            videos = new Image[4][];
            var chunk = ConfigScript.getVideoChunk(videoPageId);

            for (int i = 0; i < 4; i++)
            {
                var images = new Image[256];
                for (int t = 0; t < 256; t++)
                {
                    images[t] = UtilsGDI.ResizeBitmap(ConfigScript.videoNes.makeImage(t, chunk, curPal, i), 16, 16);
                }
                videos[i] = images;
            }

            blocksScreen.Invalidate();

            mapScreen.Size = new Size(mapDatas[0].width * 16, mapDatas[0].height * 16);
            mapScreen.Invalidate();

            mapScreen2.Visible  = showSecondNametable;
            mapScreen2.Size     = mapScreen.Size;
            mapScreen2.Location = new Point(mapScreen.Location.X + mapScreen.Width, mapScreen2.Location.Y);
            mapScreen2.Invalidate();
        }
All Usage Examples Of CadEditor.UtilsGDI::ResizeBitmap