79352946

Date: 2025-01-13 17:07:36
Score: 0.5
Natty:
Report link

Full code

 'Dim bm As Bitmap
    Dim x As Long, y As Long
    Dim kolor As Color
    x = 0
    y = 0

    Dim whitePix As Boolean
         
    
    whitePix= False


    'For x = 0 To sh.Bitmap.Image.Height - 1
     Do While x < sh.Bitmap.Image.Height - 1

        'For y = 0 To sh.Bitmap.Image.Width - 1
        Do While y < sh.Bitmap.Image.Width - 1

            
            Set kolor = sh.Bitmap.Image.Pixel(x, y)
            'kolor = kolor.ConvertToCMYK

            With kolor
                If .Type = cdrColorCMYK Then
                    If kolor.CMYKBlack = 0 And .CMYKCyan = 0 And .CMYKMagenta = 0 And .CMYKYellow = 0 Then
                        whitePix = True
                    End If
                ElseIf .Type = cdrColorRGB Then
                    If .RGBRed > 253 And .RGBGreen > 253 And .RGBBlue > 253 Then
                        whitePix = True
                    End If
                End If

            End With
               

        'Next y
        y = y + 1
        Loop
    'Next x
     x = x + 1
    Loop

sh = shape

SHAPE

Which line throws that error? I

The problem is caused by the line that declares the loop limit. Of course, it depends on the size of the image (larger than 300 x 300 pixels).

Reasons:
  • Long answer (-1):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Chora Poczta