Hi there,
I try to run this code, but I always get an error like : Method SaveAs failed to run on Object IDrawBitmap ?
Any ideas ?
Sub Test()
Dim r As Shape, s As ShapeSet r = ActiveLayer.CreateRectangle(0, 0, 5, 5) r.Fill.UniformColor.CMYKAssign 100, 0, 0, 0 Set s = ActiveLayer.CreateEllipse2(3, 3, 2) s.Fill.UniformColor.CMYKAssign 0, 100, 100, 0 Set s = s.ConvertToBitmapEx(cdrRGBColorImage, False, True) s.CreateDropShadow cdrDropShadowFlat, 80, 10, 0.5, -0.5, CreateCMYKColor(0, 50, 50, 50)
r.CreateSelections.Selected = True
If (s.Type = cdrBitmapShape) Then MsgBox "isBitmapShape"
Dim ex As ExportFilter
Set ex = s.Bitmap.SaveAs("c:\newBMP.bmp", cdrBMP, cdrCompressionRLE_LW)
End Sub
Hi.
Try specifiaclly converting it to a bitmap. I added one line to your code:
Sub Test3333()Dim r As Shape, s As ShapeSet r = ActiveLayer.CreateRectangle(0, 0, 5, 5)r.Fill.UniformColor.CMYKAssign 100, 0, 0, 0Set s = ActiveLayer.CreateEllipse2(3, 3, 2)s.Fill.UniformColor.CMYKAssign 0, 100, 100, 0Set s = s.ConvertToBitmapEx(cdrRGBColorImage, False, True)s.CreateDropShadow cdrDropShadowFlat, 80, 10, 0.5, -0.5, CreateCMYKColor(0, 50, 50, 50)r.CreateSelections.Selected = True If (s.Type = cdrBitmapShape) Then MsgBox "isBitmapShape" Dim ex As ExportFilter Set s = s.ConvertToBitmapEx(cdrRGBColorImage, True, False, 300, 300, False) Set ex = s.Bitmap.SaveAs("d:\All Graphics\newBMP.bmp", cdrBMP, cdrCompressionRLE_LW)ex.FinishEnd Sub
~John
Set s = s.ConvertToBitmapEx(cdrRGBColorImage, True, False, 300, 300, False)
Set ex = s.Bitmap.SaveAs("Let me choose", cdrBMP, cdrCompressionRLE_LW)
John, is there any way to do an export with preset parameters but let me choose the directory and name first? Seems cd wants you to first choose name and directory then set parameters. Might be easier to create macros if it were the other way around.