VoyForums

Login ] [ Contact Forum Admin ] [ Main index ] [ Post a new message ] [ Search | Check update time | Archives: 12345678[9]10 ]


[ Next Thread | Previous Thread | Next Message | Previous Message ]

Date Posted: 21:54:14 11/09/00 Thu
Author: batter
Subject: How to deal with 1bit color depth graphic?

Please Read These Code
--------------------------------------------------------
TTiffGraphic *SrcGraphic, *TarGraphic;
SrcGraphic = new TTiffGraphic();
TarGraphic = new TTiffGraphic();
SrcGraphic->LoadFromFile("xxxxxxxx.tif");
RGBTRIPLE *SrcRow, *DesRow;
TarGraphic->NewImage(Width,Height,SrcGraphic->ImageFormat,NULL ,SrcGraphic->XDotsPerInch,SrcGraphic->YDotsPerInch);
int Width;
Width = SrcGraphic->Width;
Height = SrcGraphic->Height;

for (int y = 0; y < Height; y++) {
DesRow = (RGBTRIPLE*)TarGraphic->ScanLine[y];
SrcRow = (RGBTRIPLE*)SrcGraphic->ScanLine[y];
for (int x = 0; x < Width; x++) {
DesRow[x] = SrcRow[Width - x - 1];
}
}

-------------------------------------------------------
While Tif file not black&white , Run Sucessfully.
but Tif file is black&white, Crash in For{For{}}.

Thanks a lot

[ Next Thread | Previous Thread | Next Message | Previous Message ]


Replies:


[ Contact Forum Admin ]


Forum timezone: GMT-5
VF Version: 3.00b, ConfDB:
Before posting please read our privacy policy.
VoyForums(tm) is a Free Service from Voyager Info-Systems.
Copyright © 1998-2019 Voyager Info-Systems. All Rights Reserved.