На главную Наши проекты:
Журнал   ·   Discuz!ML   ·   Wiki   ·   DRKB   ·   Помощь проекту
ПРАВИЛА FAQ Помощь Участники Календарь Избранное RSS
msm.ru
! Правила раздела Visual C++ / MFC / WTL (далее Раздела)
1) На Раздел распространяются все Правила Форума.
2) Перед тем, как создать новый топик, убедитесь, что Вы читали Правила создания тем в Разделе.
3) Вопросы, не связанные с программированием (настройки MS Visual Studio, книги, библиотеки и т.д.),
обсуждаются в разделе C/C++: Прочее
4) Вопросы разработки .NET (Windows Form, C++/CLI и т.п.) приложений на Visual C++/C# обсуждаются в разделе .NET.
5) Нарушение Правил может повлечь наказание со стороны модераторов.

Полезные ссылки:
user posted image FAQ Раздела user posted image Обновления для FAQ Раздела user posted image Поиск по Разделу user posted image MSDN Library Online
Модераторы: ElcnU
  
> BMP Rotation
    Can you please help me and tell me about Rotation of BMP format pictures in C in 320x200x256 mode.
    Write your answer in Russian...
    Please...
    Thanks. ???

      http://www.codeguru.com/bitmap/index.shtml

      http://www.codeproject.com/bitmap/
        Ещё путь:
        Цитата
        Bitmap Rotation
        To copy a bitmap into a parallelogram; use the PlgBlt function, which performs a bit-block transfer from a rectangle in a source device context into a parallelogram in a destination device context. To rotate the bitmap, an application must provide the coordinates, in world units, to be used for the corners of the parallelogram. (For more information about rotation and world units, see Coordinate Spaces and Transformations.)

        Цитата

        PlgBlt
        The PlgBlt function performs a bit-block transfer of the bits of color data from the specified rectangle in the source device context to the specified parallelogram in the destination device context. If the given bitmask handle identifies a valid monochrome bitmap, the function uses this bitmap to mask the bits of color data from the source rectangle.

        BOOL PlgBlt(
         HDC hdcDest,          // handle to destination DC
         CONST POINT *lpPoint, // destination vertices
         HDC hdcSrc,           // handle to source DC
         int nXSrc,            // x-coord of source upper-left corner
         int nYSrc,            // y-coord of source upper-left corner
         int nWidth,           // width of source rectangle
         int nHeight,          // height of source rectangle
         HBITMAP hbmMask,      // handle to bitmask
         int xMask,            // x-coord of bitmask upper-left corner
         int yMask             // y-coord of bitmask upper-left corner
        );
        Parameters
        hdcDest
        [in] Handle to the destination device context.
        lpPoint
        [in] Pointer to an array of three points in logical space that identify three corners of the destination parallelogram. The upper-left corner of the source rectangle is mapped to the first point in this array, the upper-right corner to the second point in this array, and the lower-left corner to the third point. The lower-right corner of the source rectangle is mapped to the implicit fourth point in the parallelogram.
        hdcSrc
        [in] Handle to the source device context.
        nXSrc
        [in] Specifies the x-coordinate, in logical units, of the upper-left corner of the source rectangle.
        nYSrc
        [in] Specifies the y-coordinate, in logical units, of the upper-left corner of the source rectangle.
        nWidth
        [in] Specifies the width, in logical units, of the source rectangle.
        nHeight
        [in] Specifies the height, in logical units, of the source rectangle.
        hbmMask
        [in] Handle to an optional monochrome bitmap that is used to mask the colors of the source rectangle.
        xMask
        [in] Specifies the x-coordinate, in logical units, of the upper-left corner of the monochrome bitmap.
        yMask
        [in] Specifies the y-coordinate, in logical units, of the upper-left corner of the monochrome bitmap.
        Return Values
        If the function succeeds, the return value is nonzero.

        If the function fails, the return value is zero.

        Windows NT/2000/XP: To get extended error information, call GetLastError.

        Remarks
        The PlgBlt function works with device-dependent bitmaps.

        The fourth vertex of the parallelogram (D) is defined by treating the first three points (A, B, and C) as vectors and computing D = B + C – A.

        If the bitmask exists, a value of one in the mask indicates that the source pixel color should be copied to the destination. A value of zero in the mask indicates that the destination pixel color is not to be changed. If the mask rectangle is smaller than the source and destination rectangles, the function replicates the mask pattern.

        Scaling, translation, and reflection transformations are allowed in the source device context; however, rotation and shear transformations are not. If the mask bitmap is not a monochrome bitmap, an error occurs. The stretching mode for the destination device context is used to determine how to stretch or compress the pixels, if that is necessary.

        When an enhanced metafile is being recorded, an error occurs if the source device context identifies an enhanced-metafile device context.

        The destination coordinates are transformed according to the destination device context; the source coordinates are transformed according to the source device context. If the source transformation has a rotation or shear, an error is returned.

        If the destination and source rectangles do not have the same color format, PlgBlt converts the source rectangle to match the destination rectangle.

        Not all devices support the PlgBlt function. For more information, see the description of the RC_BITBLT raster capability in the GetDeviceCaps function.

        If the source and destination device contexts represent incompatible devices, PlgBlt returns an error.

        Windows 2000/XP: When used in a multiple monitor system, both hdcSrc and hdcDest must refer to the same device or the function will fail. To transfer data between DCs for different devices, convert the memory bitmap to a DIB by calling GetDIBits. To display the DIB to the second device, call SetDIBits or StretchDIBits.

        Requirements
         Windows NT/2000/XP: Included in Windows NT 3.1 and later.
         Windows 95/98/Me: Unsupported.
         Header: Declared in Wingdi.h; include Windows.h.
         Library: Use Gdi32.lib.
          привет.

          создаешь новый битмар, берешь пиксель, и копируешь с новыми координатами. формула поворота точки относительно нуля на угол а:
          x1=-x*sin(a)+y*cos(a)
          y1=x*cos(a)+y*sin(a)

          пока
            А что будет с теми пикселями, кторые останутся не заполненными? Да и быстродействие будет поганое.
              Насчет пустых точек. При сканировании каждой точки (при выводе на экран) нужно ее ОБРАТНО поворачивать и вытягивать из битмапа нужные точки тогда и дыр не будет! :)
                Кстати, если еще интересует, есть пару исходничков именно по твоему вопросу -- 320x200x256 Rotation+Scaling+Tiling. Если интересует, мыль.

                e-mail :  goblin@pstu.edu
                                                                         Uj,kby
                  Меня тоже интересует.
                    Цитата Uj_comma_kby, 22.02.02, 10:57:37
                    Кстати, если еще интересует, есть пару исходничков именно по твоему вопросу -- 320x200x256 Rotation+Scaling+Tiling. Если интересует, мыль.

                    e-mail :  goblin@pstu.edu
                                                                             Uj,kby


                    Кинь и мне на SUnteXx@pisem.net
                    0 пользователей читают эту тему (0 гостей и 0 скрытых пользователей)
                    0 пользователей:


                    Рейтинг@Mail.ru
                    [ Script execution time: 0,0305 ]   [ 16 queries used ]   [ Generated: 2.05.24, 21:38 GMT ]