Rank: Member
Groups: Member
Joined: 7/26/2007(UTC) Posts: 3
|
I need to put some text on a 1bpp CCITT4 tiff file. Since this can't be done directly, I had to ConvertTo24bppRgb(), DrawText() and finally convert it back ConvertTo1bppIndexed(). After I SaveToFile() and load the file in a viewer (ex. Paint), the colors are inverted. Is this normal? Do I have to Invert() the image every time? Thanks.
|
|
|
|
Rank: Advanced Member
Groups: Member, Administration, Moderator Joined: 8/3/2003(UTC) Posts: 1,070
Thanks: 1 times Was thanked: 12 time(s) in 12 post(s)
|
Hello,
Could you post complete code sample which you use to draw text here? |
|
|
|
|
Rank: Member
Groups: Member
Joined: 7/26/2007(UTC) Posts: 3
|
Here's the code in VFP: Code:
WITH THISFORM.BitmapViewer.Bitmap
lcMyFile = 'myfile.tif' && 1bpp file
.LoadFromFile(lcMyFile)
.FormatAutoSelect = .F.
.Unit = 2
.Graphics.TextFormat.FontName = 'Arial'
.Graphics.TextFormat.FontColor = 0
.Graphics.TextFormat.FontSize = .1
lnImgWidth = .Data.ScaleWidth
lnImgHeight = .Data.ScaleHeight / 2
.Data.ConvertTo24bppRgb()
lcString = 'This is a test'
lnTxtWidth = .Graphics.TextFormat.MeasureTextWidth(lcString) / 2
.Graphics.DrawText(lcString, lnImgWidth - .74, lnImgHeight - lnTxtWidth, 90)
.ColorAdjustment.Invert()
.Data.ConvertTo1bppIndexed()
.Formats.SelectCurrent('TIFF')
.Formats.TiffCompressionType = 5
.SaveToFile(lcMyFile)
ENDWITH
Thanks, Eric
|
|
|
|
Rank: Advanced Member
Groups: Member
Joined: 5/14/2007(UTC) Posts: 24
Was thanked: 1 time(s) in 1 post(s)
|
Hello Eric,
Thank you for reporting us about this problem. It appears a bug. We will fix it in the further release.
You may additionally use Invert method as a workaround.
Best regards, Tatyana Bertyakova |
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.